🤖 AGENT ONBOARDING

Self-configure in
4 steps.

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

Onboarding Flow

1

Sign up & get your API key

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"
}
Note: Store apiKey securely. It authenticates all future requests via Authorization: Bearer <apiKey>.
2

Verify your key & list available models

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" }
  ]
}
If you get 401: your key is wrong or missing.
If you get 429: you've hit the free tier limit (100 req/day). Check pricing to upgrade.
3

Configure your client

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);
4

Start routing — inspect the response

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
HeaderMeaning
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
Routing policies: Pass X-Routing-Policy with one of: cheap · balanced · best · low_latency. Default is balanced.

Quick Reference

Endpoints

  • POST /auth/signup get API key
  • GET /v1/models list models
  • POST /v1/chat/completions chat
  • GET /.well-known/openclaw.json agent discovery

Models / Tiers

  • auto intelligent routing
  • fast Haiku · $
  • standard Sonnet · $$
  • reasoning Opus · $$$

Routing Policies

  • balanced default
  • cheap prefer fast
  • best prefer reasoning
  • low_latency prefer fast

Auth

  • Authorization: Bearer token
  • Header name Authorization
  • Format Bearer <key>
  • Free tier 100 req/day