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

# Ad Resizer

POST https://api.ideogram.ai/v2/tool/ad-resizer
Content-Type: multipart/form-data

Reframes an ad creative to an exact ad resolution, regenerating the
layout so text and key elements stay legible at the new size. Upload
the source creative as `image` using `multipart/form-data`, and supply
`platform` to keep the ad inside that platform's safe zone.
Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
supply a `webhook_url`.

Reference: https://developer.ideogram.ai/api-reference/tools/ad-resizer

## 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 containing a file.

- `image` (file, required) — The source creative to reframe (max size 25MB). JPEG, PNG, and WEBP formats are supported. Multipart requests only.
- `resolution` (enum, required) — Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in the list is rejected with a 400. Each output image has exactly these pixel dimensions, with or without a `platform`.
- `platform` (enum, optional) — The ad platform whose published safe zone the ad must stay inside. The ad is generated inside the largest rectangle that fits the platform's safe zone for the requested aspect ratio, and the space around it is filled in so the output is still exactly the requested `resolution`. `google` covers YouTube and Google Ads placements. Use `meta_stories` or `meta_reels` for Meta placements; Reels uses the largest rectangle inside its notched safe zone. The legacy `meta` value is still supported and uses a more conservative safe zone. When omitted, the ad fills the whole frame and every supported `resolution` is accepted. Any other value is rejected with a 400. Each platform accepts only the resolutions for which it publishes a safe zone; any other `resolution` is rejected with a 400: | Platform | Accepted resolutions | | --- | --- | | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` | | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` | | `meta_stories` | `1080x1920`, `2160x3840` | | `meta_reels` | `1080x1920`, `2160x3840` | | `meta` (legacy) | `1080x1920`, `2160x3840` | | `snapchat` | `1080x1920`, `2160x3840` |
- `prompt` (string, optional) — Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right".
- `quality` (enum, optional)
- `num_images` (integer, optional) — The number of reframed variations to generate.
- `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

Ad resize accepted for asynchronous processing.

- `generation_id` (string, required) — URL-safe base64 ID accepted by the generation polling endpoint.

## 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 resize an ad.

- `any`

### 404 Not Found Error

Source asset not found.

- `any`

### 422 Unprocessable Entity Error

The prompt was rejected by 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`

## Examples

**Request**

```json
{
  "image": "<file: <file1>>",
  "num_images": 1,
  "platform": "tiktok",
  "quality": "high",
  "resolution": "1080x1920"
}
```

**Response**

```json
{
  "generation_id": "ZGVtb19nZW5lcmF0aW9uX2lk"
}
```

**SDK Code**

```python
import requests

response = requests.post(
  "https://api.ideogram.ai/v2/tool/ad-resizer",
  headers={"Api-Key": "<apiKey>"},
  data={
    "resolution": "1080x1920",
    "platform": "tiktok",
    "quality": "high",
    "num_images": 1,
  },
  files={"image": open("<file1>", "rb")},
)
print(response.json())

```

```javascript
const url = 'https://api.ideogram.ai/v2/tool/ad-resizer';
const form = new FormData();
form.append('image', '<file1>');
form.append('num_images', '1');
form.append('platform', 'tiktok');
form.append('prompt', '');
form.append('quality', 'high');
form.append('resolution', '1080x1920');
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/tool/ad-resizer"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"num_images\"\r\n\r\n1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"platform\"\r\n\r\ntiktok\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"quality\"\r\n\r\nhigh\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"resolution\"\r\n\r\n1080x1920\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/tool/ad-resizer")

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=\"image\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"num_images\"\r\n\r\n1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"platform\"\r\n\r\ntiktok\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"quality\"\r\n\r\nhigh\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"resolution\"\r\n\r\n1080x1920\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/tool/ad-resizer")
  .header("Api-Key", "<apiKey>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"num_images\"\r\n\r\n1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"platform\"\r\n\r\ntiktok\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"quality\"\r\n\r\nhigh\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"resolution\"\r\n\r\n1080x1920\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/tool/ad-resizer', [
  'multipart' => [
    [
        'name' => 'image',
        'filename' => '<file1>',
        'contents' => null
    ],
    [
        'name' => 'num_images',
        'contents' => '1'
    ],
    [
        'name' => 'platform',
        'contents' => 'tiktok'
    ],
    [
        'name' => 'quality',
        'contents' => 'high'
    ],
    [
        'name' => 'resolution',
        'contents' => '1080x1920'
    ]
  ]
  'headers' => [
    'Api-Key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.ideogram.ai/v2/tool/ad-resizer");
var request = new RestRequest(Method.POST);
request.AddHeader("Api-Key", "<apiKey>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"num_images\"\r\n\r\n1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"platform\"\r\n\r\ntiktok\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"quality\"\r\n\r\nhigh\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"resolution\"\r\n\r\n1080x1920\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": "image",
    "fileName": "<file1>"
  ],
  [
    "name": "num_images",
    "value": "1"
  ],
  [
    "name": "platform",
    "value": "tiktok"
  ],
  [
    "name": "prompt",
    "value": 
  ],
  [
    "name": "quality",
    "value": "high"
  ],
  [
    "name": "resolution",
    "value": "1080x1920"
  ],
  [
    "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/tool/ad-resizer")! 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()
```