Skip to content

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.

Models and limits

ModelRule groupEndpointsnReference imagesprompt limit (chars)
seedream-5.5Seedream 5.5 series/v1/images/generations/v1/images/tasks10–10image on generations10,000
seedream-5.5-nsfwSeedream 5.5 series/v1/images/generations/v1/images/tasks10–10image on generations10,000
seedream-5.0-proSeedream 5.0 Pro series/v1/images/generations/v1/images/tasks10–10image on generations10,000
seedream-5.0-pro-nsfwSeedream 5.0 Pro series/v1/images/generations/v1/images/tasks10–10image on generations10,000

Headers

  • AuthorizationstringRequired

    Bearer <API_KEY>.

  • Content-TypestringRequired

    application/json. Only JSON bodies are supported.

Request bodyJSON

  • modelstringRequired

    A 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
  • promptstringRequired

    Describe 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[]Optional

    Reference image: one URL or an array of 1–10 URLs; omit for text-to-image. Seedream does not use the images field.

    Limits

    • A publicly reachable https:// image URL, or asset://<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.
  • nintegerOptionalDefault 1

    Only 1; may be omitted.

    Billed as per-image price × count, reserved from n at submission.

  • sizestringOptionalDefault 2K

    Send a tier 1K, 1.5K or 2K and describe the aspect ratio in the prompt, or send one of the fixed sizes below. Other dimensions are not supported.

    Use a lowercase x between width and height, not ×.

    Supported values

    • 1K1:1 1024x1024 · 4:3 1152x864 · 3:4 864x1152 · 16:9 1424x800 · 9:16 800x1424 · 3:2 1248x832 · 2:3 832x1248 · 21:9 1568x672
    • 1.5K1:1 1536x1536 · 4:3 1792x1344 · 3:4 1344x1792 · 16:9 2048x1152 · 9:16 1152x2048 · 3:2 1872x1248 · 2:3 1248x1872 · 21:9 2352x1008
    • 2K1:1 2048x2048 · 4:3 2368x1776 · 3:4 1776x2368 · 16:9 2816x1584 · 9:16 1584x2816 · 3:2 2496x1664 · 2:3 1664x2496 · 21:9 3136x1344
  • backgroundstringOptional

    Background type.

    By model group

    Seedream 5.5 series
    auto (default), opaque, transparent. Transparency requires output_format: "png" and works from text or from ordinary reference images.
    Seedream 5.0 Pro series
    opaque (default) or transparent; auto is not supported. transparent requires image to be exactly one PNG with an alpha channel, and output_format: "png".
  • output_formatstringOptional

    Image file format: png or jpeg only.

    By model group

    Seedream 5.5 series
    Defaults to png.
    Seedream 5.0 Pro series
    Defaults to jpeg.
  • watermarkbooleanOptionalDefault true

    true adds an “AI generated” watermark; false omits it.

Returns

HTTP 200 with the list of images.

  • createdintegerOptional

    Creation time in Unix seconds.

  • dataobject[]Optional

    Generated images, one per item.

    Show child fields (3)
    • urlstringOptional

      Download URL. Use it as returned and save the image promptly; do not send your API key when downloading.

    • b64_jsonstringOptional

      Base64 image data, which may be returned instead of url. Decode it to save.

    • width / height / sizeinteger / stringOptional

      Image dimensions, as width and height or WxH, when present.

Errors

Errors return {"error": {"message": "...", "type": "...", "code": "..."}}.

HTTPcodeCause and action
400—Invalid parameters such as missing model, n above 128 or × in size; see error.message.
400asset_reference_not_foundThe asset:// asset does not exist or is not yours.
401—The API key is invalid, expired or disabled.
403insufficient_user_quotaInsufficient balance or key quota.
403—The key does not allow this model, or the IP is restricted.
429—Rate limited; retry later.
503model_not_foundNo 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.
Text-to-image at the 2K tier
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())
Response
{
  "created": 1795660800,
  "data": [
    {
      "url": "https://media.example.com/images/example.png",
      "size": "2816x1584"
    }
  ]
}
A 2K portrait PNG from a reference
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())
Response
{
  "created": 1795660800,
  "data": [
    {
      "url": "https://media.example.com/images/example.png",
      "size": "1584x2816"
    }
  ]
}
API reference overview
Authentication, media URLs, idempotency and errors.
Integration guide
The full flow from API key to downloaded result.
Last updated