Skip to Content

OpenClaw (gateway)

Route OpenClaw ’s LLM calls through the Respan gateway for automatic logging, caching, and model switching. OpenClaw supports custom OpenAI-compatible providers, so only your RESPAN_API_KEY is needed.

Paste this into your coding agent:

Help me set up the Respan gateway with the OpenClaw integration. Follow https://www.respan.ai/docs/integrations/gateway/open-claw.md

Setup

Install OpenClaw

Terminal
npm install -g openclaw@latest

Add Respan as a custom provider

Edit ~/.openclaw/openclaw.json and define a Respan provider under models.providers, then make it the default model:

JSON5
{ models: { providers: { respan: { baseUrl: "https://gateway.respan.ai", apiKey: "${RESPAN_API_KEY}", api: "openai-completions", models: [ { id: "gpt-4o", name: "GPT-4o", reasoning: false, input: ["text", "image"], cost: { input: 2.5, output: 10, cacheRead: 1.25, cacheWrite: 0 }, contextWindow: 128000, maxTokens: 16384, }, ], }, }, }, agents: { defaults: { model: { primary: "respan/gpt-4o" }, }, }, }

Set RESPAN_API_KEY in your shell or in ~/.openclaw/.env:

Terminal
RESPAN_API_KEY=YOUR_RESPAN_API_KEY

No separate provider key needed. The Respan gateway handles provider authentication.

Run OpenClaw

Terminal
openclaw

To check the routing with a single local turn:

Terminal
openclaw agent --local -m "your prompt"

All LLM calls now route through Respan.

Switch models

Add more entries under models and change model.primary to use any of the 1000+ models available through the gateway.

JSON5
model: { primary: "respan/gpt-4o", // primary: "respan/claude-sonnet-4-5-20250929" // primary: "respan/gemini/gemini-3.5-flash" }

See the full model list .