Skip to main content
POST

Authorizations

string
required
All API endpoints require Bearer Token authenticationGet your API Key:Visit the API Key Management Page to get your API KeyAdd it to the request header:
Single-image model: seedream-5-0-pro generates only 1 image per request (except layer decomposition). The following are rejected (HTTP 400, no task, no charge):
  • n > 1
  • sequential_image_generation (group generation is not supported)
  • stream (streaming is not supported)
  • tools (web search is not supported)
  • more than 10 items in image_urls

Interactive editing

Use <point> / <bbox> coordinates in the prompt, or upload an image with hand-drawn annotations, to target edits precisely.
  • Point coordinates: <point>x y</point> (specify a single point; the model determines the affected area)
  • Bounding-box coordinates: <bbox>x1 y1 x2 y2</bbox> (specify the top-left and bottom-right coordinates to precisely control the size of the edit area)

Layer decomposition

Split one image into a base image and up to 16 transparent PNG layers, with position and stacking information.

Body

string
default:"seedream-5-0-pro"
required
Image generation model name
  • seedream-5-0-pro (recommended)
  • Also accepted: seedream-5.0-pro
boolean
default:"false"
Whether to run content moderation before submitting the image task.
  • true: use omni-moderation-latest to review prompts and input images
  • false or omitted: do not send a moderation request, adding no moderation cost or latency (default)
string
required
Text description for image generationOptional when layer_decomposition: true; if omitted, the model automatically identifies and separates the main elements in the image.In addition to Chinese and English, native text generation supports Russian, Arabic, Filipino, Thai, Turkish, Korean, Malay, Spanish, Portuguese, Indonesian, French, German, Vietnamese, and Japanese.
Tip: Keep it within 600 English words; overly long descriptions may lose detail.
string
default:"1K"
Resolution tier (lowercase accepted). This is an API Mart extension equivalent to placing the tier directly in size.
  • 1K (default)
  • 1.5K (same price as 1K, better quality — prefer 1.5K unless you have a reason not to)
  • 2K
Unsupported tiers such as 3K / 4K return 400.If both a tier-style size and resolution are provided, size takes precedence.
When size is an exact pixel value (e.g. 2048x1024), this field is ignored and dimensions come only from size.
string
default:"auto"
A tier keyword, aspect ratio, auto, or exact pixel dimensions.The tier can be placed directly in size, or supplied through the API Mart extension field resolution:
These forms are equivalent. When only a tier is specified, describe the intended layout in the prompt (for example, “portrait poster” or “landscape cover”) and let the model choose the aspect ratio.

Style ②: tier + aspect ratio

Used with resolution. Supported ratios:
  • 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 2:1, 1:2, 21:9
  • Also accepts 16x9-style x separators
  • 2x1 is equivalent to 2:1, and 1x2 is equivalent to 1:2. The x must be lowercase and spaces are not allowed.
  • auto (default): only the resolution tier is applied; final aspect ratio is chosen from the prompt / references
Ratios outside the list (e.g. 9:21) return 400 — no silent fallback to 1:1.Tier × ratio → output pixels:

Style ③: exact pixels

When size is widthxheight, pixels are used as-is and resolution does not apply. Accepts 2048X1024 / 2048×1024.
Limits apply to the product of width and height, not each edge alone. Example: 512×512 is too small (400); 2048×1024 is valid.
string
default:"opaque"
Output background mode:
  • opaque: solid background (default)
  • transparent: transparent background
transparent is available only for image-to-image requests with exactly one input image that already has an alpha channel; output_format: "png" is also required.
boolean
default:"false"
Whether to decompose the image into layers. When enabled, the model returns one base image and up to 16 PNG layers with alpha channels.Exactly one PNG or JPEG image is required. It must contain [262144, 36000000] total pixels and be no larger than 30 MB. size accepts only 1K, 1.5K, 2K, or auto and defaults to auto. output_format controls only the base image format; decomposed layers are always PNG.
object
default:"{\"mode\":\"standard\"}"
Prompt optimization mode:
  • standard: standard mode with better quality (default)
The flattened form "optimize_prompt_options.mode": "standard" is also accepted.
integer
default:"1"
Number of images to generate. Only 1 is supported; use seedream-5-0-lite for grouped image generation.
array
Reference image URL list for single / multi-reference image-to-image, up to 10Two formats:1. Public URL
  • http:// or https://
  • Example: https://example.com/image.jpg
2. Base64 (Data URI)
  • Format: data:image/<format>;base64,<data><format> must be lowercase
  • Example: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABg...
Per-image limits:
  • Formats: jpeg / png / webp / bmp / tiff / gif / heic / heif
  • Aspect ratio (w/h): [1/16, 16]
  • Each edge > 14 px
  • Size ≤ 30 MB
  • Total pixels ≤ 6000×6000 (36,000,000)
Billing: First reference image free; each additional image has a fixed surcharge.
string
default:"jpeg"
Output image format
  • jpeg (default)
  • png
Compatibility: response_format is equivalent to output_format; other values are treated as jpeg.
boolean
default:"false"
Whether to add an “AI generated” watermark at the bottom-right
  • true: add watermark
  • false: no watermark (default)

Request Examples

Text-to-image (tier + ratio)

Text-to-image (exact pixels)

Multi-reference

Layer decomposition

You can also use <bbox> coordinates normalized to 0–1000 to identify elements to extract precisely:

Interactive editing

Describe hand-drawn annotations in the image using natural language:
Or target locations precisely with <point> / <bbox>:

Alpha-channel editing

Complete example: submit a task and retrieve the image

The following script shows the full flow: submit an asynchronous task, poll its status, handle failure states, and read the final image URL. Replace YOUR_API_KEY before running it.
Python
On success, the task query endpoint returns:
Returned images are mirrored to storage managed by the platform. You should still download and persist them in your own system promptly; do not treat the result URL as permanent storage.

Complete cURL scenarios

Multi-image composition (up to 10 references)

Exact pixels, prompt optimization, and watermark

Decompose and edit a transparent layer independently

First, decompose the source image:
Then retrieve the URL of a transparent layer and edit it independently:

Layer-decomposition response and reconstruction

The url, sizes, output_formats, and layers arrays correspond by index; index 0 is always the base image:
Composite layers in ascending z_index order. To reconstruct them on the output base image with absolute coordinates:
To reconstruct them on any W × H canvas, use normalized coordinates:
Layer decomposition is billed per image. Up to 17 images are preauthorized when the task is submitted. After completion, each output is assigned a tier based on its actual pixel count and settled individually; any excess preauthorization is refunded automatically. Your balance must cover the 17-image preauthorization, and size: "auto" is preauthorized at the 2K tier.

Billing Notes

Output is priced by actual total pixels (~2.61M = 2,601,124):
  • 1.5K costs the same as 1K ($0.045).
  • With exact-pixel size, billing uses actual output area; resolution is ignored (e.g. size: "2048x2048" → $0.09).
  • First reference image is free; each additional reference has a surcharge.
  • Failed tasks are fully refunded.

Layer-decomposition preauthorization and settlement

Because the final number and dimensions of layers are unknown when a task is submitted, preauthorization uses conservative rules based on the request:
  • Exact pixels: tiered by the requested pixel area.
  • 1K / 1.5K: preauthorized at the 1K tier.
  • 2K: preauthorized at the 2K tier.
  • auto: can output up to 2K, so it is preauthorized at the 2K tier.
After completion, the base image and every actual layer are tiered and summed individually using their real pixel areas. Excess preauthorization is refunded automatically. Layers are usually much smaller than the base image, so even a task preauthorized at the 2K tier may ultimately settle entirely at the 1K tier.
Example: a 1080×1080 input is decomposed into 10 images. The task is preauthorized as 17 images × 2K tier. If all 10 final images contain no more than 2.61 million pixels, settlement uses 10 images × 1K tier and the remaining credit is refunded automatically.

Common Errors

⏱️ Slower generation: ~90s for 1K, ~160s for 2K (quality first). Poll Get Task Status every 5–10 seconds; set the client timeout to 5 minutes. Save generated results promptly.

Response

integer
Response status code
array
Response data array