OpenClawRouter API
Route requests to the best AI models from Anthropic, OpenAI, and Google. One API key, every frontier model, 25% off official pricing.
Overview
OpenClawRouter is an AI model routing service that provides unified access to frontier AI models from multiple providers through a single API. We negotiate enterprise-grade pricing with Anthropic, OpenAI, and Google, passing 25% savings to developers.
Base URL: https://openclawrouter.dev/api/v1
Quickstart
Get started in under 2 minutes. Create an account, get your API key, and make your first request.
1. Get your API key
Sign up and navigate to Settings → API Keys to create your key. Keys are prefixed with cr_.
2. Make your first request
curl https://openclawrouter.dev/api/v1/messages \
-H "x-api-key: cr_YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello, Claude!"}
]
}'3. Or use the OpenAI-compatible endpoint
from openai import OpenAI
client = OpenAI(
base_url="https://openclawrouter.dev/api/v1/codex",
api_key="cr_YOUR_API_KEY",
)
response = client.chat.completions.create(
model="gpt-5.1-codex",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)Authentication
All API requests require authentication via an API key. Include your key in the request headers.
Anthropic-compatible endpoints
x-api-key: cr_YOUR_API_KEYOpenAI-compatible endpoints
Authorization: Bearer cr_YOUR_API_KEYGemini-compatible endpoints
x-goog-api-key: cr_YOUR_API_KEYSecurity: Never expose your API key in client-side code. Always make API calls from your backend server.
Providers
OpenClawRouter routes to these providers through our enterprise agreements:
Anthropic
- Claude Opus 4.6
- Claude Sonnet 4.5
OpenAI
- GPT-5.3 Codex
- GPT-5.2
- GPT-5.1
- GPT-5.1 Codex
- GPT-5.1 Codex Max
- Gemini 3 Pro Preview
- Gemini 3 Flash Preview
- Gemini 2.5 Pro
- Gemini 2.5 Flash
Models & Pricing
All prices are per million tokens (MTok). OpenClawRouter pricing shown alongside official pricing for comparison.
| Model | Provider | Context | Input(official) | Output(official) | Tier |
|---|---|---|---|---|---|
| Claude Opus 4.6 | Anthropic | 200K | $1.00$5.00 | $5.00$25.00 | Business |
| Claude Sonnet 4.5 | Anthropic | 200K | $0.60$3.00 | $3.00$15.00 | Starter |
| GPT-5.3 Codex | OpenAI | 128K | $0.35$1.75 | $2.80$14.00 | Max |
| GPT-5.2 | OpenAI | 128K | $0.35$1.75 | $2.80$14.00 | Max |
| GPT-5.1 | OpenAI | 128K | $0.25$1.25 | $2.00$10.00 | Starter |
| GPT-5.1 Codex | OpenAI | 128K | $0.25$1.25 | $2.00$10.00 | Pro |
| Gemini 3 Pro Preview | 1M | $0.80$4.00 | $3.60$18.00 | Max | |
| Gemini 3 Flash Preview | 1M | $0.10$0.50 | $0.60$3.00 | Starter | |
| Gemini 2.5 Pro | 1M | $0.50$2.50 | $3.00$15.00 | Pro | |
| Gemini 2.5 Flash | 1M | $0.06$0.30 | $0.50$2.50 | Starter |
100 credits = $1.00 USD. Credits are deducted based on actual token usage.
API Endpoints
POSTAnthropic Messages API
Compatible with Anthropic's Messages API. Use for Claude models.
POST https://openclawrouter.dev/api/v1/messages
Content-Type: application/json
x-api-key: cr_YOUR_API_KEY
anthropic-version: 2023-06-01
{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Explain quantum computing in simple terms."}
]
}POSTOpenAI Chat Completions
Compatible with OpenAI's Chat Completions API. Use for GPT/Codex models.
POST https://openclawrouter.dev/api/v1/codex/chat/completions
Content-Type: application/json
Authorization: Bearer cr_YOUR_API_KEY
{
"model": "gpt-5.1-codex",
"messages": [
{"role": "user", "content": "Write a Python fibonacci function."}
],
"stream": true
}POSTGemini API
Compatible with Google's Gemini API. Use for Gemini models.
POST https://openclawrouter.dev/api/v1/gemini/chat/completions
Content-Type: application/json
Authorization: Bearer cr_YOUR_API_KEY
{
"model": "gemini-2.5-flash",
"messages": [
{"role": "user", "content": "Summarize this codebase."}
]
}POSTUnified Chat (Streaming)
Our unified endpoint that works with any model across all providers.
POST https://openclawrouter.dev/api/v1/chat
Content-Type: application/json
Authorization: Bearer cr_YOUR_API_KEY
{
"model": "claude-opus-4-6",
"messages": [
{"role": "user", "content": "Review this pull request."}
],
"stream": true
}Tool Integration
Drop OpenClawRouter into your existing AI coding tools. Just change the base URL.
Claude Code
Set the environment variable before running Claude Code:
export ANTHROPIC_BASE_URL=https://openclawrouter.dev/api/v1 export ANTHROPIC_API_KEY=cr_YOUR_API_KEY claude
Codex CLI
Route Codex CLI through OpenClawRouter:
export OPENAI_BASE_URL=https://openclawrouter.dev/api/v1/codex export OPENAI_API_KEY=cr_YOUR_API_KEY codex
Gemini CLI
Route Gemini CLI through OpenClawRouter:
export GEMINI_API_BASE_URL=https://openclawrouter.dev/api/v1/gemini export GEMINI_API_KEY=cr_YOUR_API_KEY gemini
OpenClaw
Configure OpenClaw to use OpenClawRouter as the provider:
{
"models": {
"providers": {
"ocr-claude": {
"baseUrl": "https://openclawrouter.dev/api/v1",
"apiKey": "cr_YOUR_KEY",
"api": "anthropic-messages",
"models": [
{ "id": "claude-opus-4-6" },
{ "id": "claude-sonnet-4-5-20250929" }
]
},
"ocr-codex": {
"baseUrl": "https://openclawrouter.dev/api/v1/codex",
"apiKey": "cr_YOUR_KEY",
"api": "openai-responses"
},
"ocr-gemini": {
"baseUrl": "https://openclawrouter.dev/api/v1/gemini",
"apiKey": "cr_YOUR_KEY",
"api": "openai-completions"
}
}
}
}OpenCode
Configure OpenCode (~/.config/opencode/opencode.json):
{
"provider": "anthropic",
"baseUrl": "https://openclawrouter.dev/api/v1",
"apiKey": "cr_YOUR_KEY",
"model": "claude-sonnet-4-5-20250929"
}Rate Limits
Rate limits are applied per API key to ensure fair usage across all users.
| Tier | Requests / min | Requests / hour | Tokens / min |
|---|---|---|---|
| Starter | 10 | 60 | 100K |
| Pro | 30 | 300 | 500K |
| Max | 60 | 600 | 1M |
| Business | 120 | Unlimited | Unlimited |
Rate limit headers are included in every response:
X-RateLimit-Limit: 60 X-RateLimit-Remaining: 59 X-RateLimit-Reset: 1706745600 Retry-After: 60
Usage & Billing
OpenClawRouter uses a simple credit-based billing system. Buy credits, use them on any model.
How credits work
- 100 credits = $1.00 USD
- Credits are deducted based on actual token usage
- No subscription required — buy credits anytime
- Higher top-ups unlock more models and bonus credits
- View real-time usage on your dashboard
Tier unlocks
Your tier is determined by cumulative top-up amount. Higher tiers unlock more models:
Ready to get started?
Create your account, top up credits, and start routing AI models in under 2 minutes.
