> 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.

# Layerize text with Ideogram 3.0

POST https://api.ideogram.ai/v2/design/layerize/ideogram-3
Content-Type: multipart/form-data

Turn a flat image into an editable design: detected text is returned as
positioned text blocks with matched fonts, sizes, and colors, alongside
a text-free base image. Upload the image as `image` using
`multipart/form-data`. Returns results directly by default; set `async`
or supply a `webhook_url` to get a `generation_id` and poll
`GET /v2/generations/{generation_id}`.

Reference: https://developer.ideogram.ai/api-reference/images/layerize/ideogram-3

## Authentication

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

## Request

### Query parameters

- `dry_run` (boolean, optional, default: false) — When true, the request is validated and priced but not run: nothing is generated, stored, or billed, and no safety review is performed. The response is a `PriceQuote` object instead of the usual response for this endpoint. Send exactly the request you would send to generate, so the quote reflects the same options.

### Body (multipart/form-data)

This endpoint expects a multipart form with multiple files.

- `image` (file, required) — The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only.
- `prompt` (string, optional) — A description of the image, used to guide text detection. When omitted, detection runs on the image alone.
- `seed` (integer, optional) — Random seed. Set for reproducible generation.
- `font_candidate_files` (files, optional) — Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only.
- `async` (boolean, optional) — When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- `webhook_url` (string, optional) — HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a JSON POST to this URL once all images for the request have finished generating. The body mirrors the synchronous generate response: `request_id`, `created`, and a `data` array containing every generated image (`url`, `prompt`, `resolution`, `seed`, `is_image_safe`). Each delivery is signed with Ed25519 and verifiable against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS; private and loopback hosts and the cloud metadata service are rejected.

## Response

### 200

The layerized design (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).

- `generation_id` (string, required) — URL-safe base64 ID of the generation. Use it to poll `GET /v2/generations/{generation_id}`.
- `seed` (integer, required) — Random seed. Set for reproducible generation.
- `data` (list of LayerizedImageObject, optional) — The layerized design. Present only for synchronous requests (`async` omitted or false).

## Errors

### 400 Bad Request Error

Invalid input provided.

- `any`

### 401 Unauthorized Error

Unauthorized.

- `any`

### 402 Payment Required Error

Insufficient credits or quota.

- `error` (string, required) — A message describing why the generation request was rejected.
- `reject_reason` (enum, required) — The account or usage limit that rejected a generation request.
  - Allowed values: `insufficient_funds`, `subscription_required`, `daily_limit`, `priority_credit_required`, `inflight_limit`, `feature_limit`
- `max_inflight_requests` (integer, optional) — How many generations the account may have in progress at once on the queue this request resolved to. Present when `reject_reason` is `inflight_limit`.
- `task_completion_speed` (enum, optional) — The queue this request resolved to. Present when `reject_reason` is `inflight_limit`.
  - Allowed values: `fast`, `slow`

### 403 Forbidden Error

Not authorized to layerize images.

- `any`

### 404 Not Found Error

The source image was not found.

- `any`

### 429 Too Many Requests Error

Too many requests.

- `error` (string, required) — A message describing why the generation request was rejected.
- `reject_reason` (enum, required) — The account or usage limit that rejected a generation request.
  - Allowed values: `insufficient_funds`, `subscription_required`, `daily_limit`, `priority_credit_required`, `inflight_limit`, `feature_limit`
- `max_inflight_requests` (integer, optional) — How many generations the account may have in progress at once on the queue this request resolved to. Present when `reject_reason` is `inflight_limit`.
- `task_completion_speed` (enum, optional) — The queue this request resolved to. Present when `reject_reason` is `inflight_limit`.
  - Allowed values: `fast`, `slow`

### 500 Internal Server Error

Internal server error.

- `any`

### 503 Service Unavailable Error

The endpoint is temporarily unavailable.

- `any`

## Types

### LayerizedImageObject

One layerized design. Image links are available for a limited period of time; if you would like to keep an image, you must download it.

- `resolution` (string, required) — The resolution of the design, formatted as "WIDTHxHEIGHT".
- `is_image_safe` (boolean, required) — Whether the image passed safety checks. If false, the image links are empty.
- `seed` (integer, required) — Random seed. Set for reproducible generation.
- `text_blocks` (list of DetectedTextBlock, required) — Flat list of detected text regions in the design.
- `url` (string, optional, nullable) — The direct link to the design image with its text intact. Empty when the image did not pass safety checks.
- `base_image_url` (string, optional, nullable) — The direct link to the base image with all detected text removed. Empty when the image did not pass safety checks.

### DetectedTextBlock

A single detected text region with its position, content, font information, and styling.

- `x` (integer, required) — X coordinate in pixels from the top-left corner.
- `y` (integer, required) — Y coordinate in pixels from the top-left corner.
- `width` (integer, required) — Width of the text region in pixels.
- `height` (integer, required) — Height of the text region in pixels.
- `text` (string, required) — The detected text content. Line breaks are represented as \n.
- `alignment` (enum, required) — Detected text alignment.
  - Allowed values: `left`, `center`, `right`
- `formatting` (list of enum, required) — Detected text formatting effects.
  - Allowed values: `bold`, `italic`, `underline`, `strikethrough`, `all_caps`, `small_caps`, `superscript`, `subscript`
- `angle` (float, optional, default: 0) — Rotation angle in degrees (clockwise). Defaults to 0.
- `font_name` (string, optional, nullable) — Best-matching font name from the font library.
- `font_alternatives` (list of string, optional, nullable) — Alternative font matches, ranked by similarity.
- `font_size` (integer, optional, nullable) — Detected font size in points.
- `line_height` (float, optional, nullable) — Line height multiplier (e.g., 1.2).
- `color` (string, optional, nullable) — Detected text color in hex format.
- `role` (enum, optional, nullable) — Inferred typographic role of this text block.
  - Allowed values: `heading`, `subheading`, `body`, `caption`

## Examples

**Request**

```json
{
  "font_candidate_files": [],
  "image": "<file: string>"
}
```

**Response**

```json
{
  "generation_id": "generation_id",
  "seed": 12345,
  "data": [
    {
      "resolution": "1024x1024",
      "is_image_safe": true,
      "seed": 12345,
      "text_blocks": [
        {
          "x": 0,
          "y": 6,
          "width": 1,
          "height": 5,
          "text": "Hello World",
          "alignment": "left",
          "formatting": [
            "bold",
            "bold"
          ],
          "angle": 5.637377,
          "font_name": "font_name",
          "font_alternatives": [
            "font_alternatives",
            "font_alternatives"
          ],
          "font_size": 2,
          "line_height": 7.0614014,
          "color": "#212121",
          "role": "heading"
        },
        {
          "x": 0,
          "y": 6,
          "width": 1,
          "height": 5,
          "text": "Hello World",
          "alignment": "left",
          "formatting": [
            "bold",
            "bold"
          ],
          "angle": 5.637377,
          "font_name": "font_name",
          "font_alternatives": [
            "font_alternatives",
            "font_alternatives"
          ],
          "font_size": 2,
          "line_height": 7.0614014,
          "color": "#212121",
          "role": "heading"
        }
      ],
      "url": "https://openapi-generator.tech",
      "base_image_url": "https://openapi-generator.tech",
      "object_type": "layerized_image"
    },
    {
      "resolution": "1024x1024",
      "is_image_safe": true,
      "seed": 12345,
      "text_blocks": [
        {
          "x": 0,
          "y": 6,
          "width": 1,
          "height": 5,
          "text": "Hello World",
          "alignment": "left",
          "formatting": [
            "bold",
            "bold"
          ],
          "angle": 5.637377,
          "font_name": "font_name",
          "font_alternatives": [
            "font_alternatives",
            "font_alternatives"
          ],
          "font_size": 2,
          "line_height": 7.0614014,
          "color": "#212121",
          "role": "heading"
        },
        {
          "x": 0,
          "y": 6,
          "width": 1,
          "height": 5,
          "text": "Hello World",
          "alignment": "left",
          "formatting": [
            "bold",
            "bold"
          ],
          "angle": 5.637377,
          "font_name": "font_name",
          "font_alternatives": [
            "font_alternatives",
            "font_alternatives"
          ],
          "font_size": 2,
          "line_height": 7.0614014,
          "color": "#212121",
          "role": "heading"
        }
      ],
      "url": "https://openapi-generator.tech",
      "base_image_url": "https://openapi-generator.tech",
      "object_type": "layerized_image"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.ideogram.ai/v2/design/layerize/ideogram-3"

files = { "image": "open('string', 'rb')" }
payload = {
    "async": ,
    "prompt": ,
    "seed": ,
    "webhook_url": 
}
headers = {"Api-Key": "<apiKey>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.ideogram.ai/v2/design/layerize/ideogram-3';
const form = new FormData();
form.append('async', '');
form.append('image', 'string');
form.append('prompt', '');
form.append('seed', '');
form.append('webhook_url', '');

const options = {method: 'POST', headers: {'Api-Key': '<apiKey>'}};

options.body = form;

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.ideogram.ai/v2/design/layerize/ideogram-3"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"async\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"seed\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")

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

	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/v2/design/layerize/ideogram-3")

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

request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<apiKey>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"async\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"seed\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\n\r\n-----011000010111000001101001--\r\n"

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/v2/design/layerize/ideogram-3")
  .header("Api-Key", "<apiKey>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"async\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"seed\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.ideogram.ai/v2/design/layerize/ideogram-3', [
  'multipart' => [
    [
        'name' => 'image',
        'filename' => 'string',
        'contents' => null
    ]
  ]
  'headers' => [
    'Api-Key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.ideogram.ai/v2/design/layerize/ideogram-3");
var request = new RestRequest(Method.POST);
request.AddHeader("Api-Key", "<apiKey>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"async\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"seed\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Api-Key": "<apiKey>"]
let parameters = [
  [
    "name": "async",
    "value": 
  ],
  [
    "name": "image",
    "fileName": "string"
  ],
  [
    "name": "prompt",
    "value": 
  ],
  [
    "name": "seed",
    "value": 
  ],
  [
    "name": "webhook_url",
    "value": 
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.ideogram.ai/v2/design/layerize/ideogram-3")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```