Developer setup

Two values.
Any tool.

Every tool below needs the same two things: a Virouter base URL and your API key. Paste your key once and every snippet on this page is ready to copy.

Base URLs

https://api.virouter.com/v1

OpenAI-compatible

Chat Completions and Responses. Codex, Cursor, SDKs and compatible tools.

https://api.virouter.com

Anthropic-compatible

Messages API. Claude Code and Anthropic SDKs.

Your setup

Personalize the snippets

Get a key →

Choose your tool

12 tools

Claude Code

Anthropic · Terminal agent by Anthropic

Official docs

Protocol

Anthropic-compatible

Config file

~/.claude/settings.json

4 steps

About 2 min

Claude Code uses Anthropic Messages. Set ANTHROPIC_BASE_URL=https://api.virouter.com; do not append /v1.

01

Install Claude Code

TERMINAL
curl -fsSL https://claude.ai/install.sh | bash
02

Point Claude Code at Virouter

ENVIRONMENT
export ANTHROPIC_BASE_URL="https://api.virouter.com"
export ANTHROPIC_AUTH_TOKEN="vr_sk_YOUR_API_KEY"
export ANTHROPIC_MODEL="claude-sonnet-4-6"
claude
03

Make it permanent

~/.claude/settings.json
{"env":{"ANTHROPIC_BASE_URL":"https://api.virouter.com","ANTHROPIC_AUTH_TOKEN":"vr_sk_YOUR_API_KEY","ANTHROPIC_MODEL":"claude-sonnet-4-6"}}
04

Run and verify

GET /v1/models
curl https://api.virouter.com/v1/models \
  -H "Authorization: Bearer vr_sk_YOUR_API_KEY"
Full Virouter Claude Code guide

Verify

Check the key works

GET /v1/models
curl https://api.virouter.com/v1/models \
  -H "Authorization: Bearer vr_sk_YOUR_API_KEY"
401

Missing, invalid, revoked, or inactive API key.

402

Insufficient Billing USD Quota.

404

OpenAI-compatible uses /v1; Claude Code uses https://api.virouter.com.

429

Rate limit reached. Retry with backoff.

503

No available upstream route. Check model access and retry later.

For support, include x-virouter-request-id. Never send your API key.