Skip to content
NEWNano Banana 2.1 is live — Google's latest image model, from $0.0336 per image, native 4K, about half the price of the previous generationView model
HopBase
← Back to blog

Doubao API Outside China: Seed, Seedream and Seedance

The short answer: you can call ByteDance's Doubao Seed chat models, Seedream image models, Seedance video models and Doubao Speech from outside China with one HopBase key and the OpenAI SDK. Set base_url to https://api.hop-base.com/v1, add the groups you need to the key in the console, and use the exact model IDs from GET /v1/models. For example, use doubao-seed-2-1-pro-260628 for chat, seedream-5-0-pro for images, dreamina-seedance-2-5-260628 for video and seed-tts-2.0 for speech. Chat works over Chat Completions, Responses and Anthropic Messages. Images are synchronous on /v1/images/generations. Video is an asynchronous task you submit and then poll. You sign up with an email address or a Google or GitHub account, and you pay as you go in USD by card, Apple Pay, Google Pay, Alipay, AlipayHK or WeChat Pay. Official list prices are on the pricing page.

What "Doubao" covers, and which group serves it

ByteDance publishes several model lines under the Doubao and Seed names. On HopBase each line sits in its own group, and one key can include up to 10 groups:

Product line What it does Console group Model IDs
Doubao Seed chat Text and image-input chat, tool calling, thinking Doubao Seed Cloud doubao-seed-2-1-pro-260628, doubao-seed-2-1-pro-260915, doubao-seed-2-1-lite-260915, doubao-seed-2-1-turbo-260628, doubao-seed-evolving, doubao-seed-character-260628, doubao-seed-2-0-mini-260428
Seedream Text-to-image, image-to-image, editing Seedream Image Generation, or Seedance overseas + Seedream (this one has only seedream-5-0-pro) seedream-5-0-pro, seedream-5-0-lite, seedream-4-5
Seedance (overseas IDs) Text, image and reference to video Seedance overseas + Seedream dreamina-seedance-2-5-260628, dreamina-seedance-2-0-260128, dreamina-seedance-2-0-fast-260128, dreamina-seedance-2-0-mini-260615
Seedance (China IDs) Same families, China model IDs Seedance China (Doubao) doubao-seedance-2-5-260628-a, doubao-seedance-2-0-260128-a, doubao-seedance-2-0-fast-260128-a, doubao-seedance-2-0-mini-260615-a
Doubao Speech Text to speech, scene audio, voice cloning Doubao Speech Cloud seed-tts-2.0, seed-audio-1.0, seed-icl-2.0

Do not confuse doubao-seed-* (chat) with doubao-seedance-* (video). They are different groups. Model IDs are matched exactly: copy them from GET /v1/models, and do not shorten them or add suffixes.

Step 1: create a key and list its models

Sign up at api.hop-base.com, open API Keys, create a key and add the groups from the table above. Then check what the key can reach:

export HOPBASE_API_KEY=sk-your-key
curl https://api.hop-base.com/v1/models \
  -H "Authorization: Bearer $HOPBASE_API_KEY"

Doubao Seed chat with the OpenAI SDK

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.hop-base.com/v1",
    api_key=os.environ["HOPBASE_API_KEY"],
)

resp = client.chat.completions.create(
    model="doubao-seed-2-1-pro-260628",
    messages=[{"role": "user", "content": "Summarise the main idea of retrieval-augmented generation in two sentences."}],
    max_tokens=4000,
)
print(resp.choices[0].message.content)

What to know before you ship:

  • Context and output. doubao-seed-2-1-pro-260915 and doubao-seed-2-1-lite-260915 have a 1M-token context and up to 256K output. doubao-seed-2-1-pro-260628, doubao-seed-2-1-turbo-260628, doubao-seed-evolving and doubao-seed-2-0-mini-260428 have a 256K context and up to 128K output. doubao-seed-character-260628 has a 128K context and up to 32K output.
  • Thinking. Every model except doubao-seed-character-260628 thinks by default and returns the thinking in reasoning_content. Thinking counts toward max_tokens, so leave room.
  • Images. All seven models accept image_url content parts as a public URL or a data: URI (base64). Use base64 for private links.
  • Tools. All seven support tool calling. doubao-seed-evolving and doubao-seed-2-1-pro-260915 ignore tool_choice. To force or disable tool calls, use doubao-seed-2-1-pro-260628 or doubao-seed-2-1-lite-260915.
  • Not supported. logprobs is not supported on doubao-seed-2-1-pro-260915 or doubao-seed-2-1-lite-260915.
  • Other protocols. The same models work on POST /v1/responses and on Anthropic Messages (base_url="https://api.hop-base.com", no /v1).
  • Streaming usage. Send stream_options={"include_usage": True} to get usage in the stream. Context-cache hits bill at the cached-input price.

Full parameter tables: Create chat completion: Doubao Seed and the model card.

Seedream images with the OpenAI SDK

Seedream is synchronous: the response contains the image link. There is no task to poll.

img = client.images.generate(
    model="seedream-5-0-pro",
    prompt="A ceramic coffee cup on a linen tablecloth, soft morning light, product photo",
    size="2K",
)
print(img.data[0].url)  # signed link, valid 24 hours: download it
  • Sizes. seedream-5-0-pro takes 1K, 1.5K or 2K, or WIDTHxHEIGHT between 921,600 and 4,624,220 pixels. On Pro, 1.5K costs the same as 1K and gives better quality. seedream-5-0-lite (2K / 3K / 4K) and seedream-4-5 (2K / 4K) output at least 2K.
  • References and edits. Put reference images in image (a URL or Data URL, a string or an array). Pro takes up to 10 references; Lite and 4.5 take up to 14. There is no mask: describe the area to edit in the prompt.
  • n is always 1. For a set of images, use group generation on Lite or 4.5.

See Seedream for layer decomposition, transparent backgrounds and streaming.

Seedance video: submit, then poll

import os, time, requests

API = "https://api.hop-base.com/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['HOPBASE_API_KEY']}"}

task = requests.post(f"{API}/video/generate", headers=HEADERS, json={
    "model": "dreamina-seedance-2-5-260628",
    "content": [{"type": "text", "text": "An orange cat runs across sunlit grass as the camera follows"}],
    "duration": 5,
    "resolution": "720p",
    "ratio": "16:9",
}).json()["task"]

while True:
    t = requests.get(f"{API}/video/tasks/{task['id']}", headers=HEADERS).json()["task"]
    if t["status"] == "completed":
        print(t["outputs"][0]); break   # valid 24 hours after completion
    if t["status"] == "failed":
        raise RuntimeError(t["error"]["message"])
    time.sleep(5)
  • Which IDs? Overseas dreamina-seedance-* keys cannot call doubao-seedance-* IDs. The China group also accepts the overseas IDs as aliases (except 4K), so moving from overseas to China only means swapping the key. 4K is available only on overseas 2.0 Standard (dreamina-seedance-2-0-260128).
  • Durations. 2.0: 4 to 15 seconds; 2.5: 4 to 30 seconds, or -1 to let the model choose.
  • Fields. All fields are top-level JSON, and the prompt goes in a text item of content. size, seconds, n and aspect_ratio are silently ignored: use duration, resolution and ratio.
  • Billing. Failed tasks are not billed. Never resubmit a task that was accepted, because each submission is billed separately.

Details: Seedance video generation API and Seedance API pricing explained.

Doubao Speech: text to speech and voice cloning

speech = client.audio.speech.create(
    model="seed-tts-2.0",
    voice="alloy",   # an OpenAI voice name picks the default voice for the text language
    input="Hello, welcome to Doubao text to speech.",
)
speech.write_to_file("hello.mp3")
  • seed-tts-2.0 takes up to 5,000 characters and outputs 24 kHz mono. You can also pass a Doubao voice ID such as en_female_dacey_uranus_bigtts.
  • seed-audio-1.0 builds audio with tone and sound effects from a scene description plus lines (up to 3,000 characters, 48 kHz stereo).
  • seed-icl-2.0 speaks in a voice you clone first with POST /v1/voice_clone.
  • Use only POST /v1/audio/speech. It returns the whole clip at once and does not stream.

The docs list official prices of ¥3 per 10,000 characters for seed-tts-2.0 and seed-icl-2.0, and ¥1 per minute of generated audio for seed-audio-1.0. They are charged from your USD balance after conversion. Cloning itself is currently free. See Text-to-speech API: Doubao Speech.

Pricing

Official list prices for every Doubao Seed, Seedream and Seedance model are on the pricing page. ByteDance publishes some of these prices in CNY, and HopBase converts them to USD and charges your USD balance. A few billing rules to plan around:

  • Doubao Seed Character and 2.0 Mini bill by input-length tier. Once a request's input, including cache hits, crosses a threshold, the whole request bills at that tier. The other five chat models have a single tier, and there is no peak/off-peak pricing.
  • Seedream bills per generated image, and Seedance bills per million video tokens.
  • Every billed non-streaming response and every finished task reports the exact USD charge in usage.cost_usd.

Related reading

FAQ

Can I use the Doubao API without a Chinese phone number or a Chinese company?

Yes. You sign up at api.hop-base.com with an email address or a Google or GitHub account. Billing is in USD, and you can pay by Visa / Mastercard, Apple Pay, Google Pay, Alipay, AlipayHK or WeChat Pay.

Is the Doubao API OpenAI-compatible on HopBase?

Yes. Doubao Seed chat works on Chat Completions and Responses at https://api.hop-base.com/v1, and on Anthropic Messages at https://api.hop-base.com. Seedream uses the OpenAI Images endpoints, and Doubao Speech uses the OpenAI speech endpoint. Seedance uses HopBase's video task API.

What is the difference between doubao-seedance-*-a and dreamina-seedance-* IDs?

They are the China and overseas IDs of the same Seedance families, served by two different groups. Overseas keys reach only dreamina-seedance-*. China keys reach doubao-seedance-*-a and also accept the overseas IDs as aliases. 4K exists only on overseas 2.0 Standard.

Why does doubao-seed-2-1-pro-260915 ignore tool_choice?

That model and doubao-seed-evolving choose tools on their own, even when you set none or name a function. Use doubao-seed-2-1-pro-260628 or doubao-seed-2-1-lite-260915 when you need to force or disable tool calls.

Can one key call Doubao and Claude or GPT?

Yes. Add the Doubao Seed Cloud group plus a Claude group and a GPT group to the same key (up to 10 groups). Claude uses the Anthropic SDK at https://api.hop-base.com, and GPT and Doubao use the OpenAI SDK at https://api.hop-base.com/v1.

How long do image and video links last?

Seedream image links and Seedance result links are valid for 24 hours. Download or copy them to your own storage.