Everything you need to connect to ClawRouter — no docs, no hand-holding. Read this page, run the steps, start routing.
Agent self-discovery: https://api.clawrouter.app/.well-known/openclaw.json
Send a POST to /auth/signup. Name is optional. You'll receive an API key immediately — save it, it's shown only once.
# Request
POST https://api.clawrouter.app/auth/signup
Content-Type: application/json
{
"email": "agent@example.com",
"name": "My Agent"
}
# Response 200
{
"apiKey": "cr_live_xxxxxxxxxxxxxxxxxxxx"
}
apiKey securely. It authenticates all future requests via Authorization: Bearer <apiKey>.
Confirm your key works by fetching the models list. Expect HTTP 200 with the four routing targets.
# Request
GET https://api.clawrouter.app/v1/models
Authorization: Bearer cr_live_xxxxxxxxxxxxxxxxxxxx
# Response 200
{
"object": "list",
"data": [
{ "id": "auto", "object": "model" },
{ "id": "fast", "object": "model" },
{ "id": "standard", "object": "model" },
{ "id": "reasoning", "object": "model" }
]
}
Replace YOUR_API_KEY with your key from Step 1. Pick the snippet for your runtime.
// openclaw.json — add or merge this block
{
"models": {
"providers": {
"clawrouter": {
"baseUrl": "https://api.clawrouter.app/v1",
"apiKey": "YOUR_API_KEY",
"api": "openai-completions",
"models": [
{ "id": "auto", "name": "Smart Route (auto-select best model)" },
{ "id": "fast", "name": "Fast (Haiku)" },
{ "id": "standard", "name": "Standard (Sonnet)" },
{ "id": "reasoning", "name": "Reasoning (Opus)" }
]
}
}
},
"agents": {
"defaults": {
"model": { "primary": "clawrouter/auto" }
}
}
}
curl https://api.clawrouter.app/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Routing-Policy: balanced" \
-d '{
"model": "auto",
"messages": [
{ "role": "user", "content": "Hello, ClawRouter!" }
]
}'
from openai import OpenAI
client = OpenAI(
base_url="https://api.clawrouter.app/v1",
api_key="YOUR_API_KEY",
)
response = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Hello, ClawRouter!"}],
extra_headers={"X-Routing-Policy": "balanced"},
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.clawrouter.app/v1",
apiKey: "YOUR_API_KEY",
});
const response = await client.chat.completions.create(
{
model: "auto",
messages: [{ role: "user", content: "Hello, ClawRouter!" }],
},
{ headers: { "X-Routing-Policy": "balanced" } }
);
console.log(response.choices[0].message.content);
Send any request with model: "auto". ClawRouter runs it through the 5-stage pipeline (hard gates → judge → score → execute → learn) and returns which tier it picked in the response headers.
# Full example: auto-routed request
curl -i https://api.clawrouter.app/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Routing-Policy: balanced" \
-d '{
"model": "auto",
"messages": [
{ "role": "user", "content": "Summarize this git diff in one sentence." }
]
}'
# Routing metadata in response headers:
x-gateway-routed-tier: fast
x-gateway-judge-source: heuristic
x-gateway-judge-confidence: 0.95
x-gateway-routing-policy: balanced
| Header | Meaning |
|---|---|
| x-gateway-routed-tier | Which tier was selected: fast, standard, or reasoning |
| x-gateway-judge-source | llm_judge (in-cluster classifier) or heuristic (keyword fallback) |
| x-gateway-judge-confidence | Confidence score 0.0–1.0. <0.6 triggers fallback to standard |
| x-gateway-routing-policy | The policy applied. Defaults to balanced if header omitted |
X-Routing-Policy with one of:
cheap · balanced · best · low_latency.
Default is balanced.