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

# Generate transparent images with Ideogram 4.0

POST https://api.ideogram.ai/v2/image/generate/ideogram-4-transparent
Content-Type: application/json

Generate images on a transparent background with Ideogram 4.0, delivered
as PNGs with alpha. 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/generate/ideogram-4-transparent

## 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 (application/json)

This endpoint expects a GenerateImageIdeogramV4TransparentRequest.

- `prompt` (string, required) — The prompt to generate images from, in natural language or as a structured Ideogram 4.0 JSON prompt. A structured JSON prompt is used as is and skips magic prompt, except that its background description is replaced with a transparent background.
- `magic_prompt` (enum, optional, default: auto) — Controls how a natural-language prompt is prepared. `auto` (the default) and `on` rewrite and expand the prompt before generation. `off` keeps your wording and only converts it into a structured prompt. A valid structured JSON prompt skips magic prompt unless `magic_prompt` is `on`.
  - Allowed values: `auto`, `on`, `off`
- `seed` (integer, optional) — Random seed. Set for reproducible generation.
- `num_images` (integer, optional, default: 1) — The number of images to generate.
- `aspect_ratio` (enum, optional, default: auto) — The aspect ratio for an Ideogram 4.0 magic prompt. `auto` lets the model select the most suitable ratio from the prompt; any other value pins the ratio. The non-auto values are the buckets the 4.0 model supports.
  - Allowed values: `auto`, `1x4`, `1x3`, `1x2`, `9x16`, `10x16`, `2x3`, `3x4`, `4x5`, `1x1`, `5x4`, `4x3`, `3x2`, `16x10`, `16x9`, `2x1`, `3x1`, `4x1`
- `output_resolution` (enum, optional, default: 1k) — The output resolution tier. Each tier is a total pixel budget equal to a square of the named size (for example, `8k` delivers at most 8192x8192 pixels in total). Wide and tall aspect ratios keep the same budget, so one side may exceed the named size. Tiers above 2k are produced by upscaling after generation. Defaults to 1k.
  - Allowed values: `1k`, `2k`, `4k`, `8k`
- `rendering_speed` (enum, optional, default: default) — The rendering speed to use.
  - Allowed values: `turbo`, `default`, `quality`
- `enable_copyright_detection` (boolean, optional, nullable) — Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`.
- `async` (boolean, optional, default: false) — When false (the default), the request waits until the images are ready and returns them 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 generated images (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 GeneratedImageObject, optional) — The generated images, in generation order. 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`

### 422 Unprocessable Entity Error

The prompt did not pass safety checks.

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

### GeneratedImageObject

One generated output image.

- `prompt` (string, required) — The final prompt the image was generated from.
- `resolution` (string, required) — The resolution of the generated image, formatted as "WIDTHxHEIGHT".
- `is_image_safe` (boolean, required) — Whether the image passed safety checks. If false, `url` is empty.
- `seed` (integer, required) — Random seed. Set for reproducible generation.
- `url` (string, optional, nullable) — The direct link to the generated image. Empty when the image did not pass safety checks.

## Examples

**Request**

```json
{
  "prompt": "prompt",
  "magic_prompt": "auto",
  "seed": 12345,
  "num_images": 1,
  "output_resolution": "1k",
  "rendering_speed": "default",
  "enable_copyright_detection": true,
  "async": false,
  "webhook_url": "https://api.example.com/webhooks/ideogram"
}
```

**Response**

```json
{
  "generation_id": "generation_id",
  "seed": 12345,
  "data": [
    {
      "prompt": "prompt",
      "resolution": "1024x1024",
      "is_image_safe": true,
      "seed": 12345,
      "url": "https://openapi-generator.tech"
    },
    {
      "prompt": "prompt",
      "resolution": "1024x1024",
      "is_image_safe": true,
      "seed": 12345,
      "url": "https://openapi-generator.tech"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.ideogram.ai/v2/image/generate/ideogram-4-transparent"

payload = {
    "prompt": "prompt",
    "magic_prompt": "auto",
    "seed": 12345,
    "num_images": 1,
    "output_resolution": "1k",
    "rendering_speed": "default",
    "enable_copyright_detection": True,
    "async": False,
    "webhook_url": "https://api.example.com/webhooks/ideogram"
}
headers = {
    "Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.ideogram.ai/v2/image/generate/ideogram-4-transparent';
const options = {
  method: 'POST',
  headers: {'Api-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"prompt":"prompt","magic_prompt":"auto","seed":12345,"num_images":1,"output_resolution":"1k","rendering_speed":"default","enable_copyright_detection":true,"async":false,"webhook_url":"https://api.example.com/webhooks/ideogram"}'
};

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/image/generate/ideogram-4-transparent"

	payload := strings.NewReader("{\n  \"prompt\": \"prompt\",\n  \"magic_prompt\": \"auto\",\n  \"seed\": 12345,\n  \"num_images\": 1,\n  \"output_resolution\": \"1k\",\n  \"rendering_speed\": \"default\",\n  \"enable_copyright_detection\": true,\n  \"async\": false,\n  \"webhook_url\": \"https://api.example.com/webhooks/ideogram\"\n}")

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

	req.Header.Add("Api-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	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/image/generate/ideogram-4-transparent")

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

request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"prompt\": \"prompt\",\n  \"magic_prompt\": \"auto\",\n  \"seed\": 12345,\n  \"num_images\": 1,\n  \"output_resolution\": \"1k\",\n  \"rendering_speed\": \"default\",\n  \"enable_copyright_detection\": true,\n  \"async\": false,\n  \"webhook_url\": \"https://api.example.com/webhooks/ideogram\"\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/image/generate/ideogram-4-transparent")
  .header("Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"prompt\": \"prompt\",\n  \"magic_prompt\": \"auto\",\n  \"seed\": 12345,\n  \"num_images\": 1,\n  \"output_resolution\": \"1k\",\n  \"rendering_speed\": \"default\",\n  \"enable_copyright_detection\": true,\n  \"async\": false,\n  \"webhook_url\": \"https://api.example.com/webhooks/ideogram\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.ideogram.ai/v2/image/generate/ideogram-4-transparent', [
  'body' => '{
  "prompt": "prompt",
  "magic_prompt": "auto",
  "seed": 12345,
  "num_images": 1,
  "output_resolution": "1k",
  "rendering_speed": "default",
  "enable_copyright_detection": true,
  "async": false,
  "webhook_url": "https://api.example.com/webhooks/ideogram"
}',
  'headers' => [
    'Api-Key' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.ideogram.ai/v2/image/generate/ideogram-4-transparent");
var request = new RestRequest(Method.POST);
request.AddHeader("Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"prompt\": \"prompt\",\n  \"magic_prompt\": \"auto\",\n  \"seed\": 12345,\n  \"num_images\": 1,\n  \"output_resolution\": \"1k\",\n  \"rendering_speed\": \"default\",\n  \"enable_copyright_detection\": true,\n  \"async\": false,\n  \"webhook_url\": \"https://api.example.com/webhooks/ideogram\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "prompt": "prompt",
  "magic_prompt": "auto",
  "seed": 12345,
  "num_images": 1,
  "output_resolution": "1k",
  "rendering_speed": "default",
  "enable_copyright_detection": true,
  "async": false,
  "webhook_url": "https://api.example.com/webhooks/ideogram"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.ideogram.ai/v2/image/generate/ideogram-4-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()
```