cd /news/developer-tools/claude-openrouter-deepseek-v4-flash · home topics developer-tools article
[ARTICLE · art-90213] src=gist.github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

claude-openrouter-deepseek-v4-flash

A developer has published a guide for configuring Anthropic's Claude Code CLI to route requests through OpenRouter, enabling the use of DeepSeek's v4 Flash model instead of Anthropic's default models. The setup involves installing Claude Code, setting environment variables for the OpenRouter API key and base URL, and optionally configuring sub-agents to use the same model. The guide includes verification steps to confirm requests are processed by the desired model via the OpenRouter Activity dashboard.

read1 min views11 publishedAug 7, 2026
npm install -g @anthropic-ai/claude-code
  • Create an OpenRouter account.
  • Generate an API key ( sk-or-v1-...

). - Add credits if you're using paid models.

Add the following environment variables to your ~/.zshrc

or ~/.bashrc

:

export OPENROUTER_API_KEY="sk-or-v1-..."

export ANTHROPIC_BASE_URL="https://openrouter.ai/api"
export ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY"
export ANTHROPIC_API_KEY=""

Restart your terminal after saving the changes.

export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek/deepseek-v4-flash"
export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek/deepseek-v4-flash"
export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek/deepseek-v4-flash"

(Optional) Configure Claude Code sub-agents to use the same model:

export CLAUDE_CODE_SUBAGENT_MODEL="deepseek/deepseek-v4-flash"

If you've previously logged into Claude Code using Anthropic, run:

/logout

Then restart Claude Code to avoid authentication conflicts.

Start Claude Code:

claude

Inside Claude Code, run:

/status

Verify that:

Anthropic Base URL ishttps://openrouter.ai/api

Auth Token isANTHROPIC_AUTH_TOKEN

Finally, send a prompt and open the OpenRouter Activity dashboard to confirm the request is being processed by:

deepseek/deepseek-v4-flash
── more in #developer-tools 4 stories · sorted by recency
── more on @anthropic 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-openrouter-de…] indexed:0 read:1min 2026-08-07 ·