Tokaify APITokaify API
API Reference
AI Model APIImagesDoubao APIdoubao-seedream-4-0-250828

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.

POST
/v1/images/generations

Authorization

BearerAuth

AuthorizationBearer <token>

Model relay interface recognition. Request heading: Autoration: Bearer .

In: header

Request Body

application/json

model*string

Picture model name.

Default"doubao-seedream-4-0-250828"
prompt*string

Inverted words. Range: 1 to 200000 characters, with a specific upper limit based on the model official interface.

n?integer

Returns the number of pictures. Creates the number of candidates. Scope: 1 to 10; specific ceilings are based on the model official interface.

Range1 <= value <= 10
size?string

Generates dimensions, such as FD_PROTEC_0.

quality?string

Generates a quality slot.

style?string

Generates style.

response_format?string

Picture returns format, e. g. FD_PROTEC_0 or FD_PROTEC_1__.

user?string

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

FieldTypeRequiredDefaultDescription
modelstringYesNoneFixed to doubao-seedream-4-0-250828.
promptstringYesNoneGeneration or edit prompt. Keeping it under 300 Chinese characters or 600 English words is recommended.
imagestring or string[]NoNoneReference 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.
sizestringNo2KSupports 1K, 2K, 4K, or <width>x<height>; an aspect ratio between 1:16 and 16:1 is recommended.
response_formatstringNourlResponse format. Supports url or b64_json.
watermarkbooleanNotrueWhether to add an AI-generated watermark.
sequential_image_generationstringNodisabledImage-set mode. Supports disabled or auto.
sequential_image_generation_options.max_imagesintegerNo1Maximum output count for image sets, from 1 to 15.
streambooleanNofalseWhether to enable streaming output.
userstringNoNoneEnd-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