Choose Auto, TokenLab Verified, or Official for each request, with prices shown up front. See what's new

ByteDance: Doubao-Seed-2.0-Code

ByteDance Seed coding model for multimodal software engineering and long-running agents
Compare models
doubao-seed-2.0-code
AvailableByteDanceChat
Input / Output
$0.4706 / $2.35
Context
229K
Max output
128K
Modalities
Chat
Capabilities
Tool usePrompt CacheReasoning

About Doubao-Seed-2.0-Code

Doubao-Seed-2.0-Code is the programming-focused member of ByteDance's Seed 2.0 family, built for software engineering and long-running coding agents. It sits beside the general Pro, Lite and Mini models and is the one ByteDance ties to its TRAE coding tool. It takes text only and supports tool calls, reasoning, prompt caching and structured JSON output.

Where it works well

  • Tuned for code generation, repair and multi-step engineering work rather than general chat, so it is the Seed 2.0 variant to try first for developer tooling.
  • Accepts tool definitions, which lets an agent loop run builds, tests and file edits through function calls.
  • Reasoning mode lets it plan a change before writing it, useful for bugs whose cause is not obvious from the stack trace.
  • Supports structured JSON output, handy when a pipeline needs patches or review comments in a fixed schema.
  • Prompt caching lets a long repository context or instruction block be reused across turns of an agent session.

When to choose another model

  • It takes text only, so screenshot-driven debugging or UI-mockup-to-code needs Seed 2.0 Pro or Lite instead.
  • It is specialised for programming; for open-ended writing, translation or analysis the general Seed 2.0 models are the better fit.

Getting started

  1. Create API key

    Create a key in Console, then use it with every model on the platform.

  2. Send your first request

    Copy the example for your language and run it against the endpoint.

    Text to textResponses API
    POST/v1/responses
    API format:
    curl https://api.tokenlab.sh/v1/responses \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer sk-xxx" \
      -d '{
        "model": "doubao-seed-2.0-code",
        "input": "Hello!"
      }'

Pricing

The Verified price applies to Verified, which costs less on most models. The Official price is the model maker's published price and applies to the more reliable Official route. Auto bills the route that completes the request.

Input tokens <= 32K · Text to text · Input token range · [0,32k]

per 1M tokens
Official price
Input $0.4706 / Output $2.35 / Cache read $0.0941 / Cache write $0.4706
Verified price
—
Discount
—

Input tokens <= 128K · Text to text · Input token range · (32k,128k]

per 1M tokens
Official price
Input $0.7059 / Output $3.53 / Cache read $0.1412 / Cache write $0.7059
Verified price
—
Discount
—

Input tokens <= 256K · Text to text · Input token range · (128k,256k]

per 1M tokens
Official price
Input $1.41 / Output $7.06 / Cache read $0.2824 / Cache write $1.41
Verified price
—
Discount
—
Prompt cache pricing

Cache read

Official price
$0.0941
Verified price
—
Discount
—

Cache write

Official price
$0.4706
Verified price
—
Discount
—

Usage & activity

Success rate is the share of requests that completed. Latency is how long a full response takes; P95 means 95% of requests finished within that time.

Usage & availability

Last 24 hours
Requests
Success rate
P95 latency
Total tokens
Model performance
Metrics appear once privacy and data volume thresholds are met.

Data is based on aggregate user requests, excluding status checks.

Open in Console

Open Doubao-Seed-2.0-Code in Console with a prompt ready to edit or send.

Help me try doubao-seed-2.0-code with a short message at /v1/responses. Show the reply, latency, and cost.

Use cases

Best for
  • Code
  • Reasoning
  • Repository-level bug fixing

    Give it a failing test and the relevant files, let it call a shell tool to rerun the suite, and iterate until the patch passes.

  • Code review bots

    Feed a diff and ask for risks, missing tests and style issues, returned as structured JSON that a CI step can post as comments.

  • Long-running coding agents

    Drive a multi-hour refactor or migration through repeated tool calls, with reasoning enabled for the planning turns.

  • Code explanation and porting

    Translate a module from one language to another and have it explain behavioural differences it had to preserve.

Prompt examples

This Python service leaks file handles under load. The module and the traceback are attached; find the leak and give me a minimal patch.

Port this Express request handler to FastAPI, keep the same validation behaviour, and list any places where semantics differ.

Review this diff for concurrency bugs and return JSON with file, line, severity and a one-sentence fix for each finding.

This model has conditional pricing. Monthly token totals alone cannot produce a reliable estimate; use the detailed pricing for the request specification, cache, and applicable time window.

FAQ

What exactly is Doubao-Seed-2.0-Code?

It is ByteDance's coding-specialised model in the Seed 2.0 family, aimed at software engineering tasks and long-running agents. ByteDance pairs it with TRAE, its coding tool. It works as a text model with tools, reasoning and JSON output.

How does Seed 2.0 Code differ from Seed 2.0 Pro?

Code is specialised for programming and takes text only, while Pro is the general flagship for long-chain reasoning and accepts images. Choose Code for developer agents; choose Pro when the task mixes code with diagrams, documents or screenshots.

Can Doubao-Seed-2.0-Code call tools?

Yes. It supports function and tool calling, so an agent can run tests, read files or query a repository and continue from the results. It also supports structured JSON responses against a schema.

Does it accept images?

No. It takes text only, so screenshots and UI mockups need Seed 2.0 Pro or Lite, which accept images. Send code, logs and written descriptions to this model instead.

Does it have a reasoning mode?

Yes. A thinking mode is available, which helps on bugs whose cause is not visible in the stack trace. Turn it on for planning and diagnosis turns, and leave it off for small edits where a direct answer is enough.

How much does Doubao-Seed-2.0-Code cost?

On TokenLab, Doubao-Seed-2.0-Code costs Input $0.4706 / Output $2.35 per 1M tokens. The pricing table above shows the full breakdown. Rates depend on the billing unit, specification, and usage. Compare matching conditions in the model's detailed pricing; a single rate does not determine the total cost.

What are the context window and output limit of Doubao-Seed-2.0-Code?

Doubao-Seed-2.0-Code accepts up to 229,376 tokens of context and returns up to 131,072 tokens in one response.

Which endpoint should Doubao-Seed-2.0-Code use?

Use https://api.tokenlab.sh/v1/responses for Doubao-Seed-2.0-Code. The request example below shows the matching code shape.

Which operations does Doubao-Seed-2.0-Code support?

Doubao-Seed-2.0-Code supports Text to text. Select an operation above to see its endpoint and request example.

Compare Doubao-Seed-2.0-Code

Sources

Reviewed Oct 2, 2026

More from Doubao

Related models