OpenClaw
Register RouteMux as a provider in openclaw.json, on any of its four protocol modes.
OpenClaw keeps providers under models.providers in ~/.openclaw/openclaw.json. Each
provider declares its protocol with an api field, using the same four values as Pi.
Configure
{
"models": {
"providers": {
"routemux": {
"baseUrl": "https://api.routemux.com/v1",
"apiKey": "sk-...",
"auth": "api-key",
"api": "openai-completions",
"models": [
{
"id": "openai/gpt-5.5",
"name": "GPT-5.5",
"reasoning": true,
"contextWindow": 1000000,
"maxTokens": 128000
}
]
}
}
},
"agents": {
"defaults": {
"model": { "primary": "routemux/openai/gpt-5.5" }
}
}
}A model is referenced as <providerId>/<modelId>. Our model ids already contain a slash, so
the full reference has three segments.
Protocol and base URL
api | RouteMux baseUrl | Lands on |
|---|---|---|
openai-completions | https://api.routemux.com/v1 | /v1/chat/completions |
openai-responses | https://api.routemux.com/v1 | /v1/responses |
anthropic-messages | https://api.routemux.com — bare origin | /v1/messages |
google-generative-ai | https://api.routemux.com/vertex-ai | Vertex operations |
Claude models are served only on anthropic-messages, so a Claude provider block needs both
api: "anthropic-messages" and the bare-origin base URL. Getting one of the two right and
the other wrong is the usual failure.
Model lists are explicit
OpenClaw does not discover models from the endpoint — whatever you list in models is what
you get. Ids must match GET /v1/models exactly, and contextWindow / maxTokens feed the
agent's own budgeting.
Troubleshooting
| Symptom | Cause |
|---|---|
| Provider absent from model selection | The block is at the wrong nesting level. It belongs under models.providers, not at the top level. |
| 404 on every request | Base URL shape does not match the api value. See the table. |
400 MODEL_PROTOCOL_UNSUPPORTED | Model not served on the declared protocol — most often a Claude id under an OpenAI mode. |
| Model reference not resolving | agents.defaults.model.primary needs <providerId>/<modelId>; ours already contains a slash. |
400 AUTH_AMBIGUOUS_API_KEY | Two different key values reaching us at once. Keep one. |
422 BILLING_INSUFFICIENT_CREDITS | Wallet lacks credit. Failed requests are not billed. |