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. 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 is https://openrouter.ai/api Auth Token is ANTHROPIC AUTH TOKEN Finally, send a prompt and open the OpenRouter Activity dashboard to confirm the request is being processed by: deepseek/deepseek-v4-flash