> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.ideogram.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.ideogram.ai/_mcp/server.

# Detect and remove reference logos from an image

POST https://api.ideogram.ai/v1/layerize-logos
Content-Type: multipart/form-data

Detects caller-supplied reference logos in a flat design image, inpaints
them out, and returns the cleaned image together with the matched
bounding boxes (each tagged with the matching reference's `REF_<n>`).

Reference: https://developer.ideogram.ai/v1/api-reference/tools/layerize-logos

## Authentication

- `Api-Key` header (required) — API key for access control. Use in the header with the name \"Api-Key\"

## Request

### Body (multipart/form-data)

This endpoint expects a multipart form with multiple files.

- `design_image` (file, required) — The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB).
- `reference_images` (files, required) — Reference image assets to match against logos and image elements detected in `design_image`. Each entry is assigned a `ref_id` of `REF_0`, `REF_1`, ... in the order it appears in the request (maximum 10 images). The images should be in JPEG, PNG, or WebP format.

## Response

### 200

Detection completed (may contain zero matches).

- `base_image_url` (string, required) — URL of the design image with all detected reference images inpainted out.
- `layers` (list of ImageLayerV3, required) — Matched reference images, each with its bounding box on the original design.

## Errors

### 400 Bad Request Error

Invalid input provided.

- `any`

### 429 Too Many Requests Error

Too many requests.

- `any`

## Types

### ImageLayerV3

An image layer (logo, brand asset, icon) for a layered image generation.

- `x` (integer, required) — The x coordinate of the layer.
- `y` (integer, required) — The y coordinate of the layer.
- `width` (integer, required) — The width of the layer.
- `height` (integer, required) — The height of the layer.
- `ref_id` (string, optional) — Reference ID matching a provided reference image (e.g., "REF_0"), or -1 if no match.

## Examples

**Response**

```json
{
  "base_image_url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89",
  "layers": [
    {
      "x": 832,
      "y": 96,
      "width": 220,
      "height": 88,
      "ref_id": "REF_0"
    }
  ]
}
```

**SDK Code**

```python
import requests

response = requests.post(
  "https://api.ideogram.ai/v1/layerize-logos",
  headers={
    "Api-Key": "<apiKey>"
  },
  files=[
    ("design_image", open("<file1>", "rb")),
    ("reference_images", open("<file2>", "rb")),
    ("reference_images", open("<file3>", "rb")),
  ]
)
print(response.json())

```

```javascript
const url = 'https://api.ideogram.ai/v1/layerize-logos';
const options = {method: 'POST', headers: {'Api-Key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.ideogram.ai/v1/layerize-logos"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Api-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.ideogram.ai/v1/layerize-logos")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.ideogram.ai/v1/layerize-logos")
  .header("Api-Key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.ideogram.ai/v1/layerize-logos', [
  'headers' => [
    'Api-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.ideogram.ai/v1/layerize-logos");
var request = new RestRequest(Method.POST);
request.AddHeader("Api-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Api-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.ideogram.ai/v1/layerize-logos")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```