Claude Code FREE
Use the official Claude Code CLI tool with alternative API endpoints. Fast, reliable, and completely free to start.
How to Use It
Install Claude Code CLI
First, you need to install the official Anthropic Claude Code package globally using npm. Make sure you have Node.js installed.
npm install -g @anthropic-ai/claude-code
Configure Environment
Set up the environment variables to point the CLI to the free gateway. Replace sk-YOUR_TOKEN with your actual token from AgentRouter.
export ANTHROPIC_BASE_URL="https://agentrouter.org/"
export ANTHROPIC_AUTH_TOKEN="sk-YOUR_TOKEN"
export ANTHROPIC_MODEL="claude-3-5-sonnet-20241022"
export CLAUDE_CODE_USE_AUTH_TOKEN="true"
Launch Claude
Navigate to your project directory and simply type claude. You're now ready to use Claude Code for free!
cd path/to/your-project
claude
IDE Extension / API Setup
VS Code Extension (API Method)
Instead of the terminal, you can use the Claude Code extension with your own API key for a seamless UI experience.
looks_one Install Extension
Search for "Claude Code" in the VS Code Marketplace and install the official extension by Anthropic.
looks_two Choose API Method
When prompted to sign in, select the "Use API Key" instead of signing into an Anthropic account.
looks_3 Configure Endpoint
In the extension settings, set and paste your API Token.
Cursor API Integration
Cursor allows you to use your own API keys. Here is how to connect it to the free gateway step-by-step.
settings Open AI Settings
Go to Cursor Settings > Models and find the Anthropicsection.
key Enter API Key
Toggle on Use your own API Key and paste your AgentRouter token into the Anthropic API key field.
link Base URL
Look for the Base URL set it Anthropic Base URL.
Alternative Providers
| Provider | Base URL | Free Tier |
|---|---|---|
| AgentRouter | https://agentrouter.org/ | YES |
| OpenRouter | https://openrouter.ai/api/v1 | YES |
| Official Anthropic | https://api.anthropic.com | NO |