Setup guide - Documented by Kilo Code
Use OpenAI in Kilo Code
Kilo Code supports the official OpenAI API with an API key in both the VS Code extension (Settings > Providers) and the CLI (OPENAI_API_KEY or kilo.json). A separate ChatGPT subscription connection is also documented.
Last verified 5 steps2 official sources
Steps
- Step 1.
Create a key on the OpenAI Platform API keys page (https://platform.openai.com/api-keys) and copy it immediately.
- Step 2.
VS Code: open Settings (gear icon), go to the Providers tab, add OpenAI and enter your API key. The extension stores this in your kilo.json config file.
- Step 3.
CLI: set the API key as an environment variable.
Terminalexport OPENAI_API_KEY="your-api-key" - Step 4.
Or configure it in your config file (~/.config/kilo/kilo.json or ./kilo.json).
JSON{ "provider": { "openai": { "env": ["OPENAI_API_KEY"], }, }, } - Step 5.
Then set your default model. Kilo's docs example uses openai/gpt-4.1; substitute a current OpenAI model id in the same provider/model format.
JSON{ "model": "openai/gpt-4.1", }
Caveats
- Kilo's own example model is openai/gpt-4.1; the openai/gpt-6.* ids combine Kilo's documented provider/model format with model ids from OpenAI's catalog.
- An OpenAI API key uses your OpenAI Platform billing account, not your ChatGPT subscription; the ChatGPT subscription is a separate connection.
- Use Kilo's native azure provider for Azure OpenAI rather than a generic OpenAI-compatible provider.
More setup guides
Same tool, other providers
Related reading
- Codex CLI 0.163: Instant Steering Is Now the DefaultCodex CLI 0.163.0 makes mid-response steering the default and adds searchable /config and a leader key. What changed and what to check before upgrading.
- Tool Calling Under the Hood: Claude Messages vs OpenAI ResponsesHow tool calling works on the wire: JSON schema tools, parallel calls, tool_choice, strict mode and streaming deltas in Claude Messages vs OpenAI Responses.
- Codex 'gpt-5.5 Model Is Not Supported' Error: The FixCodex says gpt-5.5 is not supported with a ChatGPT account because OpenAI retired it from ChatGPT sign-in on October 14. The fix and what still works.
- Codex CLI Background Daemon: How to Turn It OffCodex CLI starts a persistent, self-updating background daemon since 0.157.0. What it does, why it hit Hacker News and the reported workaround to turn it off.
- Codex CLI 0.162: Managed Worktrees and Pinned TasksCodex CLI 0.162 lets the agent create and list its own Git worktrees, adds pinned tasks and custom provider capability overrides. What to change this week.
- ChatGPT Free vs Go vs Plus After GPT-6: Which Model You GetFree and Go ($8) both get GPT-6 Luna in Chat. Plus ($20) is the cheapest plan with GPT-6 Sol and full Codex. What each ChatGPT plan buys now.
FAQ
How do I use OpenAI in Kilo Code?
Kilo Code supports the official OpenAI API with an API key in both the VS Code extension (Settings > Providers) and the CLI (OPENAI_API_KEY or kilo.json). A separate ChatGPT subscription connection is also documented.
Which OpenAI model ids work in Kilo Code?
The official docs read for this guide list openai/gpt-6.1-sol, openai/gpt-6-astra and openai/gpt-6-luna.
Is this an official OpenAI and Kilo Code setup?
Kilo Code documents this setup in its own docs. It was last checked against 2 official pages on October 17, 2026.
Sources
Last verified against 2 official pages.
- kilo.aihttps://kilo.ai/docs/ai-providers/openai
- developers.openai.comhttps://developers.openai.com/api/docs/models
Newsletter
New models, set up the day they ship
One email per week. New model releases, the coding tools that support them and how to wire them up.