Use DeepSeek as a coding agent
Export DEEPSEEK_API_KEY and run oharness -m deepseek/deepseek-v4-flash. OHarness supplies the agent loop, tools, MCP and permissions; DeepSeek supplies the model at a fraction of frontier prices.
Three commands
npm install -g oharnessexport DEEPSEEK_API_KEY="..."oharness -m deepseek/deepseek-v4-flashoharness auth login deepseek stores the key instead of exporting it, and opens DeepSeek's key page for you.
Which model
| Model id | Use it for | Input / cached / output ($/M) |
|---|---|---|
deepseek-v4-flash | Most agent work: reading, search, routine edits | 0.15 / 0.003 / 0.60 |
deepseek-v4-pro | Steps that need more reasoning | 0.435 / 0.0036 / 0.87 |
Both have a 1M-token context and tool calling. Prices are list prices from the models.dev snapshot OHarness ships (2026-09-19). A typical hour-long session costs about $0.12 on Flash — the cost comparison shows the working.
Worth knowing
- Reasoning tokens are billed at the output price.
/costshows the running total. - When a step needs a different model,
/model anthropic/claude-sonnet-5switches without converting the conversation, and/model deepseek/deepseek-v4-flashswitches back. - The key only works on
api.deepseek.com. Third-party hosts of DeepSeek models (OpenRouter, SiliconFlow and others) are separate providers with their own keys.
Common questions
Can I use DeepSeek with a Claude Code-style agent?
Yes. OHarness runs the same kind of agent loop — tools, permissions, MCP, subagents — on DeepSeek. Set DEEPSEEK_API_KEY and run oharness -m deepseek/deepseek-v4-flash.
Is DeepSeek good for agentic coding?
DeepSeek V4 supports tool calling and a 1M-token context, which is what an agent needs, and its cached input price makes long sessions very cheap. Quality varies by task; switching to a stronger model for one step and back again is a single /model command in OHarness.
What is the DeepSeek API base URL?
https://api.deepseek.com/v1, OpenAI-compatible. OHarness has it built in as the deepseek provider, so nothing needs configuring beyond the key.
DeepSeek reference
| Provider id | deepseek |
| Base URL | https://api.deepseek.com/v1 |
| Protocol | OpenAI-compatible chat completions |
| API key | DEEPSEEK_API_KEY |
| Model discovery | Yes — the model list is asked of the endpoint rather than shipped. |
Connecting it
The endpoint above is built in, so there is nothing to configure. Put the key in the environment and the provider appears in the model picker:
export DEEPSEEK_API_KEY="..."Keys are issued by DeepSeek — where to get one.
Models on DeepSeek
The newest models DeepSeek serves that can call tools, from the models.dev snapshot OHarness ships. The harness also asks the endpoint for its live list, so a model released after this snapshot still appears in the picker.
| Model id | Context / output | $/M in / cached / out | Reasoning |
|---|---|---|---|
deepseek-flash | 1M / 384K | 0.15 / 0.003 / 0.6 | Yes |
deepseek-v4-flash | 1M / 384K | 0.15 / 0.003 / 0.6 | Yes |
deepseek-v4-flash-vision-exp | 1M / 384K | 0.15 / 0.003 / 0.6 | Yes |
deepseek-v4-pro | 1M / 384K | 0.435 / 0.0036 / 0.87 | Yes |
List prices in USD per million tokens, read from models.dev on 2026-09-19. DeepSeek changes its prices and models; its own pricing page is the authority. Start a session on the newest:
oharness -m deepseek/deepseek-flashPointing it somewhere else
A regional host, a gateway, or a server of your own. Overrides in ~/.oharness/config.json are field level, so changing the endpoint does not mean restating the rest of the provider — this is the whole block, shown holding the default so the shape is clear:
{
"providers": {
"deepseek": {
"baseUrl": "https://api.deepseek.com/v1"
}
}
}What you get either way
The same agent loop, the same tools, the same MCP servers and the same permission rules, whichever provider is underneath — and switching between them mid-session converts nothing, because history is never stored in a vendor’s shape. What an agent harness is covers why that is the hard part, and the providers reference covers the catalogue itself.