All parameters

ParameterTypeRequiredWhat it does
modelstringYesThe model to use, e.g. doubao-seedream-5-0-260128
promptstringYesYour image description
sizestringNoImage dimensions, e.g. 1024x1024, 1792x1024, 2k
imagestring | { file_id, image_url? } | arrayNoReference image(s). Use a URL string, uploaded file ID object, or array for multi-image
streambooleanNoStream generation as it happens. Default false
response_format'url' | 'b64_json'NoHow you receive the image. Default url
taskbooleanNoSubmit as an async task (returns a task_id you poll separately). Only available for bailian
nnumberNoNumber of images to generate at once
userstringNoOptional end-user identifier for usage tracking
upstream_optionsobjectNoExtra options for the underlying provider (see each provider's page)
headersobjectNoCustom HTTP headers for tracing and attribution

Custom headers

{
  "headers": {
    "x-trace-id": "trace-9c1ab",
    "x-user-id": "u_42",
    "x-agent-name": "design-bot"
  }
}

Header values are recorded in usage logs so you can trace requests and attribute usage.

Image sizes

ModelSupported sizes
dall-e-31024x1024, 1792x1024, 1024x1792
dall-e-21024x1024, 512x512, 256x256
stable-diffusionVarious square and widescreen formats

Supported sizes vary by model. Check the provider pages for details.

Reference images

The image field accepts three forms:

// 1. A URL
{ "image": "https://example.com/portrait.jpg" }

// 2. An uploaded file
{ "image": { "file_id": "file-xxx", "image_url": "https://..." } }

// 3. Multiple images (for fusion mode)
{ "image": ["https://example.com/a.jpg", "https://example.com/b.jpg"] }

Next steps

Non-stream responses · Stream responses