Image / Seedream

Seedream 5.0 Pro Image Generation

asV3 localized example text (snake_case Request Body +, return image).in use endpointSeedream 5.0 Pro V2 endpointlocalized example text.task and, can.

Overview

Seedream 5.0 Pro Seedream, supported Text-to-Image (text-to-image) and Image-to-Image (image-to-image), and supported images image image+ image.Requestand field as snake_case.

localized example text:
- ⚡ return:Requestimage complete, return image, no Polling
-🖼️ Method:Text-to-Image, Image-to-Image, image reference image (up to 10 images Reference image)
-🧩 image:images image image+ can image
-🇨🇳 localized example text:asBase URL: https://mm-internal-cn.leonecloud.com ()

---## Authentication

All endpoints require a token in the request header for authentication:

Authorization: Bearer {YOUR_AUTH_TOKEN}

Failurereturned when applicable HTTP 401:```json
{
"error": {
"code": "AuthenticationError",
"message": "API Key no",
"type": "Unauthorized"
}
}


---

## model Values

`model` as**Required**field, as:| model | Description | Reference imagelocalized example text| size Resolutionlocalized example text| size Default | image| output|
|-------|------|-----------|--------------|------------|---------|---------|
| `seedream-5-0-pro` | localized example text| 10 images| `1K` / `2K` | `2K` | ✅ | ❌ |

in in the`model` will return HTTP 400`InvalidParameter`.Seedream Model[Seedream 5.0 Lite](/docs/seedream-5-0-lite), [Seedream 4.5](/docs/seedream-4-5),,`model`.

---

## endpoint:Image Generation

**POST** `/api/v3/images/generations`

### Request Parameters

| Parameter | Type | Required | Description |
|-----|------|-----|------|
| model | string | Yes | localized example text`seedream-5-0-pro` |
| prompt | string | localized example text* | Prompt.recommendedin exceeds 300, exceeds 600.*image Optional|
| image | string / string[] | No | Reference image.single imagecharacters, multiple images, up to 10 images; supported image URL or Base64 (Format`data:image/png;base64,<data>`, imageFormat).single imageexceeds 30MB|
| size | string | No | output dimensions,[size Description](#size-Description) |
| layer_decomposition | boolean | No | image, default`false`, localized example text[image](#image )|
| response_format | string | No | return Format:`url` (default)/ `b64_json` |
| sequential_image_generation | string | No | onlylocalized example text`disabled` (default) |
| output_format | string | No | `png` / `jpeg`.can, first Output format, Format as|
| watermark | boolean | No | can, first output|
| background | string | No | onlysupported`opaque` (default); `transparent` supported, return 400|

> - `optimize_prompt_options`, `tools`, `seed` etc. field can, will, image.
> - Model supported output,`stream` only [Seedream 5.0 Lite](/docs/seedream-5-0-lite) / [Seedream 4.5](/docs/seedream-4-5) supported.

### size Description

supported,:**Method 1:Resolutionlocalized example text** (`1K` / `2K`, size, default`2K`)

- Image-to-Imagewhen output Aspect ratio number images Reference image (Reference image when will Failure, Method 2); Text-to-Image as 1:1.
- Aspect ratio when, use Method 2.
- supported`1.5K`, return 400.

**Method 2:width and height** (`width x height`, localized example text`2048x1152`)

| range| Aspect ratiorange | localized example text|
|-----------|-----------|---------|
| [1280x720, 4624220] | [1/16, 16] | localized example text≤ 2601123 (1536x1536)`1K`, localized example text`2K` |

will Resolution, and Aspect ratio (`1:1` / `4:3` / `3:4` / `16:9` / `9:16` / `3:2` / `2:3` / `21:9`)image,, dimensions in the`size` as.after Resolution.

### image 

 images image as 1 images image+ can image (PNG).

- `layer_decomposition` localized example text`true`; 
- `image` **mustonly supported 1 images**; 
- `prompt` Optional:If omittedwhen image in, can use Description; 
-`size` onlysupported`1K` / `2K` / `auto` (default `auto`, localized example text`2K` output ), supported width and height; 
- output image: create when, complete after.

localized example text`data` in as image: image`z_index` as`0`, image`1` (); image will return`bounding_box`, `name`, `description`, localized example text[Response Parameters](#Response Parameters).

---

## Supported Scenarios

### Scenario1:Text-to-Image

```bash

curl -X POST "https://mm-internal-cn.leonecloud.com/api/v3/images/generations" \
-H "Authorization: Bearer your_auth_token_here" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-5-0-pro",
"prompt": "in,",
"size": "2K"
}'


Aspect ratio (16:9):```bash
curl -X POST "https://mm-internal-cn.leonecloud.com/api/v3/images/generations" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "model": "seedream-5-0-pro",
 "prompt": ",,,",
 "size": "2048x1152"
 }'

Scenario2:Image-to-Image

curl -X POST "https://mm-internal-cn.leonecloud.com/api/v3/images/generations" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "model": "seedream-5-0-pro",
 "prompt": ", as",
 "image": "https://example.com/input.png",
 "size": "2K"
 }'

Scenario3:image reference image```bash curl -X POST "https://mm-internal-cn.leonecloud.com/api/v3/images/generations" \ -H "Authorization: Bearer your_auth_token_here" \ -H "Content-Type: application/json" \ -d '{ "model": "seedream-5-0-pro", "prompt": "will image 1 as image 2", "image": [ "https://example.com/person.png", "https://example.com/clothes.png" ], "size": "2K" }'


### Scenario4:image```bash
curl -X POST "https://mm-internal-cn.leonecloud.com/api/v3/images/generations" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "model": "seedream-5-0-pro",
 "prompt": "and image",
 "image": "https://example.com/poster.png",
 "layer_decomposition": true,
 "size": "2K"
 }'

Scenario5:Python (OpenAI SDK)

V3 and OpenAI SDK imageendpoint,base_url localized example texthttps://mm-internal-cn.leonecloud.com/api/v3 can, fieldextra_body:

from openai import OpenAI

client = OpenAI(
 base_url="https://mm-internal-cn.leonecloud.com/api/v3",
 api_key="your_auth_token_here",
)

resp = client.images.generate(
 model="seedream-5-0-pro",
 prompt="in,",
 size="2K",
 response_format="url",
 extra_body={
 "image": "https://example.com/input.png",
 },
)
print(resp.data[0].url)

Response Parameters

Success(HTTP 200)```json { "model": "seedream-5-0-pro", "created": 1792235741, "data": [ { "url": "https://fc-gw-sh.oss-accelerate.aliyuncs.com/downloads/20261017/task_20261017191541_lwqp1vgb_0.jpg", "size": "1024x1024", "output_format": "jpeg" } ], "usage": { "generated_images": 1, "input_images": 0, "output_tokens": 4096, "total_tokens": 4096 } }


image:```json
{
 "model": "seedream-5-0-pro",
 "created": 1792235741,
 "data": [
 {
 "url": "https://fc-gw-sh.oss-accelerate.aliyuncs.com/downloads/20261017/layer_0.png",
 "size": "2048x2048",
 "output_format": "png",
 "z_index": 0
 },
 {
 "url": "https://fc-gw-sh.oss-accelerate.aliyuncs.com/downloads/20261017/layer_1.png",
 "size": "1273x265",
 "output_format": "png",
 "z_index": 1,
 "bounding_box": {
 "absolute": [383, 120, 1655, 384],
 "normalized": [187, 59, 808, 188]
 },
 "name": "localized example text",
 "description": "localized example text"
 }
 ],
 "usage": {
 "generated_images": 2,
 "input_images": 1,
 "output_tokens": 17701,
 "total_tokens": 17701
 }
}
ParameterTypeDescription
modelstringRequest in themodel
createdintegertaskCreated Time (Unix seconds)
data[].urlstringimage URL (response_format=url returned when applicable), and when
data[].b64_jsonstringimage Base64 (response_format=b64_json returned when applicable)
data[].sizestringimagewidth and height,2048x2048
data[].output_formatstringimageFormat png / jpeg
data[].z_indexintegerimage (only image ): image as0, localized example text
data[].bounding_box.absoluteint[]image in image in the[left, top, right, bottom] (onlyimage, image return )
data[].bounding_box.normalizedint[]localized example text[left, top, right, bottom], 0~ 1000
data[].namestringimage (only image )
data[].descriptionstringimage (only image )
usage.generated_imagesintegerimage images ( image when as image+ image )
usage.input_imagesintegerinput Reference image images
usage.output_tokensintegersum(width× height ) / 256 localized example text
usage.total_tokensintegerandoutput_tokens localized example text

localized example textX-Task-Id as Request Task ID, when provide.

image:will image(right - left) × (bottom - top), image(left, top) Location, imagez_index localized example text.( widthW, heightH)whennormalized:x = left / 1000 × W, y = top / 1000 × H.

when

Request maximum 10 minutes.returned when applicable HTTP 504, task will execute and, canmessage in the Task ID ( orX-Task-Id)localized example textGET /v1/images/generations/{taskId} query results, returnImage Generation API (Unified Endpoint) Query Taskendpoint:```json
{
"error": {
"code": "RequestTimeout",
"message": "Image Generationwhen, task in processing, GET /v1/images/generations/task_xxx query results",
"type": "GatewayTimeout"
}
}


---

## Error Codes

Failurereturned when applicableHTTP Status Code+ localized example text`error`:```json
{
 "error": {
 "code": "InvalidParameter",
 "message": "size supported 1.5K, use 1K, 2K or width and height",
 "type": "BadRequest"
 }
}
HTTP Status Codeerror.codeDescription
400InvalidParameterParameterError (prompt, size no, Model supported Parameter etc. )
400SensitiveContentDetected etc.input or output not, Prompt or Reference image
401AuthenticationErrorAPI Key invalid or missing
402InsufficientBalanceInsufficient balance
403PermissionDeniedno
404ModelNotOpenModelnot
413InvalidParameterRequest Bodylocalized example text
500InternalServiceErrorImage GenerationFailure, can
504RequestTimeoutwhen, task in,when

Migrating from V2

localized example textV2V3 ()
create PathPOST /api/v2/open/aigc/seedream-5.0-pro, PathModellocalized example textPOST /api/v3/images/generations, Modellocalized example textmodel localized example text
MethodCreate Taskafter Polling query, return Image
fieldlocalized example textcamelCase (imageUrls, aspectRatio)snake_case (image, size)
Generation typegenType (t2i / i2i / t2i-layer / i2i-layer)localized example textimage; imagelayer_decomposition
dimensions ParameteraspectRatio + resolution / qualityand assize, localized example textsize Description
create{code, msg, data} localized example text,data[].url
Errorlocalized example textError Codes (code: 40001)HTTP Status Code+ {"error": {...}}
Callback NotificationcallbackUrlreturn, no

V2 endpointcan use, task and.fieldDescriptionSeedream 5.0 Pro V2 endpointlocalized example text.


Best Practices

  1. when:image Usually 10~ 60 seconds, when recommended at least 120 seconds; height Resolution, Reference image, image when.
  2. Aspect ratio:ResolutionAspect ratioModel,size Description.
  3. and when store:return image URL and when, when.
  4. Reference imageURL:Base64 will Request Body, multiple images image when Request Body.
Updated 2026-11-02