packages/kilo-docs/pages/ai-providers/openai.md
Kilo Code supports accessing models directly through the official OpenAI API.
Website: https://openai.com/
{% callout type="tip" %} Already have a ChatGPT Plus or Pro subscription? You can use it to access OpenAI's Codex models inside Kilo Code — no separate API key or pay-as-you-go charges needed. See the ChatGPT Plus/Pro provider page for setup instructions. {% /callout %}
{% tabs %} {% tab label="VSCode (Legacy)" %}
{% /tab %} {% tab label="VSCode" %}
Open Settings (gear icon) and go to the Providers tab to add OpenAI and enter your API key.
The extension stores this in your kilo.json config file. You can also edit the config file directly — see the CLI tab for the file format.
{% /tab %} {% tab label="CLI" %}
Set the API key as an environment variable or configure it in your kilo.json config file:
Environment variable:
export OPENAI_API_KEY="your-api-key"
Config file (~/.config/kilo/kilo.json or ./kilo.json):
{
"provider": {
"openai": {
"env": ["OPENAI_API_KEY"],
},
},
}
Then set your default model:
{
"model": "openai/gpt-4.1",
}
{% /tab %} {% /tabs %}
azure provider for Azure OpenAI, especially GPT-5 deployments. Do not configure Azure GPT-5 through a generic OpenAI-compatible custom provider.