# Create task

Submit an asynchronous bytedance/seedream-5.5 image task via /v1/tasks, supporting text-to-image, multi-image editing, native RGBA transparency, 99-layer decomposition, and rich-text OCR.

Submit an asynchronous `bytedance/seedream-5.5` task via the unified `/v1/tasks` endpoint. Returns a task `id` immediately; fetch the completed output using [Retrieve task](/api-reference/images/seedream-5-5-task-retrieve). This asynchronous endpoint is recommended for multi-layer decomposition and rich-text OCR workloads.

`POST https://gateway.amux.ai/v1/tasks`

**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. Optional for layer decomposition; required otherwise. |
| `image` | `string \| array<string>` | No | Reference images (single string or array of up to 10 strings). Layer decomposition requires exactly 1 image. |
| `size` | `string` | No | Output size: `1K`, `1.5K`, `2K`, or `WxH` for generation; `1K`, `1.5K`, `2K`, or `auto` (no pixel strings) for layer decomposition. |
| `output_format` | `"png" \| "jpeg"` | No | Output encoding format, defaulting to `png`. Extracted layers are always `png`. (Default `"png"`) |
| `background` | `"auto" \| "transparent" \| "opaque"` | No | Background transparency mode (`auto` / `transparent` / `opaque`). `transparent` works natively for text-to-image and image-to-image and cannot be combined with `jpeg` or `layer_decomposition: true`. (Default `"auto"`) |
| `watermark` | `boolean` | No | Bottom-right "AI generated" watermark. Disabled (`false`) by default; pass `true` to enable. (Default `false`) |
| `layer_decomposition` | `boolean` | No | Enable layer decomposition (up to 1 base image + 99 layers). Requires exactly 1 reference image; `prompt` is optional. (Default `false`) |
| `layer_decomposition_options` | `object` | No | Layer decomposition options (effective only when `layer_decomposition: true`). With `multipart/form-data`, flat fields `layer_max_images` and `layer_text_recognition` are also accepted. |
| `layer_decomposition_options.max_images` | `integer` | No | Maximum total output images (including base image), from `2` to `100` (default `30`). (Default `30`) |
| `layer_decomposition_options.text_recognition` | `boolean` | No | Whether to enable rich-text OCR on regular text layers (default `false`). (Default `false`) |
| `optimize_prompt_options` | `object` | No | Prompt optimization settings (defaults to `standard`). With `multipart/form-data`, pass the flat text field `optimize_prompt_mode` instead. |
| `optimize_prompt_options.mode` | `"standard" \| "fast"` | No | `standard` delivers higher quality with slightly higher latency; `fast` reduces latency with lighter optimization. Both modes share the same unit price. (Default `"standard"`) |
| `webhook_url` | `string` | No | Webhook callback URL invoked when the task reaches a terminal state, delivering the `{event, sent_at, task}` envelope signed with `Amux-Signature` and retried with exponential backoff. Must be a public HTTPS URL; validated at submission. |

**Response**

| Status | Description |
|---|---|
| `202` | Task created. Poll with `id` or wait for the webhook callback. Returns `200` if `Prefer: wait` reaches a terminal state within the wait window or on an idempotent replay. |
| `400` | Invalid request parameters. Out-of-range values return an error listing valid options. |
| `402` | Insufficient workspace balance to cover the pre-authorization hold. |

**Example request**

```bash
curl https://gateway.amux.ai/v1/tasks \
  -H "Authorization: Bearer $AMUX_API_KEY" \
  -d '{
    "model": "bytedance/seedream-5.5",
    "image": "https://example.com/poster.png",
    "layer_decomposition": true,
    "layer_decomposition_options": {
      "max_images": 30,
      "text_recognition": true
    },
    "webhook_url": "https://hooks.example.com/amux"
  }'
```

**Example response**

```json
{
  "id": "task_01M5CWPZEAJ6FRGPDM1G7G1V29",
  "status": "queued",
  "model": "bytedance/seedream-5.5",
  "created_at": "2026-11-25T09:00:00Z",
  "output": {
    "images": [
      {
        "index": 0,
        "url": "https://cdn.amux.ai/gen/20261125/task_01M5CWPZEAJ6FRGPDM1G7G1V29-0.png",
        "layer": {
          "zIndex": 0,
          "role": "background",
          "bboxAbsolute": [
            0
          ],
          "bboxNormalized": [
            0
          ],
          "name": "<string>",
          "description": "<string>",
          "textRecognition": {
            "text": "<string>",
            "lines": [
              {
                "bboxAbsolute": [
                  0
                ],
                "bboxNormalized": [
                  0
                ],
                "runs": [
                  {
                    "text": "<string>",
                    "style": {
                      "similarFontFamily": "<string>",
                      "foregroundColor": "<string>",
                      "bold": false,
                      "italic": false,
                      "underline": false,
                      "strikethrough": false,
                      "shadow": false,
                      "translucent": false
                    }
                  }
                ]
              }
            ]
          }
        }
      }
    ],
    "videos": [
      {}
    ]
  },
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "total_tokens": 0
  },
  "cost": "0.035",
  "notes": [
    "dropped seed: this model has no seed parameter"
  ],
  "error": {
    "message": "<string>",
    "code": "<string>"
  }
}
```

## Parameters

All generation parameters match the [synchronous Volcengine Ark endpoint](/api-reference/images/seedream-5-5-create): `size`, `image`, `background`, `output_format` (default `png`), `watermark` (disabled by default), `layer_decomposition`, `layer_decomposition_options`, and `optimize_prompt_options` behave identically.

**This endpoint unifies image generation and image editing**: omit `image` for text-to-image, pass 1–10 items in `image` for image-to-image or multi-image editing (both supporting native RGBA transparency via `background: "transparent"`), or pass exactly 1 `image` with `layer_decomposition: true` for layer decomposition (`prompt` is optional in decomposition mode; `background` cannot be combined).

When uploading local files via `multipart/form-data`, send reference files in `image`, encode booleans as `"true"`, pass layer decomposition sub-options either as a JSON string in `layer_decomposition_options` or via flat fields `layer_max_images` / `layer_text_recognition`, and pass the prompt optimization mode via `optimize_prompt_mode`.

## Obtaining task results

| Delivery mode | Usage |
|---|---|
| **Polling** | `GET /v1/tasks/{id}` every 5–10 seconds |
| **Webhook** | Pass `webhook_url` at submission |
| **Synchronous wait** | Include request header `Prefer: wait=60` |

For task lifecycle states, webhook signature verification, and idempotency keys, see [Create task](/api-reference/models/create-task).

## Billing

Matches the [synchronous endpoint](/api-reference/images/seedream-5-5-create): billed per input reference image and per output image tiered by actual pixel count; in layer decomposition mode, the base image and each extracted layer are billed separately. Check `cost` upon retrieval for the settled USD charge.

An upper-bound hold is reserved upon acceptance (`layer_decomposition_options.max_images` or 30 images by default for layer decomposition; `402` if balance is insufficient) and settled against actual usage upon completion, releasing any unused difference. Failed and expired tasks are not charged.
