Skip to main content
Watch: I Built an AI App Without Leaving Databricks

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

  1. Step 1.

    Create a key on the OpenAI Platform API keys page (https://platform.openai.com/api-keys) and copy it immediately.

  2. 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.

  3. Step 3.

    CLI: set the API key as an environment variable.

    Terminal
    export OPENAI_API_KEY="your-api-key"
  4. Step 4.

    Or configure it in your config file (~/.config/kilo/kilo.json or ./kilo.json).

    JSON
    {
      "provider": {
        "openai": {
          "env": ["OPENAI_API_KEY"],
        },
      },
    }
  5. 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.

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.

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.