DEV Community

Cover image for Get $175 Free Claude Code Credits
mjodeh
mjodeh

Posted on

Get $175 Free Claude Code Credits

Claude Code is extremely useful for software development, but heavy API usage can become expensive.

If you want to try Claude Code without immediately paying for Anthropic API usage, AgentRouter provides another option.

By registering through my referral link using your GitHub account, you can get $175 in free AgentRouter credits:

πŸ‘‰ Register with AgentRouter using GitHub and get $175 in free credits

You can use your AgentRouter balance with supported coding agents including Claude Code and Codex.

Disclosure: This is my referral link, so I may also receive referral benefits when you register through it.

What Is AgentRouter?

AgentRouter acts as an API gateway between coding agents and AI models.

Instead of Claude Code sending requests directly to Anthropic, you can configure it to send requests through AgentRouter:

Claude Code
     ↓
AgentRouter
     ↓
AI Model
Enter fullscreen mode Exit fullscreen mode

You create an AgentRouter account, generate an API token, and temporarily configure Claude Code to use AgentRouter.

The advantage of using temporary configuration is that it only affects the terminal session where you set it.

Close the terminal, and your normal Claude Code configuration remains unchanged.

Step 1: Register with Your GitHub Account and Get $175 in Free Credits

Open my referral link:

πŸ‘‰ https://agentrouter.org/register?aff=hZk2

When registering, sign up using your GitHub account.

This is important for the signup credit, so do not create the account using another sign-in method if you want to receive the promotional credits through the referral.

After registration, log in to AgentRouter and check your account balance.

You should receive $175 in free credits that can be used with supported tools such as Claude Code and Codex.

Step 2: Create an AgentRouter API Token

After logging in to AgentRouter, create an API token.

It should look similar to:

sk-xxxxxxxxxxxxxxxxxxxxxxxx
Enter fullscreen mode Exit fullscreen mode

Copy the token somewhere safe.

Do not commit it to Git or store it inside your source code.

You will use this token to temporarily configure Claude Code.

Step 3: Install Claude Code

If Claude Code is already installed, you can skip this step.

Otherwise, install it using npm:

npm install -g @anthropic-ai/claude-code
Enter fullscreen mode Exit fullscreen mode

Verify the installation:

claude --version
Enter fullscreen mode Exit fullscreen mode

Step 4: Configure Claude Code Temporarily on macOS or Linux

Open a terminal and run:

export ANTHROPIC_BASE_URL=https://agentrouter.org/
export ANTHROPIC_AUTH_TOKEN=sk-xxx
export ANTHROPIC_API_KEY=sk-xxx
Enter fullscreen mode Exit fullscreen mode

Replace:

sk-xxx
Enter fullscreen mode Exit fullscreen mode

with your actual AgentRouter API token.

Then navigate to your project:

cd my-project
Enter fullscreen mode Exit fullscreen mode

and start Claude Code:

claude
Enter fullscreen mode Exit fullscreen mode

Claude Code will now use AgentRouter for requests made from that terminal session.

The important part is that export only changes the environment of the current shell.

Once you close the terminal, these variables disappear.

Your normal Claude Code configuration is not permanently changed.

Step 5: Configure Claude Code Temporarily on Windows PowerShell

On Windows PowerShell, use:

$env:ANTHROPIC_BASE_URL="https://agentrouter.org/"
$env:ANTHROPIC_AUTH_TOKEN="sk-xxx"
$env:ANTHROPIC_API_KEY="sk-xxx"
Enter fullscreen mode Exit fullscreen mode

Replace:

sk-xxx
Enter fullscreen mode Exit fullscreen mode

with your AgentRouter API token.

Then navigate to your project:

cd my-project
Enter fullscreen mode Exit fullscreen mode

and start Claude Code:

claude
Enter fullscreen mode Exit fullscreen mode

That's it.

Claude Code will use AgentRouter for as long as this PowerShell session remains open.

If you close the PowerShell window, the environment variables disappear.

This means you don't have to modify your system-wide environment variables or permanently replace your existing Claude Code configuration.

Switching Back to Your Normal Claude Code Setup

Because the configuration is temporary, switching back is simple.

Just close the terminal where you configured AgentRouter.

Then open a new terminal and start Claude Code normally:

claude
Enter fullscreen mode Exit fullscreen mode

The new terminal will not contain the temporary AgentRouter environment variables.

This makes it easy to switch between:

Terminal 1
Claude Code β†’ AgentRouter

Terminal 2
Claude Code β†’ Your normal configuration
Enter fullscreen mode Exit fullscreen mode

without continuously changing system settings.

What About Codex?

AgentRouter also supports Codex.

I am not including the Codex configuration here because its setup is different from Claude Code and may change as Codex and AgentRouter evolve.

For the current Codex configuration, follow the AgentRouter documentation directly:

AgentRouter Documentation

The same AgentRouter credits can be used across supported tools, so the $175 signup credit is not limited to Claude Code.

A Security Consideration

AgentRouter is a third-party API gateway.

When you configure Claude Code this way, requests go through AgentRouter rather than directly to Anthropic.

That is important if you are working with:

  • proprietary company source code
  • customer information
  • credentials or secrets
  • confidential documents
  • security-sensitive projects

For those environments, review AgentRouter's privacy, security, and data-retention policies before routing sensitive information through the service.

For personal projects, experiments, and non-sensitive repositories, the free credits can be a convenient way to experiment with Claude Code.

Get $175 in Free AgentRouter Credits

If you want to try Claude Code or use AgentRouter with other supported coding agents such as Codex, you can start with the $175 free registration credit.

Register through my referral link using your GitHub account:

πŸ‘‰ Register with GitHub and get $175 in free AgentRouter credits

Then the process is simply:

Open the referral link
   ↓
Sign up with GitHub
   ↓
Get $175 in credits
   ↓
Create an AgentRouter API token
   ↓
Temporarily configure Claude Code
   ↓
Start coding
Enter fullscreen mode Exit fullscreen mode

For Claude Code, the temporary configuration is:

macOS / Linux

export ANTHROPIC_BASE_URL=https://agentrouter.org/
export ANTHROPIC_AUTH_TOKEN=sk-xxx
export ANTHROPIC_API_KEY=sk-xxx
claude
Enter fullscreen mode Exit fullscreen mode

Windows PowerShell

$env:ANTHROPIC_BASE_URL="https://agentrouter.org/"
$env:ANTHROPIC_AUTH_TOKEN="sk-xxx"
$env:ANTHROPIC_API_KEY="sk-xxx"
claude
Enter fullscreen mode Exit fullscreen mode

Close the terminal when you're finished, and your normal configuration remains untouched.

Top comments (0)