Direct API (Raw HTTP / cURL)
Directly calling AgentRouter base URL in custom code via raw HTTP/cURL is blocked by Cloudflare WAF design without spoofing headers.
Required WAF Bypass Headers
If attempting direct requests from custom scripts, Cloudflare WAF returns unauthorized client unless client headers are spoofed:
Originator: codex_cli_rs Version: 0.101.0 User-Agent: codex_cli_rs/0.101.0 (Mac OS 26.0.1; arm64) Apple_Terminal/464
Live API Tester
7-Language Code Snippets
Coding Agents & IDE Integration
Integrate AgentRouter directly into official coding tools and IDE extensions — no WAF spoofing needed.
https://agentrouter.org (NO /v1)
https://agentrouter.org/v1 (WITH /v1)
Cline Extension
-
Claude Models: API Provider =
Anthropic· Custom Base URL =https://agentrouter.org(NO /v1) · Model =claude-opus-4-6 -
GPT Models: API Provider =
OpenAI Compatible· Base URL =https://agentrouter.org/v1· Model =gpt-5.6-sol
Roo Code
Create a Custom Provider profile and set:
-
For Claude: Anthropic Base URL =
https://agentrouter.org(NO /v1) · API Key = your AgentRouter key -
For GPT: OpenAI Base URL =
https://agentrouter.org/v1· API Key = your AgentRouter key
Kilo Code
Create a Custom Provider profile and set:
-
For Claude: Anthropic Base URL =
https://agentrouter.org(NO /v1) · API Key = your AgentRouter key -
For GPT: OpenAI Base URL =
https://agentrouter.org/v1· API Key = your AgentRouter key
Claude Code (VS Code Extension)
Search for Claude Code in VS Code Extensions and install it. If required by your system, install the local CLI runner once (claude --version):
Open VS Code User Settings JSON (Cmd/Ctrl+Shift+P → Open User Settings (JSON)) and add:
{
"claudeCode.environmentVariables": [
{ "name": "ANTHROPIC_AUTH_TOKEN", "value": "your-agentrouter-api-key" },
{ "name": "ANTHROPIC_BASE_URL", "value": "https://agentrouter.org" },
{ "name": "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY", "value": "1" },
{ "name": "ANTHROPIC_MODEL", "value": "claude-opus-4-8" }
],
"claudeCode.disableLoginPrompt": true,
"claudeCode.initialPermissionMode": "acceptEdits"
}
On the Claude Code plugin details page, click Gear → Settings and enable Disable Login Prompt to stop official login popups.
GitHub Copilot
Copilot supports custom model endpoints. Set AgentRouter as the provider using OpenAI-compatible base URL https://agentrouter.org/v1 with your API key.
Claude Code CLI
Uses Anthropic-compatible config. Base URL does NOT include /v1. Do not mix with OpenAI endpoints.
- Requires Node.js 18+. Check:
node --version - Install:
npm install -g @anthropic-ai/claude-code@latest - Verify:
claude --version - Set environment variables:
macOS / Linux
export ANTHROPIC_AUTH_TOKEN="your-agentrouter-api-key" export ANTHROPIC_BASE_URL="https://agentrouter.org" export ANTHROPIC_MODEL="claude-opus-4-6"
Windows PowerShell
$env:ANTHROPIC_AUTH_TOKEN="your-agentrouter-api-key" $env:ANTHROPIC_BASE_URL="https://agentrouter.org" $env:ANTHROPIC_MODEL="claude-opus-4-6"
- Run:
claude
unset ANTHROPIC_AUTH_TOKEN ANTHROPIC_BASE_URL ANTHROPIC_MODEL and restart claude.
claude-opus-4-6 (default) · claude-opus-4-7 · claude-opus-4-8
Other CLI Tools
These CLI agents support custom endpoints via environment variables:
OPENAI_BASE_URL=https://agentrouter.org/v1
https://agentrouter.org/v1
https://agentrouter.org/v1
https://agentrouter.org/v1
Bug or Question?
Open an issue on GitHub to report unexpected behavior or ask questions.