Skip to content
TutujinAPI

ByteDance DoubaoImage

doubao-seedream-4-0-250828

Image generation model from ByteDance Doubao; supports image editing.

  • Released Sep 09, 2025
  • 1 groups
  • Image editing
Best success rate
Fastest first token
Top throughput

Line monitoring over the last 24 hours, refreshed about every 5 minutes

What matters most to you?

We recommend one group for your priority — pick it when you create an API key.

Pricing by group

Each group routes the same model through a different line at a different price. You choose a group for every API key you create in the console.

Availability, throughput and latency come from line monitoring over the last 24 hours, refreshed about every 5 minutes.

Line availability, last 24 hours

Line monitoring over the last 24 hours, refreshed about every 5 minutes. Success rates come from real requests; hours without traffic show as “no data” and don't count toward the rate.

API reference

OpenAI-compatible: set the base URL to https://www.tutujin.com/v1 and create an API key in the console. The examples below already use this model's ID.

The examples read the key from the TUTUJIN_API_KEY environment variable. Never put keys in front-end code or commit them to a repository.

POST

https://www.tutujin.com/v1/images/generations

Generate images from a text prompt; returns image URLs or Base64 data.

Headers

Authorization:
Bearer $TUTUJIN_API_KEY
Content-Type:
application/json
curl https://www.tutujin.com/v1/images/generations \
  -H "Authorization: Bearer $TUTUJIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedream-4-0-250828",
    "prompt": "An orange cat sunbathing by the window, watercolor style",
    "size": "1024x1024",
    "n": 1
  }'

Key parameters

modelstringRequired
Model ID — here doubao-seedream-4-0-250828
promptstringRequired
Description of the image
sizestring
Image size, e.g. 1024x1024; allowed values depend on the model
ninteger
Number of images. Default 1
qualitystring
Quality tier, model-dependent
response_formatstring
Return url or b64_json

Tokens and billing

Models meter input and output in tokens. Knowing how tokens are counted helps you predict cost more accurately.

What is a token?

A token is the smallest unit a model reads or writes. Your text is split into tokens by the model's tokenizer, and you're billed by the token count.

Tokenizers differ between vendors and model generations, so the same text can produce noticeably different counts on different models. The usage field returned by the API is the exact number.

Rough conversions for English and Chinese

These rules of thumb are for rough estimates only; actual counts depend on the model's tokenizer. Code, numbers, rare characters and emoji usually take more tokens.

ContentApprox. tokens
1 English wordabout 1.3
1,000 English charactersabout 250
1 Chinese characterabout 0.6 – 1.5, tokenizer-dependent
1,000 Chinese charactersabout 600 – 1,500

How input, output and cache are billed

For token-billed models, the cost of a request is the sum of the parts below; every price is quoted per million tokens:

  • Input (prompt tokens): system prompt, earlier messages, tool definitions and file contents all count as input, billed at the input price.
  • Output (completion tokens): what the model generates, billed at the output price — usually several times the input price.
  • Cache reads: input tokens served from the context cache are billed at the cache-read price, typically a small fraction of the input price.
  • Cache writes: some models (such as Claude) charge a cache-write price the first time content is written to the cache.
  • Per-call models (common for images and video) charge a fixed price per request, regardless of tokens.

Cost = input × input price + output × output price + cache reads × cache-read price + cache writes × cache-write price

This model is billed per call: ¥0.28 per request in the “Standard” group, regardless of input or output length.

Reasoning tokens count as output

Reasoning (thinking) models produce internal reasoning before the answer. Those tokens may not be returned to you, but they count as output (reasoning tokens in usage) and are billed at the output price.

So the same question usually costs more output tokens on a reasoning model. For tasks that don't need deep reasoning, lower the reasoning effort or use a non-reasoning model.

Images and audio are converted to tokens too

Multimodal models convert images into input tokens based on resolution — larger images and higher detail settings cost more — and audio is usually converted by duration. The exact conversion varies by model; check the usage field.

Where to see what each call cost

In the console, Usage lists every call with its model, group, input / output / cache token counts and the amount charged, with filters and export.

In code, the usage field in each response gives the token counts; for streaming requests, turn on include_usage.

Ways to spend less

  • Pick the right group: the same model costs different amounts in different groups — the Pricing tab ranks them by cost, balance or reliability.
  • Use the cache: put stable system prompts and reference documents at the start of your messages to raise cache hits.
  • Limit output: set max_tokens and ask for concise output formats.
  • Trim context: summarize long conversations instead of resending the full history every turn.
  • Mix model sizes: send simple classification or extraction to cheaper models and save flagship models for hard tasks.
  • Lower the reasoning effort on reasoning models when you can.