Image Generation
doubao-seedream-4-0-250828 Image Generation API
Supports high-quality text-to-image generation, reference-image generation, multi-image blending, and image-set generation.
Authorization
BearerAuth
Model relay interface recognition. Request heading: Autoration: Bearer .
In: header
Request Body
application/json
Picture model name.
"doubao-seedream-4-0-250828"Inverted words. Range: 1 to 200000 characters, with a specific upper limit based on the model official interface.
Returns the number of pictures. Creates the number of candidates. Scope: 1 to 10; specific ceilings are based on the model official interface.
1 <= value <= 10Generates dimensions, such as FD_PROTEC_0.
Generates a quality slot.
Generates style.
Picture returns format, e. g. FD_PROTEC_0 or FD_PROTEC_1__.
End-user identification.
Response Body
application/json
curl -X POST "https://api.tokaify.com/v1/images/generations" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedream-4-0-250828", "prompt": "The ability to describe this API gateway in plain Chinese." }'{
"created": 1,
"data": {}
}Request Parameters
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | None | Fixed to doubao-seedream-4-0-250828. |
prompt | string | Yes | None | Generation or edit prompt. Keeping it under 300 Chinese characters or 600 English words is recommended. |
image | string or string[] | No | None | Reference image URL or Base64. For multi-image blending, up to 14 references is recommended, and the total of references plus generated images should not exceed 15. |
size | string | No | 2K | Supports 1K, 2K, 4K, or <width>x<height>; an aspect ratio between 1:16 and 16:1 is recommended. |
response_format | string | No | url | Response format. Supports url or b64_json. |
watermark | boolean | No | true | Whether to add an AI-generated watermark. |
sequential_image_generation | string | No | disabled | Image-set mode. Supports disabled or auto. |
sequential_image_generation_options.max_images | integer | No | 1 | Maximum output count for image sets, from 1 to 15. |
stream | boolean | No | false | Whether to enable streaming output. |
user | string | No | None | End-user identifier. |
Example Code
curl https://api.tokaify.com/v1/images/generations \
-H "Authorization: Bearer $TOKAIFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-4-0-250828",
"prompt": "Generate three SaaS landing-page hero illustrations with a consistent style, blue-purple gradients, and glassmorphism.",
"size": "2K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": { "max_images": 3 },
"response_format": "url"
}'import requests
response = requests.post(
"https://api.tokaify.com/v1/images/generations",
headers={"Authorization": "Bearer YOUR_TOKAIFY_API_KEY"},
json={
"model": "doubao-seedream-4-0-250828",
"prompt": "Generate three SaaS landing-page hero illustrations with a consistent style, blue-purple gradients, and glassmorphism.",
"size": "2K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": {"max_images": 3},
"response_format": "url",
},
)
print(response.json())const response = await fetch("https://api.tokaify.com/v1/images/generations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TOKAIFY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "doubao-seedream-4-0-250828",
prompt: "Generate three SaaS landing-page hero illustrations with a consistent style, blue-purple gradients, and glassmorphism.",
size: "2K",
sequential_image_generation: "auto",
sequential_image_generation_options: { max_images: 3 },
response_format: "url",
}),
});
console.log(await response.json());Response Example
{
"created": 1777432320,
"data": [
{
"url": "https://api.tokaify.com/assets/images/seedream-4-0-1.png",
"b64_json": null,
"revised_prompt": "SaaS homepage hero illustration, blue-purple gradients, glassmorphism, unified brand visual language."
}
]
}Notes
Billing follows the configured model and channel ratios. guidance_scale is not recommended for Seedream 4.0. For image sets, use sequential_image_generation=auto and keep max_images constrained.
How is this guide?
Last updated on