Seedream: create image
POST/v1/images/generations
Generate images with the Seedream series from text, or from reference images via image; results return in the same request.
The image is generated within this HTTP request and can take a while; set a client timeout of 240 seconds or more. After a timeout, disconnect or 5xx the image may still be generated and billed. Synchronous requests have no idempotency protection, so resubmitting charges again. Use Create image task (POST /v1/images/tasks) when you need safe retries.
Use only the values listed here: others may be rejected, ignored or produce unexpected output, and an accepted synchronous request is still billed.
Models and limits
| Model | Rule group | Endpoints | n | Reference images | prompt limit (chars) |
|---|---|---|---|---|---|
seedream-5.5 | Seedream 5.5 series | /v1/images/generations/v1/images/tasks | 1 | 0–10image on generations | 10,000 |
seedream-5.5-nsfw | Seedream 5.5 series | /v1/images/generations/v1/images/tasks | 1 | 0–10image on generations | 10,000 |
seedream-5.0-pro | Seedream 5.0 Pro series | /v1/images/generations/v1/images/tasks | 1 | 0–10image on generations | 10,000 |
seedream-5.0-pro-nsfw | Seedream 5.0 Pro series | /v1/images/generations/v1/images/tasks | 1 | 0–10image on generations | 10,000 |
Headers
AuthorizationstringRequiredBearer <API_KEY>.Content-TypestringRequiredapplication/json. Only JSON bodies are supported.
Request bodyJSON
modelstringRequiredA Seedream model ID, case-sensitive. Available models are listed below; the 5.5 and 5.0 Pro series differ on some parameters, see “By model group”.
- Seedream 5.5 series
seedream-5.5seedream-5.5-nsfw- Seedream 5.0 Pro series
seedream-5.0-proseedream-5.0-pro-nsfw
promptstringRequiredDescribe the image; must not be empty, up to 10,000 characters, ideally under about 300 Chinese characters. When using a tier such as
2K, state the intended aspect ratio in the prompt.imagestring | string[]OptionalReference image: one URL or an array of 1–10 URLs; omit for text-to-image. Seedream does not use the
imagesfield.Limits
- A publicly reachable
https://image URL, orasset://<asset ID>from your asset library (owned by the API key’s user). - PNG, JPEG or WebP. The URL must not depend on cookies, auth headers, hotlink protection or short-lived signatures.
- A publicly reachable
nintegerOptionalDefault1Only 1; may be omitted.
Billed as per-image price × count, reserved from
nat submission.sizestringOptionalDefault2KSend a tier
1K,1.5Kor2Kand describe the aspect ratio in the prompt, or send one of the fixed sizes below. Other dimensions are not supported.Use a lowercase
xbetween width and height, not×.Supported values
1K1:11024x1024· 4:31152x864· 3:4864x1152· 16:91424x800· 9:16800x1424· 3:21248x832· 2:3832x1248· 21:91568x6721.5K1:11536x1536· 4:31792x1344· 3:41344x1792· 16:92048x1152· 9:161152x2048· 3:21872x1248· 2:31248x1872· 21:92352x10082K1:12048x2048· 4:32368x1776· 3:41776x2368· 16:92816x1584· 9:161584x2816· 3:22496x1664· 2:31664x2496· 21:93136x1344
backgroundstringOptionalBackground type.
By model group
- Seedream 5.5 series
auto(default),opaque,transparent. Transparency requiresoutput_format: "png"and works from text or from ordinary reference images.- Seedream 5.0 Pro series
opaque(default) ortransparent;autois not supported.transparentrequiresimageto be exactly one PNG with an alpha channel, andoutput_format: "png".
output_formatstringOptionalImage file format:
pngorjpegonly.By model group
- Seedream 5.5 series
- Defaults to
png. - Seedream 5.0 Pro series
- Defaults to
jpeg.
watermarkbooleanOptionalDefaulttruetrueadds an “AI generated” watermark;falseomits it.
Returns
HTTP 200 with the list of images.
createdintegerOptionalCreation time in Unix seconds.
dataobject[]OptionalGenerated images, one per item.
Show child fields (3)
urlstringOptionalDownload URL. Use it as returned and save the image promptly; do not send your API key when downloading.
b64_jsonstringOptionalBase64 image data, which may be returned instead of
url. Decode it to save.width / height / sizeinteger / stringOptionalImage dimensions, as width and height or
WxH, when present.
Errors
Errors return {"error": {"message": "...", "type": "...", "code": "..."}}.
| HTTP | code | Cause and action |
|---|---|---|
| 400 | — | Invalid parameters such as missing model, n above 128 or × in size; see error.message. |
| 400 | asset_reference_not_found | The asset:// asset does not exist or is not yours. |
| 401 | — | The API key is invalid, expired or disabled. |
| 403 | insufficient_user_quota | Insufficient balance or key quota. |
| 403 | — | The key does not allow this model, or the IP is restricted. |
| 429 | — | Rate limited; retry later. |
| 503 | model_not_found | No channel is available for the model, or Seedream was called on an unsupported endpoint such as edits. |
| 524 | — | Gateway timeout while waiting (an HTML page). The image may still be generated and billed; check usage logs before retrying, or use asynchronous image tasks. |
curl -X POST https://ling-light.com/v1/images/generations \
-H "Authorization: Bearer $LINGLIGHT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-5.5",
"prompt": "16:9 landscape, a lakeside cabin in morning mist, realistic photo",
"size": "2K",
"output_format": "png"
}'const response = await fetch('https://ling-light.com/v1/images/generations', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LINGLIGHT_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"model": "seedream-5.5",
"prompt": "16:9 landscape, a lakeside cabin in morning mist, realistic photo",
"size": "2K",
"output_format": "png"
}),
})
console.log(response.status, await response.json())import os
import requests
response = requests.post(
"https://ling-light.com/v1/images/generations",
headers={
"Authorization": f"Bearer {os.environ['LINGLIGHT_API_KEY']}",
},
json={
"model": "seedream-5.5",
"prompt": "16:9 landscape, a lakeside cabin in morning mist, realistic photo",
"size": "2K",
"output_format": "png",
},
timeout=60,
)
print(response.status_code, response.json()){
"created": 1795660800,
"data": [
{
"url": "https://media.example.com/images/example.png",
"size": "2816x1584"
}
]
}curl -X POST https://ling-light.com/v1/images/generations \
-H "Authorization: Bearer $LINGLIGHT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-5.5",
"prompt": "Keep the vase and flowers from the reference; portrait watercolor on a light beige background",
"image": [
"https://media.example.com/images/reference.png"
],
"size": "1584x2816",
"background": "opaque",
"output_format": "png",
"watermark": false
}'const response = await fetch('https://ling-light.com/v1/images/generations', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LINGLIGHT_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"model": "seedream-5.5",
"prompt": "Keep the vase and flowers from the reference; portrait watercolor on a light beige background",
"image": [
"https://media.example.com/images/reference.png"
],
"size": "1584x2816",
"background": "opaque",
"output_format": "png",
"watermark": false
}),
})
console.log(response.status, await response.json())import os
import requests
response = requests.post(
"https://ling-light.com/v1/images/generations",
headers={
"Authorization": f"Bearer {os.environ['LINGLIGHT_API_KEY']}",
},
json={
"model": "seedream-5.5",
"prompt": "Keep the vase and flowers from the reference; portrait watercolor on a light beige background",
"image": [
"https://media.example.com/images/reference.png",
],
"size": "1584x2816",
"background": "opaque",
"output_format": "png",
"watermark": False,
},
timeout=60,
)
print(response.status_code, response.json()){
"created": 1795660800,
"data": [
{
"url": "https://media.example.com/images/example.png",
"size": "1584x2816"
}
]
}