Home »
Docs » Claude Code API Proxy Setup & Best Practices
Claude Code API Proxy Setup & Best Practices
Claude Code is Anthropic's agentic CLI coding tool. TokenDos provides an Anthropic-compatible relay endpoint that enables low-cost, pay-per-token access to Claude 3.7 Sonnet, Claude Opus, and other frontier models without expensive subscriptions or complicated payment restrictions.
Why Use TokenDos with Claude Code?
- Up to 70% Cost Reduction: Pay only for actual tokens consumed, no subscription required.
- 100% Protocol Compatible: Full Anthropic Messages API compatibility including tool use and streaming.
- High Availability & Zero VPN: Fast global endpoint via
api.tokendos.com.
Setup Guide (3 Quick Steps)
Step 1: Get Your API Key
Sign up at TokenDos and generate an API key from the dashboard.
Step 2: Export Environment Variables
export ANTHROPIC_BASE_URL="https://api.tokendos.com/anthropic"
export ANTHROPIC_API_KEY="your-tokendos-api-key"
Step 3: Run Claude Code
claude
Troubleshooting
401 Unauthorized Error
Ensure your ANTHROPIC_BASE_URL is exactly https://api.tokendos.com/anthropic and your TokenDos balance is positive.