All parameters
| Parameter | Type | Required | What it does |
|---|---|---|---|
model | string | Yes | The model to use, e.g. doubao-seedream-5-0-260128 |
prompt | string | Yes | Your image description |
size | string | No | Image dimensions, e.g. 1024x1024, 1792x1024, 2k |
image | string | { file_id, image_url? } | array | No | Reference image(s). Use a URL string, uploaded file ID object, or array for multi-image |
stream | boolean | No | Stream generation as it happens. Default false |
response_format | 'url' | 'b64_json' | No | How you receive the image. Default url |
task | boolean | No | Submit as an async task (returns a task_id you poll separately). Only available for bailian |
n | number | No | Number of images to generate at once |
user | string | No | Optional end-user identifier for usage tracking |
upstream_options | object | No | Extra options for the underlying provider (see each provider's page) |
headers | object | No | Custom 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
| Model | Supported sizes |
|---|---|
| dall-e-3 | 1024x1024, 1792x1024, 1024x1792 |
| dall-e-2 | 1024x1024, 512x512, 256x256 |
| stable-diffusion | Various 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"] }