OpenClaw + Lumecoder Quick Setup
Claude Models in 3 Steps
No plugins needed. Connect OpenClaw to Lumecoder's Claude API using the native Anthropic Messages API protocol. For users who already have OpenClaw installed.
Prerequisites
- OpenClaw installed (see OpenClaw + Lumecoder Integration Guide)
- Lumecoder account with API Key (starts with sk-)
How It Works
OpenClaw natively supports the Anthropic Messages API protocol. We simply register a custom Provider in openclaw.json pointing to the Lumecoder API endpoint. No plugins required.
Configuration Steps
Edit openclaw.json to add Lumecoder Provider
Open the config file:
vim ~/.openclaw/openclaw.json
Add a top-level models node (same level as agents, channels, etc.):
"models": {
"providers": {
"lumecoder": {
"baseUrl": "https://api.lumecoder.com",
"apiKey": "${LUMECODER_API_KEY}",
"api": "anthropic-messages",
"models": [
{ "id": "claude-sonnet-4-5-20250929", "name": "Claude Sonnet 4.5" },
{ "id": "claude-haiku-4-5-20251001", "name": "Claude Haiku 4.5" },
{ "id": "claude-opus-4-6", "name": "Claude Opus 4.6" }
]
}
}
}Also update the model config in agents.defaults:
"model": {
"primary": "lumecoder/claude-sonnet-4-5-20250929",
"fallbacks": [
"lumecoder/claude-haiku-4-5-20251001"
]
},
"models": {
"lumecoder/claude-sonnet-4-5-20250929": {},
"lumecoder/claude-haiku-4-5-20251001": {},
"lumecoder/claude-opus-4-6": {}
}Set API Key environment variable
echo 'LUMECODER_API_KEY=sk-你的密钥' >> ~/.openclaw/.env
Get your API Key from the Lumecoder dashboard under "API Keys". It starts with sk-.
Set default model and restart
openclaw models set lumecoder/claude-sonnet-4-5-20250929 openclaw gateway restart
Verification
Run a test command:
openclaw agent --local --session-id test -m "你好"
If you receive a normal response, it means:
- OpenClaw is connected to Lumecoder via Anthropic Messages API
- Claude model calls are successful
- Credits billing is working
Available Models
The following models can be configured in openclaw.json:
| Model ID | Description | Recommended Use |
|---|---|---|
| claude-sonnet-4-5-20250929 | Claude Sonnet 4.5 | Daily chat, code generation (recommended) |
| claude-haiku-4-5-20251001 | Claude Haiku 4.5 | Lightweight, fast, low cost |
| claude-opus-4-6 | Claude Opus 4.6 | Complex reasoning, long-form writing |
Switch default model:
openclaw models set lumecoder/claude-opus-4-6
Full Configuration Reference
Complete Lumecoder Claude configuration snippet for openclaw.json:
{
"agents": {
"defaults": {
"model": {
"primary": "lumecoder/claude-sonnet-4-5-20250929",
"fallbacks": ["lumecoder/claude-haiku-4-5-20251001"]
},
"models": {
"lumecoder/claude-sonnet-4-5-20250929": {},
"lumecoder/claude-haiku-4-5-20251001": {},
"lumecoder/claude-opus-4-6": {}
}
}
},
"models": {
"providers": {
"lumecoder": {
"baseUrl": "https://api.lumecoder.com",
"apiKey": "${LUMECODER_API_KEY}",
"api": "anthropic-messages",
"models": [
{ "id": "claude-sonnet-4-5-20250929", "name": "Claude Sonnet 4.5" },
{ "id": "claude-haiku-4-5-20251001", "name": "Claude Haiku 4.5" },
{ "id": "claude-opus-4-6", "name": "Claude Opus 4.6" }
]
}
}
}
}Troubleshooting
Invalid key format
Lumecoder API Key must start with sk-. Check the value in ~/.openclaw/.env.
Config changes not taking effect
You must restart after modifying openclaw.json or .env:
openclaw gateway restart
Done
Setup complete. OpenClaw now calls Claude models through Lumecoder, with support for streaming, tool calling, and Prompt Cache.
