Is there a way to do this directly by using claudecode CLI (which I already have installed) and openrouter??
Here's a oneliner:
ANTHROPIC_BASE_URL="https://openrouter.ai/api" ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY" ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek/deepseek-v4-flash" CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 claudeYes, from Claude Code themselves: https://code.claude.com/docs/en/llm-gateway
This repo's README explains how it works and you can do it yourself. claude looks for environment variables that say which API endpoint to talk to, which key to pass, which model name to use for haiku/sonnet/opus-level workloads, etc.
Yes, Deepseek even documents how:
https://api-docs.deepseek.com/quick_start/agent_integrations...