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 oharness
export DEEPSEEK_API_KEY="..."
oharness -m deepseek/deepseek-v4-flash

oharness auth login deepseek stores the key instead of exporting it, and opens DeepSeek's key page for you.

Which model

Model idUse it forInput / cached / output ($/M)
deepseek-v4-flashMost agent work: reading, search, routine edits0.15 / 0.003 / 0.60
deepseek-v4-proSteps that need more reasoning0.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. /cost shows the running total.
  • When a step needs a different model, /model anthropic/claude-sonnet-5 switches without converting the conversation, and /model deepseek/deepseek-v4-flash switches 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 iddeepseek
Base URLhttps://api.deepseek.com/v1
ProtocolOpenAI-compatible chat completions
API keyDEEPSEEK_API_KEY
Model discoveryYes — 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 idContext / output$/M in / cached / outReasoning
deepseek-flash1M / 384K0.15 / 0.003 / 0.6Yes
deepseek-v4-flash1M / 384K0.15 / 0.003 / 0.6Yes
deepseek-v4-flash-vision-exp1M / 384K0.15 / 0.003 / 0.6Yes
deepseek-v4-pro1M / 384K0.435 / 0.0036 / 0.87Yes

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-flash

Pointing 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.

All 34 providers · Install OHarness