> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developer.ideogram.ai/v1/api-reference/generate-images/generate-transparent-v4/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.ideogram.ai/_mcp/server. # Generate with Ideogram 4.0 (Transparent Background) POST https://api.ideogram.ai/v1/ideogram-v4/generate-transparent Content-Type: multipart/form-data Generates images with a transparent background synchronously using the Ideogram 4.0 model. The result is delivered as a PNG with an alpha channel. All Ideogram 4.0 aspect ratios are supported, including `AUTO`, which lets the model select the most suitable ratio from the prompt. `output_resolution` selects the delivered resolution tier. Tiers are total-pixel budgets: wide and tall aspect ratios keep the same pixel budget as the square of the named size, so a single dimension may exceed it. The response reports the final delivered resolution. 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/v1/api-reference/generate-images/generate-transparent-v4 ## 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. - `text_prompt` (string, optional) — A natural-language prompt for image generation. When supplied, magic-prompt is enabled automatically. Mutually exclusive with `json_prompt`. - `json_prompt` (V4JsonPrompt, optional) — A structured prompt that conforms to the Ideogram 4.0 JSON contract. When supplied, magic-prompt is disabled and the structured prompt is consumed by the diffusion model directly, except that `compositional_deconstruction.background` is replaced with a transparent-background directive. Mutually exclusive with `text_prompt`. - `aspect_ratio` (enum, optional) - `output_resolution` (enum, optional) - `rendering_speed` (enum, optional) - `enable_copyright_detection` (boolean, optional) — Optional. Opt this request into post-generation copyright detection (Hive likeness + logo checks). The effective gate is the OR of this field and the organization's `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. ## Response ### 200 Image generated successfully. - `created` (datetime, required) — The time the request was created. - `data` (list of ImageGenerationObjectV4, required) — A list of ImageObjects that contain the generated image(s). - `response_type` (enum, optional) — Discriminator for the postGenerateDesignV4 oneOf response. Always "url" for this shape. - Allowed values: `url` ## Errors ### 400 Bad Request Error Invalid input provided. - `any` ### 401 Unauthorized Error Not authorized. - `any` ### 422 Unprocessable Entity Error Prompt failed the safety check. - `error` (string, required) ### 429 Too Many Requests Error Too many requests. - `any` ## Types ### ImageGenerationObjectV4 - `prompt` (string, required) — The prompt used for the generation. This may be different from the original prompt. - `resolution` (string, required) — The output resolution of the image, in the format WIDTHxHEIGHT (e.g. 1024x1024). Not limited to the request resolution presets, since some endpoints accept custom output sizes. - `is_image_safe` (boolean, required) — Whether this request passes safety checks. If false, the url field will be empty. - `seed` (integer, required) — Random seed. Set for reproducible generation. - `url` (string, optional, nullable) — The direct link to the image generated. ## Examples **Request** ```json { "aspect_ratio": "1x1", "output_resolution": "4K", "rendering_speed": "TURBO", "text_prompt": "A logo for Ideogram Coffee." } ``` **Response** ```json { "created": {}, "data": [ { "prompt": "A logo for Ideogram Coffee.", "resolution": "4096x4096", "is_image_safe": true, "seed": 12345, "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89" } ] } ``` **SDK Code** ```python import requests url = "https://api.ideogram.ai/v1/ideogram-v4/generate-transparent" payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"aspect_ratio\"\r\n\r\n1x1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"enable_copyright_detection\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"json_prompt\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_resolution\"\r\n\r\n4K\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rendering_speed\"\r\n\r\nTURBO\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text_prompt\"\r\n\r\nA logo for Ideogram Coffee.\r\n-----011000010111000001101001--\r\n" headers = { "Api-Key": "", "Content-Type": "multipart/form-data; boundary=---011000010111000001101001" } response = requests.post(url, data=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.ideogram.ai/v1/ideogram-v4/generate-transparent'; const form = new FormData(); form.append('aspect_ratio', '1x1'); form.append('enable_copyright_detection', ''); form.append('json_prompt', ''); form.append('output_resolution', '4K'); form.append('rendering_speed', 'TURBO'); form.append('text_prompt', 'A logo for Ideogram Coffee.'); 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-v4/generate-transparent" payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"aspect_ratio\"\r\n\r\n1x1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"enable_copyright_detection\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"json_prompt\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_resolution\"\r\n\r\n4K\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rendering_speed\"\r\n\r\nTURBO\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text_prompt\"\r\n\r\nA logo for Ideogram Coffee.\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-v4/generate-transparent") 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=\"aspect_ratio\"\r\n\r\n1x1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"enable_copyright_detection\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"json_prompt\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_resolution\"\r\n\r\n4K\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rendering_speed\"\r\n\r\nTURBO\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text_prompt\"\r\n\r\nA logo for Ideogram Coffee.\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-v4/generate-transparent") .header("Api-Key", "") .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"aspect_ratio\"\r\n\r\n1x1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"enable_copyright_detection\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"json_prompt\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_resolution\"\r\n\r\n4K\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rendering_speed\"\r\n\r\nTURBO\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text_prompt\"\r\n\r\nA logo for Ideogram Coffee.\r\n-----011000010111000001101001--\r\n") .asString(); ``` ```php request('POST', 'https://api.ideogram.ai/v1/ideogram-v4/generate-transparent', [ 'multipart' => [ [ 'name' => 'aspect_ratio', 'contents' => '1x1' ], [ 'name' => 'output_resolution', 'contents' => '4K' ], [ 'name' => 'rendering_speed', 'contents' => 'TURBO' ], [ 'name' => 'text_prompt', 'contents' => 'A logo for Ideogram Coffee.' ] ] 'headers' => [ 'Api-Key' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.ideogram.ai/v1/ideogram-v4/generate-transparent"); var request = new RestRequest(Method.POST); request.AddHeader("Api-Key", ""); request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"aspect_ratio\"\r\n\r\n1x1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"enable_copyright_detection\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"json_prompt\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"output_resolution\"\r\n\r\n4K\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rendering_speed\"\r\n\r\nTURBO\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text_prompt\"\r\n\r\nA logo for Ideogram Coffee.\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Api-Key": ""] let parameters = [ [ "name": "aspect_ratio", "value": "1x1" ], [ "name": "enable_copyright_detection", "value": ], [ "name": "json_prompt", "value": ], [ "name": "output_resolution", "value": "4K" ], [ "name": "rendering_speed", "value": "TURBO" ], [ "name": "text_prompt", "value": "A logo for Ideogram Coffee." ] ] 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-v4/generate-transparent")! 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() ```