DeepSeek's Official Coding Agent Guide: Route Claude Code and OpenCode to V4 Models

DeepSeek published an official integration guide for Claude Code, OpenCode, and OpenClaw — revealing a per-tier model routing pattern that operators can apply across any Anthropic-compatible gateway.

TheRouter Newsroomисточник DeepSeek
DeepSeek V4 coding agent integration diagram showing Claude Code routing to deepseek-v4-pro and deepseek-v4-flash
Эта статья сейчас показывается на языке оригинала. Русская версия локализует навигацию и метаданные, но не переписывает содержание источника.

The moment a model provider publishes an official integration guide for three major coding agents at once, it signals more than a tutorial — it signals a routing strategy. DeepSeek's new Integrate with AI Tools guide covers Claude Code, OpenCode, and OpenClaw, and the configuration it ships reveals how the industry is thinking about per-tier model assignment inside agentic workflows.

What happened

DeepSeek published an official engineering guide showing how to swap Claude Code, OpenCode, and OpenClaw from their default Anthropic/OpenAI backends to DeepSeek V4 models. The guide is live in the DeepSeek API docs and appeared approximately one week ago.

The Claude Code section is the most instructive. DeepSeek maps every tier:

export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=<your DeepSeek API Key>
export ANTHROPIC_MODEL=deepseek-v4-pro[1m]
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-v4-pro[1m]
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-v4-pro[1m]
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-v4-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-v4-flash
export CLAUDE_CODE_EFFORT_LEVEL=max

Notice the asymmetry: Opus and Sonnet tiers both point to deepseek-v4-pro[1m] — the 1M-context extended variant — while Haiku and subagent slots use deepseek-v4-flash. This is deliberate. The pattern encodes a latency/cost split: heavy reasoning tasks stay on the capable model; lightweight subagent calls go to the cheaper, faster one.

For OpenCode, the setup is simpler: a /connect deepseek command in the terminal, then model selection. For OpenClaw, a guided onboard --install-daemon flow lets users select DeepSeek as the provider and choose between deepseek-v4-pro and deepseek-v4-flash.

Why it matters for AI engineering teams

This guide formalizes something that was previously tribal knowledge: Claude Code exposes a per-tier model routing surface via environment variables, and any Anthropic-compatible API endpoint — not just Anthropic's own — can plug into it.

For teams managing multi-agent workflows, this has direct operational implications:

  1. Provider substitution without code changes. Swapping the backend for Claude Code, OpenCode, or OpenClaw is now a documented, provider-endorsed pattern. This reduces the perceived risk of trying a new provider — the exit path is just unset the env vars.

  2. Tier-level cost control. By routing Haiku and subagent calls to deepseek-v4-flash while keeping Opus/Sonnet at deepseek-v4-pro, teams can cut subagent costs by 80–90% while preserving quality on top-level reasoning tasks. The same logic applies to any provider pairing you can reach through an Anthropic-compatible endpoint.

  3. The [1m] context modifier is a routing signal. The deepseek-v4-pro[1m] string tells DeepSeek's Anthropic-compatible endpoint to use the 1M-token context variant. That modifier pattern is provider-specific — a reminder that even when the API surface is compatible, per-provider behaviors require routing awareness.

  4. Agent tool trust and OpenClaw's coverage. DeepSeek's inclusion of OpenClaw alongside Claude Code and OpenCode is notable. OpenClaw is a personal AI assistant platform oriented toward Feishu and WeChat integration. Its appearance in DeepSeek's official docs reflects how Chinese AI infrastructure providers are building for the full agentic stack, not just API consumers.

The router/operator angle

The env-var routing pattern DeepSeek documents is portable — and it's a gateway routing problem in disguise. Instead of configuring env vars on each developer machine, a routing gateway can centralize the same tier mapping:

  • Route all claude-3-opus-* model IDs to deepseek-v4-pro[1m] for cost arbitrage.
  • Route claude-3-haiku-* or subagent model calls to deepseek-v4-flash.
  • Apply this via a gateway policy rather than per-developer env var configuration.

This matters for teams with more than a handful of developers using Claude Code. Managing env vars per machine is fragile; policy-level routing at the gateway boundary is auditable, reversible, and doesn't require redeployment when you want to switch providers.

Decision framework for operators considering this pattern:

| Signal | Action | |---|---| | Anthropic API costs are 30%+ of your AI budget | Evaluate DeepSeek V4 routing for Haiku-tier calls first | | Subagent tasks are majority of your token volume | Route CLAUDE_CODE_SUBAGENT_MODEL to a flash-tier model | | Teams need reproducible provider config | Centralize at gateway, not per-developer env | | You need 1M-context for agentic document tasks | Verify [1m] modifier availability via your gateway or direct API | | You rely on specific Anthropic features (prompt caching, extended thinking) | Verify feature parity before full cutover |

The key risk is capability gap. The env var approach is simple; the assumption is that V4 Pro is a drop-in for Opus/Sonnet quality. For most coding tasks that assumption holds well, but teams with heavy use of Anthropic-specific features — extended thinking, computer use, MCP native integration — should test thoroughly before routing all tiers.

What TheRouter users should watch or try

If you're running Claude Code through a routing gateway, the tier-mapping pattern documented here is exactly the routing policy shape you should configure at the gateway level. Rather than relying on per-developer env var files, define a model alias map that intercepts Claude Code's model requests and redirects them to your preferred provider per tier.

Teams using a gateway that supports Anthropic-compatible routing can apply this pattern today: map the Anthropic model namespace to your preferred providers per tier, and handle the [1m] context modifier in your provider config. This gives you centralized cost accounting, audit logs per tier, and easy rollback when a provider has an outage — without changing each developer's local config.

Watch DeepSeek's API docs for further updates to their Anthropic-compatible endpoint capabilities, particularly around prompt caching support (not yet documented) and computer-use tool compatibility, which would affect agentic workflows that rely on those features.

Похожие материалы

Новости AI
Поддержка