Use DeepSeek V4 in a coding agent
Set DEEPSEEK_API_KEY and run oharness -m deepseek/deepseek-v4-flash (or deepseek-v4-pro). Both models have a 1M-token context and tool calling, and V4 Flash costs $0.15 per million input tokens at list price.
Updated
Den här sidan är skriven på engelska. Termerna den förklarar är de som söks på engelska, och en översatt fackterm är en annan term.
The two models
| deepseek-v4-flash | deepseek-v4-pro | |
|---|---|---|
| Context / max output | 1M / 384K | 1M / 384K |
| Tool calling, reasoning | Yes, yes | Yes, yes |
| Input / cached / output ($/M) | 0.15 / 0.003 / 0.60 | 0.435 / 0.0036 / 0.87 |
Source: List prices in USD per million tokens, from the models.dev snapshot shipped with OHarness (fetched 2026-09-19). Vendors change prices; check theirs before relying on a number.
Set it up
npm install -g oharnessexport DEEPSEEK_API_KEY="..."oharness -m deepseek/deepseek-v4-flashOr oharness auth login deepseek to store the key instead of exporting it. Mid-session, /model deepseek/deepseek-v4-pro moves the conversation to Pro without converting anything, and /cost shows the spend.
Which one to use
Flash for the bulk of agent work — reading, searching, routine edits — where its cache-read price makes long sessions nearly free. Pro when a step needs more reasoning. Both bill reasoning tokens at the output price, so a long think on Pro is still cheap next to frontier models.
What we have not measured
How V4 compares with other models on agentic coding benchmarks in this harness. The leaderboard collects published scores; the fastest way to judge a model for your code is to switch to it on a real task in the same session.
Common questions
Can I use DeepSeek V4 as a Claude Code alternative?
Yes. OHarness runs the same agent architecture — loop, tools, permissions, MCP — on DeepSeek V4. Set DEEPSEEK_API_KEY and run oharness -m deepseek/deepseek-v4-flash.
What is the context window of DeepSeek V4?
One million tokens for both deepseek-v4-flash and deepseek-v4-pro, with up to 384K output tokens, according to the models.dev snapshot OHarness ships.
How much does DeepSeek V4 Flash cost for coding?
$0.15 per million input tokens, $0.003 per million cached input tokens and $0.60 per million output tokens at list price. A session of 3M input (mostly cached) and 60K output costs about $0.12.