Call Seedream 5.0 Lite, 4.5, and 4.0 through the unified image generation endpoint. This family guide covers model selection, basic generation, and supported editing or image-sequence tasks.
https://api.tokensmarket.ai/v1POST /images/generationsThe endpoint remains fixed. Use the parameter documentation on this page to replace the model ID and request data.
${base_url}/images/generationsAll media generation requests are authenticated through the Token Market unified gateway and use a JSON request body.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
Authorization | string | Yes | — | Append the current workspace API Key after Bearer. Options / constraints: Bearer <API_KEY>. |
Content-Type | string | Yes | application/json | Send the request body as JSON. |
Send requests with the unified fields. Seedream-specific fields take effect only when the selected version and current provider channel support them.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | — | The exact Seedream model ID to call. Options / constraints: seedream-5-0-lite; seedream-4-5; seedream-4-0 |
prompt | string | Yes | — | Describe the target image and, for editing tasks, what to preserve and what to change. |
image | string | string[] | No | — | The input image for an editing or reference task. Options / constraints: Use only when the selected version supports image input. See the model details page for format and quantity limits. |
size | string | No | — | The target image size or resolution. Options / constraints: Custom dimensions and available ranges depend on the selected version. |
sequential_image_generation | string | No | — | Controls whether to generate a sequence of related images. Options / constraints: Available only for versions and provider channels that support image sequences. |
sequential_image_generation_options.max_images | integer | No | — | The maximum number of images a sequence task may return. Options / constraints: Use only when sequential_image_generation is enabled. |
output_format | string | No | — | The requested image file format. Options / constraints: Supported values depend on the selected version and current provider channel. |
watermark | boolean | No | — | Controls whether a watermark is added. Options / constraints: Use only when the current provider channel supports this field. |
seed | integer | No | — | A random seed used to improve control over repeated generations. Options / constraints: The same seed does not guarantee identical results across versions or provider channels. |
extra_body.provider | object | No | — | Restricts or ranks candidate provider channels. Options / constraints: Use fields such as only, ignore, order, and sort according to the unified routing rules. |
The image generation endpoint returns JSON. Available result fields depend on the model, provider channel, and requested output format.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
created | integer | No | — | The response creation time, usually as a Unix timestamp. |
data | array | No | — | The generated result list. Multi-image requests may return multiple results. |
data[].url | string | No | — | A temporary URL for the generated image. Options / constraints: Present only when the current model and provider channel return a URL. Copy the asset to your own storage promptly. |
data[].b64_json | string | No | — | The Base64-encoded image content. Options / constraints: Present only when the request and current provider channel support Base64 output. |
data[].revised_prompt | string | No | — | The prompt used or revised by the model. Options / constraints: Returned only by some models and provider channels. |
provider | string | No | — | Information about the provider channel that handled the request. |
request_id | string | No | — | A request identifier for log lookup and troubleshooting. Options / constraints: The field name may change with the current gateway response version. |
seedream-5-0-lite, seedream-4-5, and seedream-4-0 use the same unified endpoint, but their capabilities, pricing, latency, and limits may differ. Keep regression examples and recheck the model details when switching versions.
Submit image or image-sequence fields only when the model details page explicitly shows that capability. Unrecognized extension fields may be rejected or ignored; applications should not assume identical behavior across versions.
Generated result URLs may expire. After a successful response, promptly download the asset, validate its content type, copy it to your own object storage, and record request_id, model, and provider.
The examples use placeholders. Replace them with a currently available model ID from the model details page, and keep your API Key in a server-side environment variable.
curl https://api.tokensmarket.ai/v1/images/generations \
-H "Authorization: Bearer $TOKEN_MARKET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-5-0-lite",
"prompt": "A cinematic paper-cut city at sunrise",
"size": "1024x1024"
}'