OpenClaw Integration
Use GPT-5.4, Claude Opus, Gemini, or any model with OpenClaw across Discord, WhatsApp, Telegram, and more
OpenClaw is a self-hosted gateway that connects your favorite chat apps—WhatsApp, Telegram, Discord, iMessage, and more—to AI coding agents. With OffRail as a custom provider, you can route all your OpenClaw traffic through a single API, use any of 200+ models, and keep full visibility into usage and costs.
Setup
Sign Up for OffRail
Sign up free — no credit card required. Copy your API key from the dashboard.
Set Your API Key
export OFFRAIL_API_KEY=orl_your_api_key_hereConfigure OpenClaw
Add OffRail as a custom provider in your ~/.openclaw/openclaw.json:
{
"models": {
"mode": "merge",
"providers": {
"offrail": {
"baseUrl": "https://api.offrail.ai/v1",
"apiKey": "${OFFRAIL_API_KEY}",
"api": "openai-completions",
"models": [
{
"id": "gpt-5.4",
"name": "GPT-5.4",
"contextWindow": 128000,
"maxTokens": 32000
},
{
"id": "claude-opus-4-6",
"name": "Claude Opus 4.6",
"contextWindow": 200000,
"maxTokens": 8192
},
{
"id": "gemini-3.1-pro-preview",
"name": "Gemini 3.1 Pro",
"contextWindow": 1000000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "offrail/gpt-5.4"
}
}
}
}Start Chatting
Launch OpenClaw and start chatting across your connected channels. All requests will be routed through OffRail.
Why Use OffRail with OpenClaw
- Model flexibility — Switch between GPT-5.4, Claude Opus, Gemini, or any of 200+ models
- Cost tracking — Monitor exactly how much your chat agents cost to run
- Single bill — No need to manage multiple API provider accounts
- Response caching — Repeated queries hit cache, reducing costs
- Rate limit handling — Automatic fallback between providers
Switching Models
Change the primary model in your config to switch between any model:
{
"agents": {
"defaults": {
"model": { "primary": "offrail/claude-opus-4-6" }
}
}
}Model Fallback Chain
OpenClaw supports fallback models. If the primary model is unavailable, it automatically falls back:
{
"agents": {
"defaults": {
"model": {
"primary": "offrail/gpt-5.4",
"fallbacks": ["offrail/claude-opus-4-6"]
}
}
}
}Available Models
OffRail uses canonical model IDs with smart routing—automatically selecting the best provider based on uptime, throughput, price, and latency. You can use any model from the models page. Flagship models include:
| Model | Best For |
|---|---|
gpt-5.4 | Latest OpenAI flagship, highest quality |
claude-opus-4-6 | Anthropic's most capable model |
claude-sonnet-4-6 | Fast reasoning with extended thinking |
gemini-3.1-pro-preview | Google's latest flagship, 1M context window |
o3 | Advanced reasoning tasks |
gpt-5.4-pro | Premium tier with extended reasoning |
gemini-3.6-flash | Fast responses, good for high-volume |
claude-haiku-4-5 | Cost-effective, quick responses |
grok-3 | xAI flagship |
deepseek-v3.1 | Open-source with vision and tools |
For more details on routing behavior, see routing.
View all available models on the models page.
Tips for Chat Agents
Optimize Costs
- Use smaller models for simple tasks — Claude Haiku or Gemini Flash handle basic Q&A well
- Enable caching — OffRail caches identical requests automatically
- Set token limits — Configure max tokens to prevent runaway costs
Improve Response Quality
- Choose the right model — Claude Opus excels at nuanced conversation, GPT-5.4 at general tasks
- Use system prompts — Configure your agent's personality and capabilities
- Test multiple models — OffRail makes it easy to A/B test different providers
Need help? Join our Discord community for support and troubleshooting assistance.
How is this guide?