{"slug": "free-claude-opus-4-x-5-using-agentrouter", "title": "Free Claude Opus (4.x & 5) using AgentRouter", "summary": "A developer has published a guide to using Claude Opus models (4.x and 5) with AI coding tools like Claude Code, Cursor, Cline, and Claude Desktop by routing them through AgentRouter, a third-party API gateway offering promotional free credits. The guide details registration, claiming daily check-in credits, and configuring base URLs for different tools, while cautioning that AgentRouter is unofficial and not affiliated with Anthropic.", "body_md": "A short, copy-paste guide to using **Claude Opus** models with **Claude Code**, **Cursor**, **Cline**, and **Claude Desktop** by pointing them at [AgentRouter](https://agentrouter.org) — a third-party API gateway that currently provides promotional/free credits for AI-coding tools.\n\n📚 Cross‑checked against AgentRouter's official docs: [https://agentrouter.org/docs/index.html](https://agentrouter.org/docs/index.html)\n\n⚠️ **Heads up (read this):** AgentRouter is an **unofficial, third‑party** gateway. It is **not** Anthropic and is not affiliated with Anthropic. Free-credit promotions, eligibility, model names, limits, and uptime **can change often** and may disappear or change without notice. Great for experimenting and learning — **don't** push private, proprietary, or client code / secrets through it, and use the official [Anthropic API](https://console.anthropic.com) or a Claude subscription for anything production or confidential. See [Good to know](#good-to-know--honest-caveats).\n\n👉 **Sign up here:** [https://agentrouter.org/register?aff=kgU5](https://agentrouter.org/register?aff=kgU5)\n\nIf AgentRouter's referral program is active and you are eligible, registering through a referral link may give **both you and the referrer bonus credits**. Using the link above supports the person who shared this guide.\n\n1. **Register:**[https://agentrouter.org/register?aff=kgU5](https://agentrouter.org/register?aff=kgU5)\n2. **Claim promotional credit:** if your account is eligible, complete the daily**check-in** . At the time of writing, AgentRouter shows a**+$25 check-in credit** . You may need to**log out and back in** for the balance to update.\n3. **Create an API key:**[https://agentrouter.org/console/token](https://agentrouter.org/console/token)\n4. **Point your tool at AgentRouter:**  - Claude Code / Cline (Anthropic mode) → Base URL `https://agentrouter.org`*(no `/v1`)*\n  - Cursor / Cline (OpenAI mode) → Base URL `https://agentrouter.org/v1`*(with `/v1`)*\n5. Claude Code / Cline (Anthropic mode) → Base URL \n6. **Pick a model:**`claude-opus-4-8` (or`claude-opus-5` ).\n7. Ask it to *\"reply with only OK\"* to confirm it works. 🎉\n\nAgentRouter is a free API gateway that exposes popular large models behind **Anthropic‑compatible** and **OpenAI‑compatible** endpoints, so tools that already speak those protocols (Claude Code, Cursor, Cline, Codex, Roo Code, and more) can use it with zero code changes. You can receive promotional credits through mechanisms such as daily check-ins and referrals. Availability of credits, top-up options, and program rules are controlled by AgentRouter and may change.\n\nAt the time of writing, the following **Opus** models are available through AgentRouter's promotional/free-credit offering:\n\n| Model ID | Notes | \n|---|---|\n| `claude-opus-4-8` | Recommended default, very capable | \n| `claude-opus-5` | Newest Opus | \n\nIt also serves other free models such as `glm-5.3`, `deepseek-v4-flash`, and `gpt-5.6-sol`.\n\n🔁 **Model IDs change over time.** New Opus versions ship and old IDs get retired. AgentRouter's own per‑tool docs sometimes lag (they may still mention `claude-opus-4-5`, `claude-opus-4-6`, or `claude-opus-4-7`). **Always treat the model list in your console as the source of truth:** open [https://agentrouter.org/console](https://agentrouter.org/console) and use whatever Opus IDs are live. If a model ID errors out, it was probably renamed — swap in the current one.\n\n1. Go to **[https://agentrouter.org/register?aff=kgU5](https://agentrouter.org/register?aff=kgU5)** .\n2. Sign in with **GitHub** (or LinkDo). Email verification is not required.\n\n🇨🇳 Can't reach the site (e.g. mainland China)? Use the official backup domain **[https://ps.air-outer.com](https://ps.air-outer.com)** — it mirrors both the site and the API and works identically. Everywhere this guide says `agentrouter.org`, you can substitute `ps.air-outer.com`.\n\n- **Daily check‑in:** click the check‑in / sign‑in button in the console for**+$25 credit** . You must**log out and log back in** for the credit to show up.\n- **Referrals:** share your own referral link (find it in the console) — you and each new user both get bonus credit.\n\n💡 If your balance shows **$0** right after claiming, it's usually just a display glitch — wait a moment and refresh.\n\n1. Open the token page: **[https://agentrouter.org/console/token](https://agentrouter.org/console/token)**\n2. Create a new token\n  - Click on **create token**\n  - Provide a name for example **claude_token**\n  - Enable **Unlimited quota**\n  - Click on **submit**\n3. Click on \n4. Copy the **Key** (looks like`sk-...` ). Treat it like a password.\n\nYou'll paste this key into whichever tool you use below.\n\n**The one thing to get right:** the base URL depends on which protocol the tool speaks.\n\nProtocol Base URL Used by Anthropic‑compatible `https://agentrouter.org` Claude Code, Cline (Anthropic provider) OpenAI‑compatible `https://agentrouter.org/v1` Cursor, Cline (OpenAI Compatible provider) ❗ For the Anthropic endpoint, **do not add `/v1`**. Mixing these up is the #1 cause of errors.\n\nClaude Code uses the **Anthropic‑compatible** config.\n\n**1. Make sure you have Node.js 18+**\n\n```\nnode --version\n```\n\n**2. Install Claude Code**\n\n```\nnpm install -g @anthropic-ai/claude-code@latest\n```\n\n**3. Verify the install**\n\n```\nclaude --version\n```\n\n**4. Set the AgentRouter environment variables**\n\nmacOS / Linux:\n\n```\nexport ANTHROPIC_AUTH_TOKEN=\"YOUR_AGENTROUTER_API_KEY\"\nexport ANTHROPIC_BASE_URL=\"https://agentrouter.org\"\nexport ANTHROPIC_MODEL=\"claude-opus-4-8\"   # or: claude-opus-5\n```\n\nWindows (PowerShell):\n\n```\n$env:ANTHROPIC_AUTH_TOKEN=\"YOUR_AGENTROUTER_API_KEY\"\n$env:ANTHROPIC_BASE_URL=\"https://agentrouter.org\"\n$env:ANTHROPIC_MODEL=\"claude-opus-4-8\"   # or: claude-opus-5\n```\n\nTo make it stick across terminal sessions, add the three `export` lines to your `~/.zshrc` or `~/.bashrc` (macOS/Linux), or on Windows run `setx ANTHROPIC_BASE_URL \"https://agentrouter.org\"` (and the others) once, then reopen the terminal.\n\n**5. Launch and test**\n\n```\nclaude\n# then type:  reply with only OK\n# then try:   list the files in this folder and tell me if a README exists — don't modify anything\n```\n\nIf it replies `OK`, you're connected. If the first launch asks whether to use the API key from your environment, confirm **yes**.\n\n⚠️ **Already logged into Claude Pro / Max / Team?** These environment variables **override** your subscription login. To go back to your subscription, unset them and restart:\n\n```\nunset ANTHROPIC_AUTH_TOKEN ANTHROPIC_BASE_URL ANTHROPIC_MODEL\nclaude\n```\n\nCursor talks to the **OpenAI‑compatible** endpoint.\n\n1. Download, install, and **log in** to Cursor (model settings are locked until you sign in).\n2. Go to **Cursor Settings → Models** .\n3. Under **OpenAI API Key** , paste your AgentRouter API key and enable the toggle.\n4. Enable **Override OpenAI Base URL** and set it to`https://agentrouter.org/v1` .\n5. Test by sending *\"reply with only OK\"* in chat.\n\n⚠️ **Cursor limitation:** on Cursor's free tier, a custom third‑party API often can't pick a specific model — you may be stuck in **Auto** mode. If you specifically want to choose Opus, **Claude Code or Cline give you far more control.**\n\nCline supports **both** protocols. For Claude Opus, use the **Anthropic** path.\n\n1. In VS Code, open **Extensions** , search**Cline** , and install it.\n2. Get your API key from [https://agentrouter.org/console/token](https://agentrouter.org/console/token) .\n3. Open the Cline panel → **Settings / API Configuration** .\n\n**For Claude Opus (recommended):**\n\n- **API Provider:**`Anthropic`\n- Check **Use custom base URL**\n- **Custom Base URL:**`https://agentrouter.org` ←*no `/v1`*\n- **API Key:** your AgentRouter key\n- **Model:**`claude-opus-4-8` (or`claude-opus-5` )\n- Save, then send *\"reply with only OK\"* to test.\n\n**For OpenAI‑style models (e.g. `gpt-5.6-sol`, `glm-5.3`):**\n\n- **API Provider:**`OpenAI Compatible`\n- **Base URL:**`https://agentrouter.org/v1` ←*with `/v1`*\n- **API Key:** your AgentRouter key\n- **Model ID:** e.g.`gpt-5.6-sol` or`glm-5.3`\n\nKeep the two methods separate — don't mix the Anthropic base URL with the OpenAI provider or vice‑versa.\n\nBeyond the three above, AgentRouter documents setups for: **Codex, Qwen Code, Roo Code, Kilo Code, GitHub Copilot, OpenCode, OpenClaw, Hermes Agent, Pi, Trae, Claude App, and Gemini CLI.** See [https://agentrouter.org/docs/index.html](https://agentrouter.org/docs/index.html).\n\n| Symptom | Likely cause & fix | \n|---|---|\n| **401 Unauthorized** | Wrong base URL for the protocol, or an unsupported client. Double‑check Anthropic = `https://agentrouter.org` (no`/v1` ), OpenAI =`.../v1` . Use an officially supported client. | \n| **400 content blocked** | Your request contains an unsupported language. AgentRouter currently only allows **Chinese, English, French, German, Russian** . Rewrite the prompt and retry. | \n| **Model not found / errors on a model ID** | The ID was probably renamed. Open [https://agentrouter.org/console](https://agentrouter.org/console) and use a currently‑listed Opus ID (e.g.`claude-opus-4-8` /`claude-opus-5` ). | \n| **Balance shows $0** | Usually a display glitch — wait and refresh. Also make sure you logged out/in after the check‑in. | \n| **Claude Code complains about a background/\"small/fast\" model** | Optionally set `ANTHROPIC_SMALL_FAST_MODEL` to a model that's actually available (e.g.`claude-opus-4-8` ). | \n| **Can't open the site** | Use the backup domain [https://ps.air-outer.com](https://ps.air-outer.com) . | \n\n- **It's unofficial.** AgentRouter is a third‑party gateway, not Anthropic. Your prompts pass through their servers —**never send secrets, credentials, or confidential/proprietary code.**\n- **Reliability varies.** The service has had upstream outages and has temporarily lost Claude models in the past. If it's down, that's normal for a free service — check their status/announcements.\n- **Free credits & models can change or end** at any time. Don't build anything you depend on around it.\n- **For serious/production use,** use the official[Anthropic API](https://console.anthropic.com) or a Claude Pro/Max subscription.\n\nAgentRouter bans abuse and will ban accounts for it. Don't: mass‑register or farm credits, run automated arbitrage/scraping, resell or share accounts/credits, do fake‑invite fraud, or try to bypass limits. Full terms: [https://agentrouter.org/docs/terms.html](https://agentrouter.org/docs/terms.html).\n\n- Official AgentRouter docs: [https://agentrouter.org/docs/index.html](https://agentrouter.org/docs/index.html)\n- Sign up (referral): **[https://agentrouter.org/register?aff=kgU5](https://agentrouter.org/register?aff=kgU5)**\n\n*This guide is provided as‑is for educational purposes. Model availability and platform terms are controlled by AgentRouter and may change.*\n\n1. Go to **[https://agentrouter.org/register?aff=kgU5](https://agentrouter.org/register?aff=kgU5)** .\n2. Sign in with **GitHub** (or LinkDo). Email verification is not required.\n\n1. Open the token page: **[https://agentrouter.org/console/token](https://agentrouter.org/console/token)**\n2. Create a new token\n  - Click on **create token**\n  - Provide a name for example **claude_token**\n  - Enable **Unlimited quota**\n  - Click on **submit**\n3. Click on \n4. Copy the **Key** (looks like`sk-...` ). Treat it like a password.\n\n1. Open the Claude Desktop application\n2. **Ensure Developer Mode** is**active** (found via**Help** →**Troubleshooting** →**Enable Developer Mode** )\n3. Locate the new **Developer tab** in your top application menu bar\n4. Click **Configure Third-Party Inference** ... to open the setup window\n  - Set the **Connection or Provider type** as**Gateway**\n  - **Credential kind** as**Static API key**\n  - **Gateway base URL** as**[https://agentrouter.org/](https://agentrouter.org/)**\n  - **Gateway API key** as**your token** you created in step2\n  - **Gateway auth scheme** as**bearer**\n5. Set the \n6. Click on **Save Changes** then**Apply Changes**\n7. Restart popup will come so restart it\n8. Tada now you are good to use Claude", "url": "https://wpnews.pro/news/free-claude-opus-4-x-5-using-agentrouter", "canonical_source": "https://gist.github.com/prateekbangre/57ed4d92ed48f9d5b8065d5d1cdd1064", "published_at": "2026-08-27 10:00:15+00:00", "updated_at": "2026-09-07 21:01:48.054749+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "large-language-models"], "entities": ["AgentRouter", "Anthropic", "Claude Opus", "Claude Code", "Cursor", "Cline", "Claude Desktop"], "alternates": {"html": "https://wpnews.pro/news/free-claude-opus-4-x-5-using-agentrouter", "markdown": "https://wpnews.pro/news/free-claude-opus-4-x-5-using-agentrouter.md", "text": "https://wpnews.pro/news/free-claude-opus-4-x-5-using-agentrouter.txt", "jsonld": "https://wpnews.pro/news/free-claude-opus-4-x-5-using-agentrouter.jsonld"}}