Skip to main content
POST

Authorizations

Authorization
string
header
required

##All APIs require Bearer Token authentication##

Get API Key:

Visit API Key Management Page to get your API Key

Add to request header:

Body

application/json
model
enum<string>
default:doubao-seedream-5.0-pro-layerize
required

Image generation model name

Available options:
doubao-seedream-5.0-pro-layerize
Example:

"doubao-seedream-5.0-pro-layerize"

image_urls
string<uri>[]
required

URL of the image to decompose (required)

Note:

  • Exactly 1 image is required; omitting it or passing 2 or more returns an error
  • Supported formats: .png, .jpeg, .jpg (stricter than plain generation — webp and others are rejected)
  • Image size: no more than 30MB
  • Total pixels: [262144, 6000×6000], i.e. at least 512×512 (a higher lower bound than plain generation)
  • Aspect ratio (width/height) range: [1/16, 16]
  • The image URL must be directly viewable by the server, or the URL must trigger a direct download when accessed (usually such URLs end with an image file extension, such as .png, .jpg)
Required array length: 1 element
Example:
prompt
string

Which elements to split out (optional)

Three ways to use it:

  • Omit it: the model detects every major element in the image and splits them one by one
  • Natural language: e.g. Split out the parrot and the title text — elements are identified semantically and turned into layers
  • Exact coordinates: use <bbox> tags to pin down a position, e.g. title text<bbox>179 58 809 197</bbox>; normalized coordinates (0~1000) are recommended
Example:

"Split out the parrot and the title text"

quality
enum<string>
default:auto

Output resolution tier, defaults to auto

Options: auto, 1K, 1.5K, 2K

Notes:

  • Layer mode only accepts tiers; passing a ratio (such as 16:9) or explicit pixels (such as 2048x2048) returns an error
  • auto makes the output follow the input image: if the original size falls within [921600, 4624220] pixels it is kept as is, below 1K it is output at 1K, above 2K it is output at 2K
  • Each layer keeps its own aspect ratio from the original image, and the base image keeps the aspect ratio of the input

Billing: the tier is decided per output image from its own pixel count; 1K and 1.5K cost the same, and an output image above 2610000 pixels is billed at the higher tier.

Available options:
auto,
1K,
1.5K,
2K
Example:

"auto"

prompt_priority
enum<string>
default:standard

Prompt optimization strategy, used to set the mode for prompt optimization

Options:

  • standard: Standard mode, higher quality output, longer processing time
  • fast: Fast mode, shorter processing time, slightly lower quality than standard mode
Available options:
standard,
fast
Example:

"standard"

output_format
enum<string>
default:jpeg

Output image format

Options:

  • jpeg: JPEG format (default)
  • png: PNG format

Note: This parameter only controls the base image. The layers are always PNG with an alpha channel and are not affected by it.

Available options:
jpeg,
png
Example:

"jpeg"

callback_url
string<uri>

HTTPS callback address after task completion

Callback Timing:

  • Triggered when task is completed, failed, or cancelled
  • Sent after billing confirmation is completed

Security Restrictions:

  • Only HTTPS protocol is supported
  • Callback to internal IP addresses is prohibited (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x, etc.)
  • URL length must not exceed 2048 characters

Callback Mechanism:

  • Timeout: 10 seconds
  • Maximum 3 retries on failure (retries after 1 second/2 seconds/4 seconds)
  • Callback response body format is consistent with the task query API response format
  • Callback address returning 2xx status code is considered successful, other status codes will trigger retry
Example:

"https://your-domain.com/webhooks/image-task-completed"

Response

Image generation task created successfully

created
integer

Task creation timestamp

Example:

1757165031

id
string

Task ID

Example:

"task-unified-1757165031-seedream5prolayerize"

model
string

Actual model name used

Example:

"doubao-seedream-5.0-pro-layerize"

object
enum<string>

Specific task type

Available options:
image.generation.task
progress
integer

Task progress percentage (0-100)

Required range: 0 <= x <= 100
Example:

0

status
enum<string>

Task status

Available options:
pending,
processing,
completed,
failed
Example:

"pending"

task_info
object

Async task information

type
enum<string>

Task output type

Available options:
text,
image,
audio,
video
Example:

"image"

usage
object

Usage and billing information