AgentRouter AI Setup Guide
Claude Code, OpenAI Codex & OpenCode Integration with Free Credits
1. Account Registration & Claiming Credits
- Registration: Sign up using the referral invitation link https://agentrouter.org/register?aff=EZ5v to receive the full $175 initial credits and grant $50 in bonus credits to both accounts.
- GitHub Account Requirements: Sign in with a GitHub account that is at least 6 months old with normal commit activity. Blank profiles or freshly created accounts are rejected by anti-bot filters, but standard active accounts pass without issue.
- Initial Balance: Once authenticated, your $175 balance is immediately credited to your dashboard wallet.
- Daily Bonus Refresh: Daily credits ($25/day) do not credit automatically in the background. You must log out and log back into your account each day to trigger the balance refresh.
- Generate API Token: Go to Console > API Tokens and click "Add Token". Provide a name, select "Never expires", toggle "Unlimited quota" (or custom limits), and copy your
sk-...API key.
Eligible accounts receive $175 upon registration. Using this referral link adds an extra $50 bonus, plus $25 for daily logins. Note that daily credits do not apply automatically; you must log out and log back in each day to refresh your balance.
2. Supported Models
The following models are supported and available with your free account credits:
claude-opus-5claude-opus-4-8gpt-5.6-solglm-5.3deepseek-v4-flash
3. Client Installation & Configuration
Select your preferred AI coding client below to view the dedicated setup instructions for your operating system.
For additional tools, IDE plugins (like Pi, Cursor, Cline, Continue), or advanced parameters, visit the official AgentRouter Documentation. Note: The documentation is primarily in Chinese, so use your browser built-in translation to English for in-depth setup guides and updates.
Official @openai/codex CLI configured to route through the AgentRouter OpenAI-compatible API gateway.
Prerequisites: Node.js (Optional)
Node.js 18 or newer is required to install the official Codex package.
node --version- macOS (Homebrew):
brew install node - Windows: Download LTS installer from nodejs.org
- Linux (Debian/Ubuntu):
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs
Step 1: Install Codex CLI
Install globally via npm or Homebrew:
npm install -g @openai/codexAlternative: Homebrew Installation (macOS)
If you prefer Homebrew:
brew install codexStep 2: Setup Configuration Directory
Clear any previous configuration and initialize the directory:
rm -rf ~/.codex && mkdir ~/.codexStep 3: Configure Authentication
Open ~/.codex/auth.json in a text editor (replace YOUR_API_KEY with your key):
nano ~/.codex/auth.json{
"OPENAI_API_KEY": "YOUR_API_KEY"
}Step 4: Configure Provider
Create and save ~/.codex/config.toml with the exact provider parameters below:
nano ~/.codex/config.tomlmodel_provider = "agentrouter"
model = "gpt-5.6-sol"
model_reasoning_effort = "xhigh"
disable_response_storage = true
preferred_auth_method = "apikey"
[model_providers.agentrouter]
name = "agentrouter"
base_url = "https://agentrouter.org/v1"
wire_api = "responses"Step 5: Verify & Launch
Restart your terminal to reload environment variables, verify the version, and launch:
codex -V
cd your-project-folder
codex4. Troubleshooting & Best Practices
Common solutions for CLI configuration, account verification, and credit synchronization:
- Daily Credits Not Refreshing: Daily credits ($25/day) do not apply automatically. Log out of agentrouter.org and log back in each day to refresh your balance.
- Account Verification Criteria: If initial credits fail to appear, verify that your GitHub account is at least 6 months old with active commit history. Blank alts and newly created accounts are rejected by anti-fraud filters.
- Anthropic vs OpenAI Base URL: For Anthropic clients (Claude Code), use
https://agentrouter.orgwithout/v1. For OpenAI-compatible tools (Codex, OpenCode, Cline, Cursor), usehttps://agentrouter.org/v1. - Token Permissions: In Console > API Tokens, confirm your token is assigned to the
defaultgroup with all models active and "Never expires" enabled.