Coding agent field guide

One API key.Your coding tools.

Connect Claude Code, Codex, and OpenCode to DeepSeek V4 with configurations verified against the production gateway. Pick your client, copy its native protocol setup, and start coding.

No SDK changes Streaming + tool use Usage-based billing
gateway / productionOnline
available
Claude
available
OpenCode
available
Codex
protocol coverage3 / 3 ready
/anthropic/v1/messages/api/chat/completions/v1/responses
01

Create a key

Generate a dedicated key in your dashboard.

02

Choose a protocol

Use Anthropic Messages, Chat Completions, or Responses.

03

Run a smoke test

Confirm connectivity before real project work.

02 / Choose your tool

Copy only what your client understands.

Each guide is pinned to a protocol we have verified. Readiness is part of the contract, not a marketing label.

Claude Code

Route Claude Code through MyDeepSeek with the gateway variables it already understands.

Ready now
EndpointPOST /anthropic/v1/messages
ConfigParent shell or ~/.claude/settings.json
AuthBearer API key
1

Install the client

terminal
npm install -g @anthropic-ai/claude-code
2

Add the gateway configuration

Parent shell or ~/.claude/settings.json
export ANTHROPIC_BASE_URL="https://mydeepseekapi.com/anthropic"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"

# Keep every Claude Code workload on the production-ready model.
export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-v4-flash"
export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4-flash"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4-flash"

claude
3

Verify before project work

smoke-test
curl https://mydeepseekapi.com/anthropic/v1/messages   -H "x-api-key: YOUR_API_KEY"   -H "anthropic-version: 2023-06-01"   -H "content-type: application/json"   -d '{"model":"deepseek-v4-flash","max_tokens":32,"messages":[{"role":"user","content":"Reply with: connected"}]}'

Operational notes

  • Use ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY, for gateway authentication.
  • Do not append /v1 to ANTHROPIC_BASE_URL; Claude Code adds /v1/messages.
  • Tool calls and streaming are supported. Image and document inputs are not.
Official client docs
03 / Keep it safe

A key belongs in your shell, not your repo.

Create a dedicated key for each machine or automation. Revoke it without disrupting the rest of your workflow.

Manage API keys

401 · Unauthorized

Check the key value and the exact authentication variable for your client.

404 · Wrong route

Claude uses /anthropic, OpenCode uses /api, and Codex uses /v1. Do not swap their base URLs.

402 · Low balance

Top up credits, then repeat the bounded smoke test before resuming.

Secret hygiene

Rotate any key that appeared in source control, logs, or screenshots.

Ready to connect

Start with a disposable key and one smoke test.

Once it passes, use the same client configuration for your real repository.