Create task
Last updated October 21, 2026
Submit an async bytedance/seedream-5.0-flash image task through the unified /v1/tasks entry, with image-to-image and layer decomposition.
Asynchronous image generation with bytedance/seedream-5.0-flash through the unified Amux Tasks entry.
The request returns a task id immediately; use Retrieve task
to get the result.
https://gateway.amux.ai/v1/tasksAuthorization
headerAuthorizationstringRequiredBearer <your Amux AI key> Your Amux API key.
Request
application/jsonmodelstringRequiredModel ID on Amux. Append :provider to pin a provider.
promptstringThe prompt. Optional for layer decomposition; required otherwise.
imagestring | array<string>Reference images: a string or an array of strings, up to 10. Layer decomposition needs exactly one.
sizestringTiers 1K / 1.5K / 2K; generation also accepts WxH; decomposition also accepts auto but no pixel strings.
output_format"jpeg" | "png"Default "jpeg"Output encoding. Layers are always png.
background"opaque" | "transparent"Default "opaque"transparent needs exactly one input image with an alpha channel and cannot be combined with jpeg.
watermarkbooleanDefault falseThe "AI generated" mark. Off by default here; pass true to add it.
layer_decompositionbooleanDefault falseLayer decomposition. Needs exactly one reference image; prompt may be omitted.
optimize_prompt_optionsobjectPrompt optimization settings. Omit it for the upstream default, standard. With multipart,
send it as the flat text field optimize_prompt_mode.
›optimize_prompt_optionsobject
mode"standard"Default "standard"This model supports standard only; fast returns 400.
webhook_urlstringWhen the task reaches a terminal state we POST the result here (a {event, sent_at, task}
envelope, an Amux-Signature signature, retries with backoff).
https only, and no private addresses (webhooks are sent from our servers). The URL is validated
at submission and rejected if invalid.
Response
202responseTask created. Poll with the id or wait for the webhook. With Prefer: wait and a terminal state
reached in time you get 200 and the same body as retrieval; an idempotent replay also returns 200.
400responseInvalid parameters. When a value is outside this model's range, the error lists the accepted values.
402responseAvailable balance does not cover the reservation.
Parameters
Identical to the synchronous endpoint: size, image,
layer_decomposition, watermark (off by default here), output_format, background and
optimize_prompt_options all take effect as-is.
This endpoint does not separate generation from editing: omit image for text-to-image, pass it
for image-to-image, and pass exactly one image with layer_decomposition: true for layer
decomposition, where prompt is optional.
With multipart/form-data, reference images go in the image file field, booleans are sent as the string
"true", and the prompt optimization mode is sent as optimize_prompt_mode.
Getting the result
| Method | Usage |
|---|---|
| Polling | GET /v1/tasks/{id}, every 5–10 seconds |
| Webhook | Pass webhook_url at submission |
| Wait in place | Request header Prefer: wait=60 |
Task lifecycle, webhook signing and idempotency keys are the same for every model; see Create task.
Billing
Same as the synchronous endpoint: per image at one price
for every tier; with layer decomposition the base image and each layer are billed separately. cost on retrieval is the actual charge.
The upper bound is reserved at submission and settled on actual usage, with the difference refunded; if the available balance cannot cover the reservation you get 402. Failed and expired tasks are not charged.
curl https://gateway.amux.ai/v1/tasks \
-H "Authorization: Bearer $AMUX_API_KEY" \
-d '{
"model": "bytedance/seedream-5.0-flash",
"image": "https://example.com/poster.png",
"layer_decomposition": true,
"webhook_url": "https://hooks.example.com/amux"
}'{
"id": "task_01M5CWPZEAJ6FRGPDM1G7G1V29",
"status": "queued",
"model": "bytedance/seedream-5.0-flash",
"created_at": "2026-10-21T08:25:44Z",
"output": {
"images": [
{
"index": 0,
"url": "https://cdn.amux.ai/gen/20261021/task_01M5CWPZEAJ6FRGPDM1G7G1V29-0.jpg",
"layer": {
"zIndex": 0,
"role": "background",
"bboxAbsolute": [
0
],
"bboxNormalized": [
0
],
"name": "<string>",
"description": "<string>"
}
}
],
"videos": [
{}
]
},
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"total_tokens": 0
},
"cost": "0.017",
"notes": [
"dropped seed: this model has no seed parameter"
],
"error": {
"message": "<string>",
"code": "<string>"
}
}