Developer Documentation
Learn how to integrate RayRouter with your local development tools, CLI agents, and standard applications.
Gateway Endpoints
Universal Endpoint (OpenAI Compatible)Recommended
OpenAI-compatible unified endpoint. Auto-translates to the model's native protocol.
https://api.rayrouter.com/v1/chat/completions
MessagesAnthropic / Claude
https://api.rayrouter.com/v1/messages
ResponsesOpenAI Responses API
https://api.rayrouter.com/v1/responses
GeminiGoogle Gemini
https://api.rayrouter.com/v1beta/models/{model}
Claude Code CLI
Configure Anthropic's official CLI agent to route through RayRouter.
Method 1 — Environment Variables (per session)
export ANTHROPIC_BASE_URL="https://api.rayrouter.com"
export ANTHROPIC_API_KEY="<YOUR_API_KEY>"
claudeor
Method 2 — Config File (persistent)
Create or edit the settings file at:
Linux / macOS:
~/.claude/settings.jsonWindows:
%USERPROFILE%\.claude\settings.json{
"env": {
"ANTHROPIC_BASE_URL": "https://api.rayrouter.com",
"ANTHROPIC_AUTH_TOKEN": "<YOUR_API_KEY>",
"ANTHROPIC_MODEL": "deepseek-v4-pro[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-v4-pro[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-v4-pro[1m]",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4-flash[1m]",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"CLAUDE_CODE_EFFORT_LEVEL": "max"
}
}How it works under the hood:
Anthropic's Claude Code CLI uses ANTHROPIC_BASE_URL to send requests. By routing to /v1/messages, all messages are automatically matched against active providers in RayRouter and settled seamlessly against your virtual smart wallet balance.
Need to inspect available models & pricing catalog?
Browse Model Catalog