OpenAI's GPT-6 family is one of the most capable sets of models you can plug into OpenClaw. This guide covers the exact steps to get it connected, how to choose between the three tiers, and how to keep costs sensible.
If you haven't installed OpenClaw yet, start with the getting started guide first.
Step 1: Get Your OpenAI API Key
- Go to platform.openai.com and sign in (or create an account)
- Navigate to API Keys in the left sidebar
- Click Create new secret key — give it a name like "OpenClaw"
- Copy the key immediately. You won't be able to see it again.
- Add credits under Billing → Add payment method. Start with a small top-up.
Keep your API key secure. Don't put it in any public repository or share it.
Step 2: Add OpenAI to OpenClaw's Provider Config
OpenClaw stores LLM configuration in its providers file. Open the config directory:
nano ~/.openclaw/config/providers.yml
Add the OpenAI provider block:
providers:
openai:
api_key: "sk-your-key-here"
default_model: "gpt-6-sol"
models:
- id: "gpt-6-astra"
max_tokens: 4096
- id: "gpt-6-sol"
max_tokens: 4096
- id: "gpt-6-luna"
max_tokens: 4096
Save the file and restart OpenClaw:
openclaw restart
Step 3: Set OpenAI as Your Active Provider
In your main OpenClaw config (~/.openclaw/config/config.yml), set the active provider:
llm:
active_provider: "openai"
active_model: "gpt-6-sol"
Test the connection by sending a message through your connected messaging app. If you get a response, it's working.
Choosing the Right Model
| Model | Best for | Price per 1M tokens (in / out) |
|---|---|---|
gpt-6-astra | Complex reasoning, hard code, long-horizon agents | $10 / $50 |
gpt-6-sol | Everyday messages, standard coding, quick tasks | $2 / $10 |
gpt-6-luna | High-volume, cost-sensitive routing | $0.10 / $0.50 |
Practical recommendation: use gpt-6-sol as your default for everyday messages — it handles most tasks well at a fraction of Astra's cost. Reserve gpt-6-astra for genuinely complex requests, and drop to gpt-6-luna for simple, high-volume routing. You can trigger different models using prefixes in OpenClaw's routing config:
llm:
routing:
- pattern: "^(analyse|research|code|review)"
model: "gpt-6-astra"
- default:
model: "gpt-6-sol"
Current prices for every model, including Claude and Gemini, are on the models page.
Managing Costs
OpenAI API costs are pay-per-token. For typical personal use (30–50 messages/day across WhatsApp and Telegram), expect Sol as the default to cost noticeably less than Astra, and Luna less still — run openclaw stats for a week to see your actual mix before assuming a monthly figure, since it depends heavily on message length and how often routing triggers Astra.
To monitor spend: OpenAI's dashboard shows usage in real time. Set a usage limit under Billing → Usage limits to cap your monthly spend and avoid surprises.
# Check how many tokens OpenClaw sent in the last 24h
openclaw stats --period 24h
Troubleshooting Common Issues
"Invalid API key" error:
- Confirm the key starts with
sk- - Check there's no trailing space in the YAML value
- Ensure the key hasn't been revoked in the OpenAI dashboard
"Quota exceeded" or "Insufficient funds":
- Add more credits under Billing
- Check your usage limit hasn't been hit
Slow responses:
- GPT-6 Astra can be slower during high-load periods, and reasoning effort adds latency. Switch to
gpt-6-solor lower the reasoning effort temporarily. - Check OpenAI's status page for ongoing incidents.
Responses feel less capable than ChatGPT:
- Verify you're actually hitting
gpt-6-astraorgpt-6-sol, notgpt-6-luna - Check your SOUL.md — aggressive token limits in system prompts can degrade quality
Switching Between OpenAI and Other Providers
One of OpenClaw's strengths is that you can run multiple providers simultaneously and switch between them:
providers:
openai:
api_key: "sk-openai-key"
default_model: "gpt-6-sol"
anthropic:
api_key: "sk-ant-key"
default_model: "claude-sonnet-5"
This lets you fall back to Anthropic if OpenAI has an outage, or use different models for different task types.
Related reading:



