Integration with Claude Code
Learn how to use Anthropic's Claude Code CLI with DZRouter for deep open-source model support, organizational budget controls, and billing in Algerian Dinar (DZD).
Why Use DZRouter with Claude Code?
Claude Code is an exceptionally powerful terminal-based coding assistant crafted by Anthropic. However, natively it only supports Anthropic models and requires international cards. By routing it through DZRouter, you unlock a massive new ecosystem.
Open-Source Models
Why limit yourself? Run Qwen Coder, DeepSeek V3, or MiniMax inside Claude Code using DZRouter's OpenAI-compatible proxy.
Local Billing & Budgets
Pay for your Claude Code sessions dynamically in DZD using your Edahabia card. Track your costs easily via the DZRouter Dashboard.
Failover Router
Keep your coding sessions uninterrupted. If a provider API goes down, DZRouter seamlessly routes your request to a healthy node.
Quick Start
1Install Claude Code
If you haven't already installed Claude Code on your machine, install it natively via npm:
npm install -g @anthropic-ai/claude-code2Connect Claude to DZRouter
Instead of logging in with Anthropic directly, you can masquerade DZRouter as the provider. To configure this integration, you must export environment variables forcing Claude Code to connect to our gateway.
~/.zshrc or ~/.bashrc# Add these lines to your shell profile export DZROUTER_API_KEY="dzr-your-api-key" export ANTHROPIC_BASE_URL="https://api.dzrouter.tech/v1" export ANTHROPIC_AUTH_TOKEN="$DZROUTER_API_KEY" # Important: Must be explicitly empty so Claude doesn't fight the custom URL export ANTHROPIC_API_KEY=""Note: If you were previously logged into Claude Code natively, runclaude logoutto clear your cached credentials before the DZRouter parameters will securely route your traffic.3Select Your Model
Claude Code allows you to swap its default backbone. Because DZRouter handles translating the Anthropic SDK dialect into standard OpenAI format, you can specify any open-source or proprietary identifier we provide.
# For Claude 4.6 (Routed through DZRouter enterprise keys) export ANTHROPIC_DEFAULT_OPUS_MODEL="anthropic/claude-opus-4.6" # Or inject Qwen Coder Next for extreme coding efficiency export ANTHROPIC_DEFAULT_OPUS_MODEL="openrouter/qwen/qwen3-coder:free" # Or use Google Gemini export ANTHROPIC_DEFAULT_OPUS_MODEL="gemini/gemini-3.1-pro-preview"4Start Your Session
Navigate to your project directory and start the CLI. You are now securely hooked into the DZRouter ecosystem!
Terminal$ cd /path/to/your/project $ claude
How It Works Technically
- Direct Connection: When you set
ANTHROPIC_BASE_URLtohttps://api.dzrouter.tech/v1, Claude Code attempts to speak its native Anthropic SDK protocol to us. - Anthropic Skin: DZRouter's LiteLLM core acts as an "Anthropic Skin." It translates the incoming Anthropic-formatted payload, maps it to whatever model you requested, handles tool calling execution, and dynamically streams the response back acting as if it were Anthropic.
- Billing: Your local DZD balance via Edahabia drops proportionally based strictly on the model generation, accurately logged under your DZRouter Dashboard.
Ready to harness local AI?
Grab your DZRouter API key today and turn every terminal into a fully autonomous, cost-governed coding agent.
Open Dashboard to Generate Key