> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developer.ideogram.ai/api-reference/api-reference/layerize-text-v3/llms.txt. > For full documentation content, see https://developer.ideogram.ai/api-reference/api-reference/layerize-text-v3/llms-full.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.ideogram.ai/api-reference/api-reference/layerize-text-v3/_mcp/server. # Layerize Text # Layerize Text POST https://api.ideogram.ai/v1/ideogram-v3/layerize-text Content-Type: multipart/form-data Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling. The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks. Supported image formats include JPEG, PNG, and WebP (max size 10MB). Image links are available for a limited period of time; if you would like to keep the image, you must download it. Reference: https://developer.ideogram.ai/api-reference/api-reference/layerize-text-v3 ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: API version: 1.0.0 paths: /v1/ideogram-v3/layerize-text: post: operationId: post-layerize-text-v-3 summary: Layerize Text description: > Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling. The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks. Supported image formats include JPEG, PNG, and WebP (max size 10MB). Image links are available for a limited period of time; if you would like to keep the image, you must download it. tags: - subpackage_generate parameters: - name: Api-Key in: header description: >- API key for access control. Use in the header with the name \"Api-Key\" required: true schema: type: string responses: '200': description: Text layers detected and extracted successfully. content: application/json: schema: $ref: '#/components/schemas/LayerizeTextResponse' '400': description: Invalid input provided. content: application/json: schema: description: Any type '401': description: Not authorized. content: application/json: schema: description: Any type '429': description: Too many requests. content: application/json: schema: description: Any type requestBody: description: A request to detect and extract text layers from an image. content: multipart/form-data: schema: type: object properties: image: type: string format: binary description: >- The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 10MB). prompt: type: string description: >- An optional text description of the image. If not provided, a description will be auto-generated from the image. seed: $ref: '#/components/schemas/Seed' required: - image servers: - url: https://api.ideogram.ai components: schemas: Seed: type: integer description: Random seed. Set for reproducible generation. title: Seed LayerizeTextResponse: type: object properties: base_image_url: type: string format: uri description: URL of the image with all detected text removed. original_image_url: type: - string - 'null' format: uri description: URL of the original image with text intact. seed: type: integer description: Random seed. Set for reproducible generation. required: - base_image_url - seed description: > The response containing detected text blocks and a text-erased base image. Image links are available for a limited period of time; if you would like to keep the image, you must download it. title: LayerizeTextResponse securitySchemes: ApiKeyAuth: type: apiKey in: header name: Api-Key description: API key for access control. Use in the header with the name \"Api-Key\" ``` ## SDK Code Examples ```python import requests url = "https://api.ideogram.ai/v1/ideogram-v3/layerize-text" files = { "image": "open('string', 'rb')" } payload = { "prompt": , "seed": } headers = {"Api-Key": ""} response = requests.post(url, data=payload, files=files, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.ideogram.ai/v1/ideogram-v3/layerize-text'; const form = new FormData(); form.append('image', 'string'); form.append('prompt', ''); form.append('seed', ''); const options = {method: 'POST', headers: {'Api-Key': ''}}; 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/v1/ideogram-v3/layerize-text" payload := strings.NewReader("-----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\n") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Api-Key", "") 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/ideogram-v3/layerize-text") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Api-Key"] = '' request.body = "-----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\n" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.ideogram.ai/v1/ideogram-v3/layerize-text") .header("Api-Key", "") .body("-----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\n") .asString(); ``` ```php request('POST', 'https://api.ideogram.ai/v1/ideogram-v3/layerize-text', [ 'multipart' => [ [ 'name' => 'image', 'filename' => 'string', 'contents' => null ] ] 'headers' => [ 'Api-Key' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.ideogram.ai/v1/ideogram-v3/layerize-text"); var request = new RestRequest(Method.POST); request.AddHeader("Api-Key", ""); request.AddParameter("undefined", "-----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\n", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Api-Key": ""] let parameters = [ [ "name": "image", "fileName": "string" ], [ "name": "prompt", "value": ], [ "name": "seed", "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/v1/ideogram-v3/layerize-text")! 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() ```