munna4k
Elite member
Elite member
How to Use Claude Code Through a Free Gateway – Step-by-Step Guide
Hi everyone,
In this guide, I’m going to explain a method for using Claude Code through a third-party gateway with free credits.
Hidden Content
1. Create an Agent Router Account
First, open the Agent Router
Choose Sign Up and select Continue with GitHub.
One important point mentioned in the video is to use an older GitHub account rather than a newly created one.
2. Create an API Token
Once you are inside the Agent Router dashboard:
- Go to API Tokens.
- Click Create Token.
- Give the token any name, for example Test.
- Enable the Unlimited Quota option if it is available to you.
- Submit/create the token.
- Copy the API key that is generated.
3. Install Claude Code
Next, search for Claude Code by Anthropic – AI coding agent.
https://claude.com/product/claude-code
Download the official Claude Code desktop application for your operating system.
4. Enable Developer Mode
After opening the Claude application:
- Open Help.
- Go to Troubleshooting.
- Select Enable Developer Mode.
On Windows, the menu may appear under the three-line menu button.
After enabling Developer Mode, Claude will restart.
Once it opens again, you should see a Developer option in the menu.
5. Configure Third-Party Inference
Go to:
Developer → Configure Third-Party Inference
You should then get an option to configure a gateway connection.
For Credential Kind, select:
Static API Key
You will need three things:
- Gateway Base URL : https://agentrouter.org/
- API Key
- Authentication Scheme
6. Enter the Gateway Base URL
Return to your Agent Router dashboard.
Copy the Base URL shown in the dashboard.
Then return to Claude and paste that URL into the Gateway Base URL field.
7. Enter the API Key
Go back to Agent Router → API Tokens.
Copy the API token you created earlier.
Return to Claude and paste it into the API Key field.
8. Select the Authentication Scheme
For the authentication scheme, select:
Bearer
Then save/test the connection.
If everything is configured correctly, Claude should test the gateway connection and discover the available models.
9. Test the Connection
The gateway discovers two available models. Opus 4.8 and Opus 5
After the connection test succeeds:
Apply Changes → Save and Restart
Claude should restart.
Previously, the application showed the normal free-plan interface. After successfully configuring the gateway, the creator shows that Claude indicates that a gateway is being used.
10. Start Using Claude Code
Once the gateway is working, you can use Claude Code normally.
11. Check Usage
You can also check your usage from the Agent Router dashboard.
The dashboard provides information such as:
- Token consumption
- Model usage
- API calls
- Spending/consumption
12. Getting Additional Credits
You can receive additional credits by inviting friends through their referral link.
Hopefully this helps anyone who wants to experiment with Claude Code without immediately paying for a separate Claude subscription.
Hi everyone,
In this guide, I’m going to explain a method for using Claude Code through a third-party gateway with free credits.
Hidden Content
1. Create an Agent Router Account
First, open the Agent Router
Choose Sign Up and select Continue with GitHub.
One important point mentioned in the video is to use an older GitHub account rather than a newly created one.
2. Create an API Token
Once you are inside the Agent Router dashboard:
- Go to API Tokens.
- Click Create Token.
- Give the token any name, for example Test.
- Enable the Unlimited Quota option if it is available to you.
- Submit/create the token.
- Copy the API key that is generated.
3. Install Claude Code
Next, search for Claude Code by Anthropic – AI coding agent.
https://claude.com/product/claude-code
Download the official Claude Code desktop application for your operating system.
4. Enable Developer Mode
After opening the Claude application:
- Open Help.
- Go to Troubleshooting.
- Select Enable Developer Mode.
On Windows, the menu may appear under the three-line menu button.
After enabling Developer Mode, Claude will restart.
Once it opens again, you should see a Developer option in the menu.
5. Configure Third-Party Inference
Go to:
Developer → Configure Third-Party Inference
You should then get an option to configure a gateway connection.
For Credential Kind, select:
Static API Key
You will need three things:
- Gateway Base URL : https://agentrouter.org/
- API Key
- Authentication Scheme
6. Enter the Gateway Base URL
Return to your Agent Router dashboard.
Copy the Base URL shown in the dashboard.
Then return to Claude and paste that URL into the Gateway Base URL field.
7. Enter the API Key
Go back to Agent Router → API Tokens.
Copy the API token you created earlier.
Return to Claude and paste it into the API Key field.
8. Select the Authentication Scheme
For the authentication scheme, select:
Bearer
Then save/test the connection.
If everything is configured correctly, Claude should test the gateway connection and discover the available models.
9. Test the Connection
The gateway discovers two available models. Opus 4.8 and Opus 5
After the connection test succeeds:
Apply Changes → Save and Restart
Claude should restart.
Previously, the application showed the normal free-plan interface. After successfully configuring the gateway, the creator shows that Claude indicates that a gateway is being used.
10. Start Using Claude Code
Once the gateway is working, you can use Claude Code normally.
11. Check Usage
You can also check your usage from the Agent Router dashboard.
The dashboard provides information such as:
- Token consumption
- Model usage
- API calls
- Spending/consumption
12. Getting Additional Credits
You can receive additional credits by inviting friends through their referral link.
Hopefully this helps anyone who wants to experiment with Claude Code without immediately paying for a separate Claude subscription.