API key, Codex login or Sign in with ChatGPT?
All three use the same provider name, openai, and the same model references such as openai/gpt-6-astra. What changes is who pays and which extra OpenAI tools work.
Codex login
- Sign in with your ChatGPT account. No API key.
- Uses your Codex allowance and shows quota in OpenClaw
- Device-code option for servers without a browser
- Models depend on what your plan offers
Platform API key
- Billed to your OpenAI Platform project
- Full access to images, voice, speech and embeddings
- Supports Fast mode and Admin usage reports
- Pay for every token, so set a budget
Sign in with ChatGPT
- Authorizes OpenClaw as its own app on your account
- Uses your Codex allowance
- No image generation, voice or embeddings yet
- Your workspace must have it enabled by OpenAI
Yes. The OpenClaw docs state that OpenAI explicitly supports subscription sign-in in external tools such as OpenClaw. Usage still counts against your plan's limits.
Which OpenAI sign-in fits you?
Connect with your ChatGPT account (Codex login)
Sign in
Run this on the computer running OpenClaw. It opens your browser to sign in to ChatGPT:
openclaw models auth login --provider openaiOn a server without a browser, use the device-code flow and approve it from your phone or laptop:
openclaw models auth login --provider openai --method device-codeThe setup wizard does the same: openclaw onboard --auth-choice openai. OpenClaw no longer imports logins from ~/.codex, so sign in through one of these.
Choose the model
openclaw config set agents.defaults.model.primary openai/gpt-6-astraNo runtime setting is needed. OpenClaw may run the turn through its bundled Codex app-server runtime, and it installs or repairs the Codex plugin when that happens. If your plan doesn't include Astra, pick another model from openclaw models list --provider openai.
Verify
openclaw models list --provider openai
# then, in a chat with your assistant:
/codex status
/status/status shows Runtime: OpenAI Codex when the Codex runtime is active.
Connect with an OpenAI Platform API key
Create a key
Create a key at platform.openai.com/api-keys, add credit, and set a project budget. Make a separate key for OpenClaw so you can revoke it on its own.
Run onboarding
export OPENAI_API_KEY="sk-..."
openclaw onboard --openai-api-key "$OPENAI_API_KEY"openclaw onboard --auth-choice openai-api-keyopenclaw models auth login --provider openai --method api-keyOnboarding saves the key as an openai auth profile, which agent turns use. The OPENAI_API_KEY variable alone is a fallback for other OpenAI features such as images and speech.
Pick a model and test
openclaw models list --provider openai
openclaw models set openai/gpt-6-astra
openclaw models status --probe --probe-provider openaiSign in with ChatGPT (SIWC)
SIWC authorizes OpenClaw as its own app on your ChatGPT account and spends your Codex allowance. Your account and workspace must have SIWC and token sharing enabled by OpenAI.
openclaw models auth login --provider openai --method siwc- Approve token sharing during sign-in. If you approve identity only, OpenClaw saves the account but can't run models with it.
- The browser returns to
http://localhost:8080/auth/callback. If your browser is on another computer, forward the port first:On your browser's computerssh -N -L 8080:127.0.0.1:8080 user@gateway-host - Check shared usage at ChatGPT Settings → Usage. OpenClaw doesn't show SIWC quota.
Function tools and web search work. OpenAI-hosted plugins, connected apps, hosted MCP tools and hosted image generation don't yet. SIWC also can't be used for image generation, transcription, speech or memory embeddings. Add a separate key or provider for those.
Choose a GPT model
Run openclaw models list --provider openai to see what your account can use. API projects and ChatGPT plans can offer different models.
| Model | Reference | Reasoning off? | API price in / out* |
|---|---|---|---|
| GPT-6 Astra default | openai/gpt-6-astra | No | $10 / $50 |
| GPT-6.1 Sol | openai/gpt-6.1-sol | No | $2 / $10 |
| GPT-6 Sol | openai/gpt-6-sol | Yes | $2 / $10 |
| GPT-6 Luna low cost | openai/gpt-6-luna | Yes | $0.10 / $0.50 |
| GPT-5.6 Sol / Terra / Luna | openai/gpt-5.6-sol, -terra, -luna | — | See OpenAI |
| GPT-5.5 | openai/gpt-5.5 | — | See OpenAI |
| ChatGPT Instant (moving alias) | openai/chat-latest | — | API key only |
*US dollars per million tokens at standard API rates, as listed in the OpenClaw docs. Check OpenAI's pricing page for current rates. GPT-6 models accept text and images and have a 1,050,000-token context window. OpenClaw uses 272,000 tokens of active input by default. For images, use openai/gpt-image-2.
If your account can't use the model you picked, you'll see OpenAI's access error. Choose another, for example openclaw models set openai/gpt-5.5. GPT-5.4 and GPT-5.4 Mini are retired on the ChatGPT route, and openclaw doctor --fix moves them to GPT-5.6 Terra and Luna.
OpenAI config builder
Build your OpenAI settings
Sign in first with the commands above. Then copy this into ~/.openclaw/openclaw.json and run openclaw gateway restart.
Check your real profile names with openclaw models auth list --provider openai and adjust the auth.order list to match. With a backup key, OpenClaw tries the plan first, then the key.
Set the reasoning effort
GPT-6 models default to medium effort. Change it from any chat:
/think high # harder problems
/think default # back to medium
/think ultra # lets OpenClaw split big jobs across sub-agents
/fast on # Fast mode (API key, higher price)/think offworks on GPT-6 Sol and Luna. Astra and GPT-6.1 Sol can't turn reasoning off./think ultraisn't a raw API setting. It's OpenClaw's orchestration mode, running at max effort.- A saved
minimalsetting becomeslow.
Images, voice and memory search
Not every OpenAI tool works with every sign-in. Here's what each one covers, according to the OpenClaw docs:
| Feature | API key | Codex login | SIWC |
|---|---|---|---|
| Chat, tools, web search | Yes | Yes | Yes |
| Image generation | Yes | With OpenClaw sign-in | No |
| Audio transcription | Yes | Depends on plan | No |
| Realtime voice | Yes | Some routes | No |
| Text-to-speech, memory embeddings | Yes | Separate key needed | Separate key needed |
Use OpenAI embeddings for OpenClaw's memory search:
{
memory: {
search: {
provider: "openai",
model: "text-embedding-3-small",
},
},
}Cost and usage tracking
Codex login shows your plan, quota windows and credit balance in OpenClaw.
Set OPENAI_ADMIN_KEY to see 30 days of actual cost in the Control UI Usage page. OPENAI_PROJECT_ID limits it to one project.
Above 272,000 input tokens, OpenAI bills the whole request at 2x input and 1.5x output rates.
Fast mode (formerly Priority processing) sends service_tier: "priority" and costs more. On GPT-5.6 Sol it's another 2x, so a long Fast request can cost 4x normal input. Keep it off unless speed really matters. More: OpenClaw running costs.
Fix common OpenAI connection problems
openclaw models status
openclaw models auth list --provider openai
openclaw doctor --fix
openclaw config validateNo usable OpenAI profileSign in again with openclaw models auth login --provider openai, then run openclaw models status --probe --probe-provider openai.
Old codex/… model refsopenclaw doctor --fix rewrites legacy codex/*, openai-codex/* and codex-cli/* refs to openai/*.
Model not availableYour account doesn't include it. Run openclaw models list --provider openai and pick one that's listed, for example openai/gpt-5.5.
Missing billingThe API key's organization has no credit. Top up at platform.openai.com/account/billing.
SIWC signed in but can't chatYou approved identity only. Sign in again and approve token sharing.
Sign-in page won't returnOn a remote server, use --method device-code, or forward port 8080 over SSH for SIWC.
More fixes: troubleshooting guide.
OpenAI and OpenClaw questions
Can I use my ChatGPT subscription with OpenClaw?
Yes. Run openclaw models auth login --provider openai and sign in with your ChatGPT account. OpenClaw then uses your Codex allowance. According to the OpenClaw docs, OpenAI explicitly supports subscription sign-in in external tools like OpenClaw.
Which OpenAI model does OpenClaw use by default?
Fresh setups use openai/gpt-6-astra with either an API key or a ChatGPT plan. Lower-cost options include GPT-6 Sol and GPT-6 Luna. Run openclaw models list --provider openai to see which models your account can use.
How do I connect OpenAI on a server without a browser?
Use the device-code flow: openclaw models auth login --provider openai --method device-code. Approve the code in a browser on any other device. Or use a Platform API key instead.
Do I still need an API key if I use Codex login?
Not for chat. You may want one for memory embeddings, text-to-speech or as a backup when your plan's allowance runs out. Add it with openclaw models auth login --provider openai --method api-key.
What is the difference between Codex login and Sign in with ChatGPT?
Both use your ChatGPT account and Codex allowance. Codex login uses the Codex product sign-in and supports image generation. Sign in with ChatGPT is a beta that authorizes OpenClaw as its own app, but it doesn't support image generation, voice or embeddings yet.
Can I use Azure OpenAI with OpenClaw?
Yes. The bundled openai provider can point at an Azure OpenAI resource. On Azure, model names are your deployment names. See the official OpenClaw Azure OpenAI page for setup.