cd /news/developer-tools/a-step-by-step-guide-to-running-clau… · home topics developer-tools article
[ARTICLE · art-55466] src=gist.github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

A step-by-step guide to running Claude Code for free using AgentRouter and IAMHC APIs

A developer published a step-by-step guide to running Claude Code for free using alternative API endpoints from AgentRouter and IAMHC. The guide covers installation, configuration, and troubleshooting on multiple platforms, bypassing the need for a Claude Pro subscription or official Anthropic API keys.

read2 min views1 publishedJul 11, 2026

A comprehensive, step-by-step guide to installing, configuring, and running Claude Code on PC, Linux, macOS, and Termux using alternative API endpoints.

OverviewStep 1: Register an AccountStep 2: Install Claude CodeStep 3: ConfigurationStep 4: Running Claude CodeTroubleshooting & Version Pinning

Claude Code normally requires an active Claude Pro subscription or official Anthropic API keys. By routing requests through compatible third-party API proxy services, you can run Claude Code for free or at a significantly lower cost using alternative routing endpoints.

Feature Provider A: AgentRouter Provider B: IAMHC
Referral Link
Yes (

IAMHC Link)Featured Modelsclaude-opus-4-8

DeepSeek-V4-Pro

, glm-5.2

, Qwen3-Coder-Next-FP8

, etc.Free Balance / Quota****Base URLhttps://agentrouter.org

https://api.iamhc.cn/v1

  • Choose one of the providers from the list below and open the link: AgentRouter (with referral - Get +$50 USD bonus):https://bit.ly/3Tf0TJj** IAMHC (no referral):**https://api.iamhc.cn/

  • Sign up / Register an account using your GitHub account or Email.

  • Navigate to the API Key orToken menu. - Generate a new API Key and copy it.

Install Node.js on your system if you haven't already. Then run the appropriate command to install Claude Code:

It is recommended to use version 2.1.112

for optimal compatibility:

npm install -g @anthropic-ai/claude-code@2.1.112

You can install the latest version:

npm install -g @anthropic-ai/claude-code

Open the Claude Code settings file using a text editor (e.g., nano

):

nano ~/.claude/settings.json

Replace the contents of the file with one of the configuration templates below, depending on the provider you selected in Step 1.

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_BASE_URL": "https://agentrouter.org",
    "ANTHROPIC_MODEL": "claude-opus-4-8",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  },
  "permissions": {
    "allow": [],
    "deny": []
  },
  "skipWorkflowUsageWarning": true
}
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_BASE_URL": "https://api.iamhc.cn/v1",
    "ANTHROPIC_MODEL": "DeepSeek-V4-Pro",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  },
  "permissions": {
    "allow": [],
    "deny": []
  },
  "skipWorkflowUsageWarning": true
}

Important

  • Replace YOUR_API_KEY

with the API Key/Token you generated from the respective provider. Available models for Provider A (AgentRouter):claude-opus-4-8

(Default in template)claude-opus-4-7

claude-opus-4-6

glm-5.2

gpt-5.5

  • You can replace ANTHROPIC_MODEL

in Template A with any of the exact model IDs listed above.

Available models for Provider B (IAMHC):DeepSeek-V4-Pro

(Default in template)DeepSeek-V4-Flash

glm-5.2

glm-5.1

glm-4.7

Qwen3-Coder-Next-FP8

Kimi-K2.6

MiniMax-M3

MiniMax-M2.7

kat-coder-pro-v2

  • You can replace ANTHROPIC_MODEL

in Template B with any of the exact model IDs listed above.

  • Setting CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC

to"1"

helps reduce unnecessary network traffic and telemetry.

  • Press CTRL + X

to exit. - Press Y

to confirm changes. - Press ENTER

to save the file.

Simply run:

claude

If the configuration is correct, the Claude Code terminal interface will start up successfully!

If you recently updated Claude Code and encounter errors or compatibility issues with the custom API endpoints, revert/pin to the recommended version using:

npm install -g @anthropic-ai/claude-code@2.1.112

Double check that ANTHROPIC_BASE_URL

contains the correct protocol (https://

) and that your API key is correctly copied without leading or trailing spaces.

── more in #developer-tools 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/a-step-by-step-guide…] indexed:0 read:2min 2026-07-11 ·