Skip to main content
POST
Submit to POST /v1/images/generations, read the task ID from data[0].task_id, then query GET /v1/tasks/{task_id} for results.

Modes

Authentication

string
required
Use Authorization: Bearer <token>, where <token> is your APIMart API Key.

Request parameters

string
required
Set to seedream-5-5.
string
Required for text-to-image and image-to-image. Optional for layer decomposition: the model identifies subjects, text, and backgrounds automatically, or you can describe which elements to separate.
string[]
Up to 10 references for image generation; exactly 1 input for layer decomposition. Accepts public image URLs or image Base64 Data URIs. For local files, use the image upload endpoint and pass the returned url.References must use publicly accessible http(s) URLs or data:image/<format>;base64,… with a lowercase format name.
  • Supported: JPEG, PNG, WebP, BMP, TIFF, GIF, HEIC, and HEIF. AVIF and JP2 are unsupported.
  • Each image must be at most 30 MiB (31,457,280 bytes) and 36 million total pixels. Check width × height; this is not a 6000-pixel limit on each side.
  • Exceeding the byte or pixel limit returns HTTP 400 synchronously. AVIF and JP2 may create a task before the upstream rejects them; failed tasks are refunded. Convert these formats before submitting.
The image upload endpoint has its own format restrictions. For model-supported formats that it cannot upload, use a public URL or Data URI.
string
Image generation defaults to 2K and accepts a tier, aspect ratio, or exact pixels as described below. Layer decomposition defaults to auto and accepts only 1K / 1.5K / 2K / auto, not aspect ratios or exact pixels.For image generation, size: "auto" means 2K. An aspect-ratio size without resolution also uses 2K. Omit resolution for exact pixel dimensions, and use positive integers for width and height.
string
For image generation, use 1K / 1.5K / 2K with an aspect-ratio size. For decomposition, this is a platform alias for size: size takes precedence, resolution is used only when size is omitted, and omitting both defaults to auto. Decomposition accepts 1K / 1.5K / 2K / auto; aspect ratios or pixel dimensions are rejected synchronously with HTTP 400. 3K / 4K are unsupported.
string
Image generation supports auto (default), transparent, or opaque. Both text-to-image and image-to-image can produce transparency. Transparent output requires PNG and cannot use output_format: "jpeg". Omit this field entirely for layer decomposition, including auto.
string
default:"png"
png (default) or jpeg. For layer decomposition this controls only the base image; extracted layers are always transparent PNGs.
integer
Must be 1. Image generation produces one image per request; use layer_decomposition_options.max_images to control decomposition output count.
boolean
default:"false"
Optional flag to add a watermark.
object
Only {"mode":"standard"} is supported. Omitting this parameter still enables the upstream default standard; prompt optimization cannot be disabled in Seedream 5.5. The upstream rejects disabled / none / off with HTTP 400 and must be one of: standard. The platform rejects fast immediately with HTTP 400.
boolean
Set to true to separate the input into a base image and transparent layers. Requires exactly one input image and no background field. output_format controls only the base image.
object
Only valid with layer_decomposition: true; otherwise returns HTTP 400.

Size formats

Supported ratios: 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9, 2:1, 1:2. Exact-size validation uses pixel area and aspect ratio. Decomposition accepts only tiers or auto, not aspect-ratio or exact-pixel notation.

Decomposition output sizes

  • Precedence: size → resolution → auto. resolution is a platform alias; the upstream receives only size. For example, size: "1K" with resolution: "2K" uses 1K; resolution: "1.5K" alone uses 1.5K.
  • With 1K / 1.5K / 2K, the base and every layer are output at the selected tier, each preserving its own aspect ratio. One measured 1K base was 840×1248, with each layer also around 1.05 million pixels. These are representative results, not fixed dimensions.
  • auto uses the original input dimensions, upscaling inputs below 1K to 1K and downscaling inputs above 2K to 2K.

Request examples

Image editing and reference fusion

Layer decomposition with text OCR

This request returns at most 10 images, including the base. prompt is optional; omit background in layer mode. Replace the image URL with an accessible file.

Query a task

Use the task status endpoint. Poll every 3 seconds for the first 30 seconds, then every 5–10 seconds. Decomposition can take several minutes; the server waits up to 13 minutes per operation. Save task_id and keep polling for a terminal state without resubmitting the generation request.
Read data.status from the unified task endpoint: pending / processing means work is ongoing, completed means success, and failed exposes the reason in data.error.message with an automatic refund. Read successful image URLs from data.result.images[].url[].
Result images are retained for 3 days; download them promptly. Task records are also retained for only 3 days, after which they cannot be queried by task_id.data.result.images[].expires_at currently returns a Unix timestamp in seconds equal to task completion + 24 hours. This is a conservative timestamp earlier than actual deletion. Do not use it to calculate the actual retention period or a deletion countdown.

Layer results and OCR

This example illustrates the response structure, not a recorded model run. Dimensions, coordinates, and text are illustrative. Metadata fields may be absent; handle them as optional.
Within each data.result.images[] object, url, sizes, output_formats, backgrounds, and layers correspond by index. Metadata arrays may be omitted when their length does not match url; do not assume every array is present. With absolute coordinates, use x=left, y=top, w=right-left, h=bottom-top. For a W × H canvas, use normalized coordinates:
Layer files are sized independently at the selected tier, so their dimensions may differ from their bounding_box. To composite, resize each layer to the box’s w × h and place it at (x, y); do not use layer-file pixels directly as base-image coordinates.

Text recognition fields

text_recognition follows the upstream model’s OCR structure. The platform passes through fields such as text, lines, runs, and style unchanged. OCR and font information can assist display, copying, or editing, but may not exactly match the source. Layer images remain usable when OCR is absent.

Billing

Output images and input references are charged separately. Every reference image is charged, including the first and the single input used for layer decomposition.
  • Each output is billed by its actual pixel area: at most 2,610,000 pixels uses the lower tier; larger outputs use the higher tier. 1K / 1.5K map to the lower tier and 2K to the higher tier. Exact dimensions use width × height.
  • Image generation reserves the selected output-tier charge plus reference count × input-image price. Omitting size or using auto reserves at 2K.
  • Decomposition reserves max_images × output reservation-tier price plus one input-image charge. max_images defaults to 30, includes the base image, and may exceed the actual output count.
  • Decomposition uses the effective size, or resolution when size is omitted: 1K / 1.5K reserve at the lower tier; 2K / auto at the higher tier. Omitting both defaults to the higher-tier auto reservation.
  • Settlement uses the actual output count, each output’s actual pixel tier, and the input count, refunding or charging the difference. The base and every layer count as separate images; do not apply the requested tier to every output indiscriminately. Failed tasks receive a full refund.
See Model Pricing for rates.

Common parameter errors

These include platform and upstream validation errors. Read error.message for submission failures and data.error.message for asynchronous task failures.

Task failure reasons

When data.status is failed, read data.error.message and use data.error.reason to choose an action. Failed tasks are refunded automatically. If reason is absent or unrecognized, fall back to message.