How do I use DeepSeek in OpenCode?
Add deepseek/deepseek-v4.1-flash under a standardcompute provider in opencode.json (base URL https://api.stdcmpt.com/v1) and set it as the model: OpenCode then runs on DeepSeek V4.1 Flash on a plan from $19 a month, and new requests get HTTP 402 when the plan's compute budget reaches 100%. Put deepseek/deepseek-v4-pro on the plan agent and Tab moves a planning step to it.
{
"$schema": "https://opencode.ai/config.json",
"model": "standardcompute/deepseek/deepseek-v4.1-flash",
"small_model": "standardcompute/deepseek/deepseek-v4.1-flash",
"agent": {
"plan": { "model": "standardcompute/deepseek/deepseek-v4-pro" }
},
"provider": {
"standardcompute": {
"npm": "@ai-sdk/openai-compatible",
"name": "Standard Compute",
"options": {
"baseURL": "https://api.stdcmpt.com/v1",
"apiKey": "{env:STANDARDCOMPUTE_API_KEY}"
},
"models": {
"deepseek/deepseek-v4.1-flash": {
"name": "DeepSeek V4.1 Flash",
"reasoning": true,
"attachment": true,
"modalities": { "input": ["text", "image"], "output": ["text"] },
"limit": { "context": 400000, "output": 32000 }
},
"deepseek/deepseek-v4-pro": {
"name": "DeepSeek V4 Pro",
"reasoning": true,
"limit": { "context": 400000, "output": 32000 }
}
}
}
}
}
Global config lives at ~/.config/opencode/opencode.json, project config in opencode.json at the repo root; merge rather than replace. limit.context is set to 400,000 so OpenCode compacts before turns get costly; the endpoint accepts up to about 850,000.
Build on Flash, plan on V4 Pro
OpenCode lets each agent carry its own model. The config gives the build agent V4.1 Flash and the plan agent V4 Pro, which costs about 5 times as much per day at DeepSeek's peak price. Planning turns are few and short, so the split keeps most tokens on Flash.
What works with DeepSeek in OpenCode
| OpenCode feature | On DeepSeek through Standard Compute |
|---|---|
| Screenshots | V4.1 Flash reads them once the model has attachment and image modalities. V4 Pro is text-only and answers an image with HTTP 400 |
| Reasoning variants | With reasoning set to true, OpenCode offers low, medium, high and max for DeepSeek V4 IDs and sends the level as reasoning_effort, which overrides the Models page setting |
| Compaction | Starts as the session nears limit.context. Leave the limit out and OpenCode waits for an overflow error instead |
| Session titles | Go to small_model. Without it, OpenCode tries a cheaper model from the same provider, then falls back to the main one |
From OpenCode's config, agents and providers docs and its v1.19.0 source, checked October 14, 2026.
What a day of DeepSeek costs
| Per day | V4.1 Flash, peak | V4.1 Flash, off-peak | V4 Pro, peak |
|---|---|---|---|
| Typical day | $0.42 | $0.21 | $1.94 |
| Busy day | $4.31 | $2.16 | $20 |
DeepSeek list prices per million tokens: V4.1 Flash $0.30 input, $0.006 cache hit, $1.20 output at peak, half off-peak; V4 Pro $1.32, $0.044, $3.96 at peak. Source. A typical day is 8.5M tokens and a busy one 86.7M, 87.2% of input as cache reads: the median and 90th-percentile coding-agent day in our Agent Burn Index, measured on OpenCode, Cline, Kilo and similar agents, September 13 to October 12, 2026. Priced at the list rates above; your own days will differ.
The catch
Two cheaper routes exist inside OpenCode. OpenCode Go ($10 a month) includes DeepSeek V4.1 Flash with an $80 monthly usage limit at OpenCode's prices, plus V4 Pro, with 5-hour and weekly windows at 20% and 50% of it. And OpenCode's built-in DeepSeek provider takes a DeepSeek key (DEEPSEEK_API_KEY, model deepseek/deepseek-flash) at the prices above. Off-peak hours halve DeepSeek's own price on both.
Where Standard Compute fits
One key for DeepSeek and the models Go leaves out, such as Claude Sonnet 5.5 and GPT-5.6 Sol, with no 5-hour or weekly windows. At peak list price the Starter plan's $20 compute budget covers about 47 typical V4.1 Flash days.
FAQ
Why doesn't /connect show DeepSeek V4.1 Flash under Standard Compute?
The Standard Compute entry in models.dev, which OpenCode reads, lists only the routed standardcompute model. Exact model IDs need the models block in opencode.json; OpenCode merges it into the same provider and keeps a key stored with /connect.
Is deepseek/deepseek-v4.1-flash the same model as deepseek/deepseek-flash?
Same model, different providers. deepseek/deepseek-flash is OpenCode's built-in DeepSeek provider on your DeepSeek key; standardcompute/deepseek/deepseek-v4.1-flash is the same model on a Standard Compute key.
Do I need to set interleaved for DeepSeek's reasoning?
No. For a hand-added model whose ID contains deepseek, OpenCode fills in DeepSeek's reasoning_content handling by itself.