# ByteDance: Doubao Seed 2.0 Code Preview

Doubao Seed 2.0 Code Preview is a language model from ByteDance, tuned for writing and editing code.

- **Model id:** `opencheap/doubao-seed-2.0-code-preview`
- **Price per 1M tokens:** $0.48 input / $2.41 output
- **Cached input:** $0.096 per 1M tokens
- **Context:** 256K tokens, 128K max output

## Providers

2 providers. Prices are per 1M tokens. As of 2026-12-04 12:06 UTC.

| Provider | Input price | Cache price | Output price | Context | Max output |
| --- | --- | --- | --- | --- | --- |
| AiHubMix · quantization unknown · Snapshot not stated | $0.48 | $0.096 | $2.41 | 256K | 128K |
| NanoGPT · quantization unknown · Snapshot not stated | $0.78 | $0.39 | $3.89 | 256K | 128K |

A request picks by price (`:floor`) or by speed (`provider.sort`, `:nitro`), or sets a floor on tokens per second. [How routing works](https://docs.opencheap.si/speed)

### Supported parameters

The parameters each provider supports on this model, from its published list and our own tests of whether answers show the parameter taking effect. A test is a snapshot, not a guarantee; `provider.require_parameters` sends a request only to providers that support every parameter it sets. [Required parameters](https://docs.opencheap.si/speed#require-parameters)

- **AiHubMix:** `temperature`, `top_p`, `top_k`, `seed`, `logit_bias`, `presence_penalty`, `stop`, `response_format`, `structured_outputs`, `tools`, `tool_choice`
- **NanoGPT:** `temperature`, `top_p`, `seed`, `logit_bias`, `presence_penalty`, `stop`, `response_format` (tools not confirmed)

## Price history

Each provider's price over the last 24 hours, 7 days and 30 days is charted on [the page](https://opencheap.si/models/doubao-seed-2.0-code-preview#price-history).

## API

Point the OpenAI SDK at OpenCheap and pass the model id `opencheap/doubao-seed-2.0-code-preview`; the rest of your code stays the same.

```bash
curl https://api.opencheap.si/v1/chat/completions \
  -H "Authorization: Bearer $OPENCHEAP_API_KEY" -H "Content-Type: application/json" \
  -d '{ "model": "opencheap/doubao-seed-2.0-code-preview", "messages": [{ "role": "user", "content": "Hi" }] }'
```

```python
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.opencheap.si/v1", api_key=os.environ["OPENCHEAP_API_KEY"])
r = client.chat.completions.create(model="opencheap/doubao-seed-2.0-code-preview",
    messages=[{"role": "user", "content": "Hi"}])
print(r.choices[0].message.content)
```

```javascript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.opencheap.si/v1", apiKey: process.env.OPENCHEAP_API_KEY });
const r = await client.chat.completions.create({ model: "opencheap/doubao-seed-2.0-code-preview",
  messages: [{ role: "user", content: "Hi" }] });
console.log(r.choices[0].message.content);
```

## About Doubao Seed 2.0 Code Preview

Doubao Seed 2.0 Code Preview costs from $0.48 per 1M input tokens and $2.41 per 1M output tokens on OpenCheap, with cached input at $0.096 per 1M tokens. It has no public list price to compare with. At that price, a request with 10,000 input tokens and 1,000 output tokens costs about $0.0072, and 1,000 such requests about $7.23. Prices as of 2026-12-04 12:01 UTC.

2 providers serve Doubao Seed 2.0 Code Preview on OpenCheap. Each request goes to the cheapest healthy provider of the model, and every answer reports what it cost in `usage.cost`. Its context window is 256K tokens (256,000), room for roughly 190,000 words of English in one request.

Doubao Seed 2.0 Code Preview is one of [24 ByteDance models](https://opencheap.si/models/lab/bytedance) on OpenCheap. Every model on OpenCheap is called with one key at the same OpenAI-compatible endpoint, `https://api.opencheap.si/v1`.

## Pricing questions

### How much does the Doubao Seed 2.0 Code Preview API cost per 1M tokens?

Doubao Seed 2.0 Code Preview costs from $0.48 per 1M input tokens and $2.41 per 1M output tokens on OpenCheap, with cached input at $0.096 per 1M tokens. Prices as of 2026-12-04 12:01 UTC.

### What does one Doubao Seed 2.0 Code Preview request cost?

A request with 10,000 input tokens and 1,000 output tokens costs about $0.0072, and 1,000 such requests about $7.23. Every answer reports its own cost in usage.cost.

### Which providers serve Doubao Seed 2.0 Code Preview?

2 providers serve Doubao Seed 2.0 Code Preview on OpenCheap. Each request goes to the cheapest healthy provider of the model; the table on this page lists every provider with its price, speed and uptime.

### What is the context window of Doubao Seed 2.0 Code Preview?

Its context window is 256K tokens (256,000), room for roughly 190,000 words of English in one request.

### How do I call the Doubao Seed 2.0 Code Preview API?

Point the OpenAI SDK at https://api.opencheap.si/v1 and pass the model id opencheap/doubao-seed-2.0-code-preview. One OpenCheap key works for every model; the rest of your code stays the same.

## More from ByteDance

- [Doubao Seed 1.6](https://opencheap.si/models/doubao-seed-1.6) (`doubao-seed-1.6`): $0.11 / $1.10 per 1M · 256K context
- [Doubao Seed 1.6 Flash](https://opencheap.si/models/doubao-seed-1.6-flash) (`doubao-seed-1.6-flash`): $0.021 / $0.21 per 1M · 256K context
- [Doubao Seed 1.6 Lite](https://opencheap.si/models/doubao-seed-1.6-lite) (`doubao-seed-1.6-lite`): $0.041 / $0.33 per 1M · 256K context
- [Doubao Seed 1.6 Thinking](https://opencheap.si/models/doubao-seed-1.6-thinking) (`doubao-seed-1.6-thinking`): $0.11 / $1.10 per 1M · 256K context
- [doubao-seed-2.0-code-preview-260215](https://opencheap.si/models/doubao-seed-2.0-code-preview-260215) (`doubao-seed-2.0-code-preview-260215`): $0.82 / $4.08 per 1M · 127K context
- [Doubao Seed 2.0 Lite](https://opencheap.si/models/doubao-seed-2.0-lite-260215) (`doubao-seed-2.0-lite-260215`): $0.25 / $2.00 per 1M · 256K context
- [Doubao Seed 2.0 Lite 260428](https://opencheap.si/models/doubao-seed-2.0-lite-260428) (`doubao-seed-2.0-lite-260428`): $0.09 / $0.54 per 1M · 256K context
- [Doubao Seed 2.0 Mini](https://opencheap.si/models/doubao-seed-2.0-mini-260215) (`doubao-seed-2.0-mini-260215`): $0.10 / $0.48 per 1M · 256K context

[All 24 ByteDance models](https://opencheap.si/models/lab/bytedance)

## Similar models

- [Grok Code Fast 1](https://opencheap.si/models/grok-code-fast-1): xAI · 256K context · $1.00 / $2.00 per 1M, 9 % cheaper · [Compare with Doubao Seed 2.0 Code Preview](https://opencheap.si/compare/doubao-seed-2.0-code-preview-vs-grok-code-fast-1)
- [Kimi K2.7 Code](https://opencheap.si/models/kimi-k2.7-code): Moonshot · 262K context · $0.24 / $1.05 per 1M, 56 % cheaper · [Compare with Doubao Seed 2.0 Code Preview](https://opencheap.si/compare/doubao-seed-2.0-code-preview-vs-kimi-k2.7-code)
- [Qwen 3 Coder 480B Turbo](https://opencheap.si/models/qwen3-coder-turbo): Qwen · 256K context · $0.42 / $1.80 per 1M, 25 % cheaper · [Compare with Doubao Seed 2.0 Code Preview](https://opencheap.si/compare/doubao-seed-2.0-code-preview-vs-qwen3-coder-turbo)
- [Qwen3 Coder Plus](https://opencheap.si/models/qwen3-coder-plus): Qwen · 1M context · $0.55 / $2.19 per 1M, 8 % cheaper · [Compare with Doubao Seed 2.0 Code Preview](https://opencheap.si/compare/doubao-seed-2.0-code-preview-vs-qwen3-coder-plus)
- [GPT-5.3-Codex](https://opencheap.si/models/gpt-5.3-codex): OpenAI · 400K context · $0.70 / $5.60 per 1M · [Compare with Doubao Seed 2.0 Code Preview](https://opencheap.si/compare/doubao-seed-2.0-code-preview-vs-gpt-5.3-codex)
- [Kimi K2.6](https://opencheap.si/models/kimi-k2.6): Moonshot · 262K context · $0.32 / $1.57 per 1M, 35 % cheaper · [Compare with Doubao Seed 2.0 Code Preview](https://opencheap.si/compare/doubao-seed-2.0-code-preview-vs-kimi-k2.6)

[Compare Doubao Seed 2.0 Code Preview with any model](https://opencheap.si/compare)

---

Source: https://opencheap.si/models/doubao-seed-2.0-code-preview · All models: https://opencheap.si/models · Prices as JSON: https://api.opencheap.si/v1/prices · Index for agents: https://opencheap.si/llms.txt
