Skip to content

Seedream 5.0 Lite ​

ByteDance | 2K / 3K / 4K | 1–15 images per task | reference editing | batch generation

Seedream 5.0 Lite generates images from text plus optional references, and can return several images from a single task. Every request creates one asynchronous task: create it, poll it, then download the private roles it returns.

Base URL https://api.tokenlio.ai — the paths below are relative to it:

  • Create: POST /v1/images/generations → 202 Accepted
  • Query: GET /v1/tasks/{id}
  • Download: GET /v1/tasks/{id}/content?role=image_0

Before you start

  1. Create a Workspace model-routing API key in the Tokenlio console.
  2. Copy the API model ID published for your Workspace from the model catalog. The examples use seedream-5-0-lite.
  3. Image tasks are asynchronous: the create call only accepts the task. Poll until succeeded, then download.

Integration guide, not an availability announcement

Available models, parameter support and prices are listed in the catalog, and your Workspace and API key must both be permitted for this model. This page describes the contract; it does not grant access.

1. Choose a model ​

ModelSize tiersImages per taskExtra output controls
Seedream 5.0 Lite2k / 3k / 4k1–15 in one taskbatch generation via n
Seedream 5.0 Flash1k / 1.5k / 2kexactly 1transparent PNG, layer decomposition
Seedream 5.0 Pro1k / 1.5k / 2kexactly 1transparent PNG, layer decomposition

Lite is the model to use when you need several variations of one prompt, or when you want 3K/4K output. It accepts n from 1 to 15 and returns that many files in one task. In exchange it does not accept background, layer_decomposition or optimize_prompt_options, and its size rules differ from Flash and Pro.

size and n follow Lite's own rules

Lite defaults to size: 1:1 with resolution: 2k. Only aspect ratios, auto and the 2k / 3k / 4k tiers are accepted — exact WxH pixels are not. image_urls count plus n must not exceed 15.

Model names describe capabilities, not access. All values below are placeholders only for the parts you must replace.

2. Quick start: create, poll, download ​

bash
BASE_URL='https://api.tokenlio.ai'
curl "$BASE_URL/v1/images/generations" \
  -H "Authorization: Bearer $TOKENLIO_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: seedream-lite-001' \
  --data '{"model":"seedream-5-0-lite","prompt":"A serene mountain lake at sunrise, soft mist over the water","size":"1:1","resolution":"2k","n":1}'
json
{
  "model": "seedream-5-0-lite",
  "prompt": "A serene mountain lake at sunrise, soft mist over the water",
  "size": "1:1",
  "resolution": "2k",
  "n": 1
}
python
import json, os, urllib.request

body = {
    "model": "seedream-5-0-lite",
    "prompt": "A serene mountain lake at sunrise, soft mist over the water",
    "size": "1:1",
    "resolution": "2k",
    "n": 1,
}
request = urllib.request.Request(
    "https://api.tokenlio.ai/v1/images/generations",
    data=json.dumps(body).encode(),
    headers={
        "Authorization": f"Bearer {os.environ['TOKENLIO_API_KEY']}",
        "Content-Type": "application/json",
        "Idempotency-Key": "seedream-lite-001",
    },
)
print(json.load(urllib.request.urlopen(request)))

A 202 means the task was accepted, not that images exist:

json
{
  "id": "dfc68868-d388-4d83-a173-d44e47a8bec7",
  "model": "seedream-5-0-lite",
  "status": "queued",
  "assets": []
}

Then poll and download:

bash
curl "https://api.tokenlio.ai/v1/tasks/dfc68868-d388-4d83-a173-d44e47a8bec7" \
  -H "Authorization: Bearer $TOKENLIO_API_KEY"
bash
curl --location "https://api.tokenlio.ai/v1/tasks/dfc68868-d388-4d83-a173-d44e47a8bec7/content?role=image_0" \
  -H "Authorization: Bearer $TOKENLIO_API_KEY" -o result.jpeg

status moves queued → processing → succeeded or failed. Poll every 5–15 seconds; the default image timeout is 10 minutes, and a multi-image task naturally takes longer than a single one. Keep message and error.code, and never create a new task while a previous response is still uncertain — query the stored task ID instead.

3. Request parameters ​

ParameterTypeDefaultContract
modelstringrequiredExact published API model ID
promptstringrequiredNon-empty UTF-8 text
ninteger11–15; also bounded by the reference count
sizestring1:1auto, a ratio, or nothing else — exact pixels and tiers go in resolution
resolutionstring2k2k / 3k / 4k
output_formatstringjpegjpeg or png
image_urlsstring[]emptyPublic HTTPS URLs or complete Base64 Data URIs; input order is significant
watermarkbooleanomittedSend explicitly to control watermarking
nsfw_checkbooleanomittedSend explicitly to control content checking
sequential_image_generationstringdisabled, or auto when n > 1auto or disabled
sequential_image_generation_optionsobjectomitted{"max_images": 1..15}; requires sequential_image_generation: "auto"

Use real JSON booleans and integers — not strings, and not null. Unknown fields, duplicate keys, null values and trailing data are rejected.

Not accepted by this model

background, layer_decomposition and optimize_prompt_options are Flash/Pro controls and are rejected here. quality, mask_url, output_compression, moderation, aspect_ratio and response_format are not part of this integration either. There is no data[].b64_json response and no multipart /v1/images/edits; references go in image_urls.

4. Size, resolution and output count ​

sizeresolutionActual output
1:1 (default)2k (default)Square image at the 2K tier
A ratio such as 16:92k / 3k / 4kThat ratio at the chosen tier
auto2k / 3k / 4kFollows the reference image; requires at least one reference
  • Supported ratios: 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 2:1, 1:2, 21:9.
  • resolution must be 2k, 3k or 4k. 1k and 1.5k belong to Flash and Pro.
  • Exact WxH pixels are rejected; use a ratio plus a tier instead.
  • size: auto without a reference image is rejected, because there is nothing to follow.

Batch generation ​

n requests between 1 and 15 images in one task, and image_urls.length + n must not exceed 15. Both n and the reference count therefore shrink each other:

ReferencesMaximum n
015
510
105
141

sequential_image_generation defaults to disabled when n is 1 and to auto when n is above 1. If you send sequential_image_generation_options.max_images, it must equal n, and sequential_image_generation must be auto; sending disabled with n > 1 is rejected.

json
{
  "model": "seedream-5-0-lite",
  "prompt": "Four poster layouts for a mountain travel campaign, same palette",
  "size": "3:4",
  "resolution": "3k",
  "n": 4
}
json
{
  "model": "seedream-5-0-lite",
  "prompt": "Keep the product and vary the background three ways",
  "size": "auto",
  "resolution": "2k",
  "image_urls": ["https://YOUR_PUBLIC_CDN/product.png"],
  "n": 3
}

5. Reference images and Base64 ​

Send references in image_urls as public HTTPS URLs or as complete Data URIs. Order is preserved, so describe positions in the prompt when it matters.

LimitLite
Reference images per requestbounded by image_urls.length + n ≤ 15
Bytes per reference file≤ 10 MiB
Decoded inline images, total≤ 45 MiB
Whole JSON request body≤ 64 MiB
Pixels per sidemore than 14 px, at most 24,000 px
Total pixels per image≤ 36 megapixels
Aspect ratiobetween 1:3 and 3:1
Accepted formatsPNG, JPEG

Every reference must be a single, fully decodable static image. Lite accepts only PNG and JPEG — WebP, GIF, BMP and TIFF belong to Flash and Pro, and HEIC/HEIF are not supported at all, so convert them first. For Base64, send the complete data:image/png;base64,... form: bare Base64, URL-safe alphabets, spaces, missing padding and a declared MIME that disagrees with the real bytes are all rejected.

Inline identity is the decoded image content, not the Base64 text, so re-wrapping line breaks does not create a different request. Large batches should use URLs instead of inline data. URLs are measured after the task is accepted, so a broken or slow link can still fail the task later.

python
import base64, json
from pathlib import Path

data = Path("reference.png").read_bytes()
request = {
    "model": "seedream-5-0-lite",
    "prompt": "Keep the subject and change the lighting to a soft window light",
    "size": "auto",
    "resolution": "2k",
    "n": 2,
    "image_urls": ["data:image/png;base64," + base64.b64encode(data).decode("ascii")],
}
Path("request.json").write_text(json.dumps(request), encoding="utf-8")
bash
curl "https://api.tokenlio.ai/v1/images/generations" \
  -H "Authorization: Bearer $TOKENLIO_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: seedream-lite-reference-001' \
  --data-binary @request.json
json
{
  "model": "seedream-5-0-lite",
  "prompt": "Place the same chair beside a large window, keep its material",
  "size": "4:3",
  "resolution": "2k",
  "image_urls": ["https://YOUR_PUBLIC_CDN/chair.png"]
}

Build the JSON with a JSON library and hold it in a file or memory. Never paste image bytes into a query string, a header or your logs.

6. Watermark and content check ​

Send watermark or nsfw_check explicitly when you need a specific value — leaving them out means the platform does not set them. Both are ordinary booleans, for example "watermark": false.

7. Results and roles ​

json
{
  "id": "dfc68868-d388-4d83-a173-d44e47a8bec7",
  "model": "seedream-5-0-lite",
  "status": "succeeded",
  "assets": [
    {
      "role": "image_0",
      "url": "https://private.example.com/signed-result-0",
      "mime": "image/jpeg",
      "width": 2048,
      "height": 2048
    },
    {
      "role": "image_1",
      "url": "https://private.example.com/signed-result-1",
      "mime": "image/jpeg",
      "width": 2048,
      "height": 2048
    }
  ]
}
FieldMeaning
assets[].roleimage_0, image_1, … in requested order
assets[].urlPrivate signed link; query the task again for a fresh one
assets[].mimeMeasured type of the delivered file
assets[].width / heightMeasured pixel size

Sort by the numeric index in role, not as plain strings (image_2 before image_10), and use the real mime, width and height instead of guessing from a file extension. Download only the roles the task actually returned. Assets become readable only after the whole result is delivered: a partial list is never a partial success. Every GET /v1/tasks/{id} returns working private links, so refresh them instead of storing signed URLs.

Lite results contain one file per requested image and no layers, so there is no canvas and no layer object.

8. Pricing, idempotency and errors ​

Billing is per delivered image at the published price for the model and size tier. A task requesting n: 4 is billed for the images it actually delivers, at the same per-image price — not as a fixed task price. Failed, timed-out or rejected generations are not charged to the customer.

Send Idempotency-Key on create. Retrying the same request with the same key returns the original task; the same key with different parameters or different input identity returns 409 and must not be treated as a new task. A n change is a different request, so it needs a new key.

HTTPerror.codeTypical cause
400IMAGE_REQUEST_INVALIDInvalid or unsupported field; the message names the field and the limit
400IMAGE_ASSET_INVALIDReference image format, dimensions, size or transparency rejected
401 / 404IMAGE_TASK_NOT_FOUNDKey disabled, wrong Workspace, or task not visible to it
409IMAGE_IDEMPOTENCY_CONFLICTSame Idempotency-Key used for a different request
409IMAGE_PRICE_CHANGEDOptions or price changed; retry the original request with the same key
413IMAGE_REQUEST_TOO_LARGEBody above 64 MiB, or inline images above 45 MiB decoded
429IMAGE_RATE_LIMITEDRequest rate or concurrency limit reached
429IMAGE_AMOUNT_BUDGET_EXCEEDEDWorkspace, member or key usage limit reached
503IMAGE_SERVICE_UNAVAILABLEConfiguration unavailable for this model

Messages are written for the field you got wrong, for example the number of image_urls plus n must not exceed 15, resolution must be 2k, 3k or 4k for this model or background is not supported for this model. When the task itself fails, read error.code — including TASK_TIMEOUT — instead of retrying blindly.

Next steps ​

Access leading AI models through one unified API