# Create image

Generate images synchronously with bytedance/seedream-5.5 via the native Volcengine Ark endpoint /api/v3/images/generations, supporting text-to-image, multi-image editing, native RGBA transparency, up to 99-layer decomposition, and rich-text OCR.

Generate images synchronously with `bytedance/seedream-5.5`. Requests and responses use the native Volcengine Ark format—official SDKs work directly once `base_url` points to the gateway. Text-to-image, multi-image editing, native RGBA transparent generation, and layer decomposition share this endpoint.

`POST https://gateway.amux.ai/api/v3/images/generations`

**Authorization**

`Authorization: Bearer <API key>`

**Request**

| Parameter | Type | Required | Description |
|---|---|---|---|
| `model` | `string` | Yes | Platform model ID. Append `:provider` to pin a specific provider. |
| `prompt` | `string` | No | Text prompt. Required for text-to-image and image-to-image; **optional for layer decomposition** (when omitted, subjects, text, and background are detected automatically). Supports `<bbox>x1 y1 x2 y2</bbox>` and `<point>x y</point>` tags (0–1000 integer coordinates) for localized editing. |
| `image` | `string \| array<string>` | No | Optional reference images. Omit for text-to-image; provide for image-to-image or multi-image blending. Pass a single string or an array of strings (**up to 10 images**, max 30 MB each). Each entry must be a publicly reachable HTTPS URL or `data:image/<format>;base64,…` (lowercase format). Private network addresses or plain HTTP URLs return HTTP `400`. |
| `size` | `string` | No | Output dimensions. Standard generation accepts tiers `1K`, `1.5K`, or `2K` (default `2K`; `4K` is not supported) or exact pixel strings `WxH` (921,600–4,624,220 total pixels, aspect ratio 1/16–16). Layer decomposition accepts only `1K`, `1.5K`, `2K`, or `auto` (default `auto`); exact pixel strings are not supported. |
| `output_format` | `"png" \| "jpeg"` | No | Output image encoding, defaulting to `png`. Must be `png` when `background: "transparent"` is set; in layer decomposition mode, applies only to the base image while extracted layers are always `png`. (Default `"png"`) |
| `background` | `"auto" \| "transparent" \| "opaque"` | No | Background transparency mode: `auto` (default; determined from prompt context), `transparent` (natively generates RGBA transparent/semi-transparent PNGs for both text-to-image and 1–10 reference image edits; incompatible with `output_format: jpeg`), or `opaque` (forces a solid background). Cannot be passed when `layer_decomposition: true`. (Default `"auto"`) |
| `watermark` | `boolean` | No | Whether to add an "AI generated" watermark in the bottom-right corner. Disabled (`false`) by default; pass `true` to enable. (Default `false`) |
| `layer_decomposition` | `boolean` | No | Enable layer decomposition to split a single input image into **1 base image plus up to 99 extracted transparent layers**. Requires **exactly 1** `image` (PNG or JPEG, recommended ≥ 512×512); `prompt` is optional and `background` cannot be combined. (Default `false`) |
| `layer_decomposition_options` | `object` | No | Layer decomposition options, effective only when `layer_decomposition: true`. |
| `layer_decomposition_options.max_images` | `integer` | No | Maximum total output images returned (including the base image and all layers), from `2` to `100` (default `30`). Higher values produce finer-grained layer separation and determine the pre-authorization image count. (Default `30`) |
| `layer_decomposition_options.text_recognition` | `boolean` | No | Whether to enable rich-text OCR on regular text layers. When `true`, returns extracted text, line bounding boxes, and typography styles under `data[].text_recognition`. (Default `false`) |
| `optimize_prompt_options` | `object` | No | Prompt optimization settings; defaults to `standard` when omitted. |
| `optimize_prompt_options.mode` | `"standard" \| "fast"` | No | Prompt optimization mode: `standard` delivers higher composition and detail quality with slightly higher latency; `fast` reduces latency with lighter optimization. Both modes share the same unit price. (Default `"standard"`) |
| `response_format` | `"url" \| "b64_json"` | No | Response delivery format. When set to `b64_json`, `data[]` items return Base64 strings without `url`; generated outputs remain accessible in console logs and Playground under both formats. (Default `"url"`) |

**Response**

| Status | Description |
|---|---|
| `200` | Image generation completed. |
| `400` | Invalid parameters (e.g., layer decomposition without exactly 1 image, `background` or pixel `size` in decomposition mode, `max_images` outside `2`–`100`, more than 10 reference images, `transparent` paired with `jpeg`, or unreachable `image` URL). |
| `402` | Insufficient workspace balance to cover the pre-authorization hold. |
| `502` | Generation failed; not charged and the pre-authorization hold is released. |

**Example request**

```bash
curl https://gateway.amux.ai/api/v3/images/generations \
  -H "Authorization: Bearer $AMUX_API_KEY" \
  -d '{
    "model": "bytedance/seedream-5.5",
    "prompt": "设计一张电商促销横版海报，奶油色背景，精致化妆品瓶身，上方清晰艺术字标题 'SUMMER SALE'",
    "size": "2K",
    "output_format": "png",
    "watermark": false
  }'
```

**Example response**

```json
{
  "model": "doubao-seedream-5-5-261028",
  "created": 1795593600,
  "data": [
    {
      "size": "2048x2048",
      "url": "https://cdn.amux.ai/gen/20261125/task_01M5CWPZEAJ6FRGPDM1G7G1V29-0.png",
      "output_format": "png"
    }
  ],
  "usage": {
    "generated_images": 1,
    "output_tokens": 16384,
    "total_tokens": 16384
  }
}
```

## Dimensions (`size`)

`size` accepts either of two mutually exclusive formats:

- **Resolution tier**: `1K`, `1.5K`, or `2K` (default `2K`; `4K` is not supported);
- **Exact pixels**: `WxH`, with total pixel area between 921,600 and 4,624,220 and an aspect ratio between 1/16 and 16.

Layer decomposition accepts resolution tiers (`1K`, `1.5K`, `2K`) or `auto` (default `auto`) only; exact pixel strings are not supported.

## Reference images and spatial anchors (`image` / `prompt`)

Pass reference images via `image` as a single string or an array of up to 10 strings (max 30 MB per image). Publicly reachable HTTPS URLs and `data:image/<format>;base64,…` (lowercase format name) are accepted. Omit `image` for text-to-image generation.

For image-to-image and multi-image editing, `prompt` supports spatial anchor tags using 0–1000 normalized integer coordinates:

- **Bounding-box anchor**: `<bbox>x1 y1 x2 y2</bbox>` to designate a localized region for replacement, modification, or inpainting;
- **Point anchor**: `<point>x y</point>` to pinpoint a target subject or placement focus.

## Native transparent backgrounds (`background`)

`seedream-5.5` natively generates RGBA transparent and translucent channels (such as glassware, sheer fabrics, glow stickers, and UI icons) across both text-to-image (0 reference images) and 1–10 reference image editing:

- `auto` (default): automatically determines whether to generate a transparent background from prompt semantics;
- `transparent`: forces an RGBA PNG with an alpha channel (automatically defaults `output_format` to `png` when omitted; cannot be combined with `output_format: "jpeg"`);
- `opaque`: forces a solid opaque background.

`background` cannot be combined with `layer_decomposition: true`.

## Layer decomposition and rich-text OCR (`layer_decomposition`)

Set `layer_decomposition: true` to split a single input image into **1 base image plus up to 99 extracted transparent layers**, with fine-grained control via `layer_decomposition_options`:

- `image` must contain **exactly 1** PNG or JPEG image (recommended resolution ≥ 512 × 512 pixels);
- `prompt` is optional and specifies target elements to extract; when omitted, subjects, text, and background are detected automatically;
- `layer_decomposition_options.max_images` caps total returned images (base image plus extracted layers), accepting integers from `2` to `100` (default `30`);
- Setting `layer_decomposition_options.text_recognition` to `true` (default `false`) populates `data[].text_recognition` on regular text layers with rich-text OCR output, including full plain `text`, per-line bounding boxes (`lines[].bounding_box`), and per-run visual style attributes (`lines[].runs[].style`: `similar_font_family`, `foreground_color`, `bold`, `italic`, `underline`, `strikethrough`, `shadow`, and `translucent`);
- In response `data`, the base image has `z_index: 0` (honoring `output_format`), while extracted layers increment from `1` and are always returned as transparent `png` files;
- `bounding_box.normalized` uses integer coordinates from 0 to 1000; prefer pixel coordinates in `bounding_box.absolute` when re-compositing onto the base canvas.

Layer decomposition is designed for posters, e-commerce hero banners, illustrations, and layout designs with distinct foreground elements; overly complex inputs that cannot be decomposed return HTTP `400` without charge.

## Additional parameters

| Parameter | Description |
|---|---|
| `watermark` | Bottom-right "AI generated" watermark. Disabled (`false`) by default; pass `true` to enable |
| `output_format` | Output encoding: `png` (default) or `jpeg` |
| `optimize_prompt_options.mode` | Prompt optimization mode: `standard` (default, higher composition and detail quality) or `fast` (lower latency); both modes share the same unit price |
| `response_format` | `url` (default) or `b64_json` (returns Base64 strings only, omitting `url`) |

`n`, `seed`, and streaming output are not supported; standard generation requests output 1 image per call.

## Latency

Synchronous requests return once all images are ready—typically 15–60 seconds for text-to-image and image-to-image, and 60–150 seconds for high-count layer decomposition with OCR. To avoid holding open long-lived HTTP connections, use [Amux Tasks](/api-reference/images/seedream-5-5-task).

## Billing

Billed **per input reference image + per output image × resolution tier**, not per token. Each output image's tier is determined by its actual pixel count: ≤ 2,601,123 pixels (~2.60 MP, covering `1K` and `1.5K`) falls into the lower tier, and above 2,601,123 pixels falls into the higher tier (`2K`). In layer decomposition mode, the base image and each extracted layer are tiered individually by their actual pixel counts; input reference images are billed per image.

Output billing follows `usage.generated_images` in the response; `output_tokens` and `total_tokens` are area-derived reference figures and are not billed. For unit prices, see the [model page](/models/bytedance/seedream-5.5) and pricing page.

An upper-bound hold is reserved upon acceptance (`layer_decomposition_options.max_images` or 30 images by default for layer decomposition) and settled on actual usage upon completion, releasing any unused difference. Failed requests are not charged.

## Calling methods compared

| Method | Endpoint | Notes |
|---|---|---|
| Volcengine Ark native (this page) | `POST /api/v3/images/generations` | Synchronous; native Volcengine Ark response schema |
| OpenAI-compatible | [`POST /v1/images/generations`](/api-reference/models/create-image) | Synchronous; OpenAI response schema with `amux` extension metadata |
| Amux Tasks | [`POST /v1/tasks`](/api-reference/images/seedream-5-5-task) | Asynchronous; returns task ID and supports webhooks |

All three methods share the same routing, billing, and task persistence, and all model parameters above apply across all three.

## Errors

Error responses follow the OpenAI error schema. See [Errors and retries](/api-reference/errors) for `type` values and retry semantics.
