Run OpenClaw on BoostRail
OpenClaw runs agents continuously, which makes it one of the most token-hungry setups a developer can have. It also expects you to bring your own model access. Adding BoostRail as a custom provider gives every agent one key, one bill, and the full catalog to choose from.
Why a gateway suits a long-running agent
A continuously running agent repeats context constantly, which is exactly the traffic shape that caching is built for: cached input bills at 10% of the input price, cache writes carry no surcharge, and token prices sit at or below the provider's list.
It also means a single provider outage or rate wall stops your agent mid-task. Through the gateway you get one OpenAI-compatible endpoint across leading models, so switching models is a string change in your config rather than a new account, a new key, and a new integration.
Add BoostRail as a custom provider
OpenClaw reads ~/.openclaw/openclaw.json (JSON5 — comments and trailing commas are fine). Define the provider under models.providers, then reference its models as boostrail/<model-id>.
~/.openclaw/openclaw.json
{
models: {
mode: "merge",
providers: {
boostrail: {
baseUrl: "https://api.boostrail.com/v1",
apiKey: "${BOOSTRAIL_API_KEY}",
api: "openai-completions",
models: [
{
id: "claude-sonnet-5",
name: "Claude Sonnet 5",
input: ["text"],
contextWindow: 200000,
maxTokens: 64000,
},
],
},
},
},
agents: {
defaults: {
model: { primary: "boostrail/claude-sonnet-5" },
},
},
}- Set BOOSTRAIL_API_KEY in the environment OpenClaw runs in. The key value goes in the environment, not in the config file.
- Add one model entry per model you want to use, with the exact id from the Models page. The catalog ids are stable strings — claude-sonnet-5, deepseek-v4-pro, gpt-5.4, and so on.
- If your setup restricts models through agents.defaults.modelPolicy.allow, add the ref boostrail/* or the exact model refs — a provider definition alone does not make a model selectable.
- contextWindow and maxTokens describe the model you picked, not the gateway. Check the Models page for the values that apply to your model, including the models that carry a context cap.
Anthropic-protocol alternative
OpenClaw also ships an anthropic-messages adapter. If you want Claude models over Anthropic's native protocol rather than the OpenAI-compatible face, point that adapter at the gateway root instead.
Provider block, Anthropic protocol
boostrail-anthropic: {
baseUrl: "https://api.boostrail.com",
apiKey: "${BOOSTRAIL_API_KEY}",
api: "anthropic-messages",
models: [
{ id: "claude-sonnet-5", name: "Claude Sonnet 5", input: ["text"] },
],
}Confirm it is working
Before letting an agent run unattended, make one call with the same key and base URL. If curl succeeds and OpenClaw does not, the problem is the config file or the model allowlist, not the gateway.
One call, straight against the gateway
curl https://api.boostrail.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"claude-sonnet-5","messages":[{"role":"user","content":"reply with OK"}]}'A working setup returns a JSON body with a choices array and the model's reply inside it. Your usage and the exact price applied to that request appear in the console within a few seconds.
OpenClaw FAQ
Which wire protocol should I choose?
openai-completions covers the whole catalog through one provider block, so it is the simpler default. Use anthropic-messages when you specifically want Claude models over Anthropic's native protocol; you can define both provider blocks side by side.
Is this configuration officially verified end to end?
It follows OpenClaw's documented custom-provider format, and the endpoints it targets are the same ones our coding-tool integrations are tested against. We do not claim an end-to-end OpenClaw run the way we do for Claude Code and Codex CLI — if anything in your setup differs, tell us and we will correct this page.
How is a long-running agent billed?
Per token in USD, at or below the provider's list price, with cached input at 10% of the input price and no cache-write surcharge. There is no monthly seat or subscription window — you pay for what the agent actually consumes.
Can I keep my own provider keys?
Yes. BYOK routes requests through your own provider accounts and contract prices while keeping one integration, with a free monthly BYOK allowance and platform fallback when a key is exhausted.
One key for every agent you run
Create a key, add the provider block, and point your agents at any model in the catalog.