packages/kilo-docs/pages/ai-providers/gemini.md
Kilo Code supports Google's Gemini family of models through the Google AI Gemini API.
Website: https://ai.google.dev/
Google AI Studio creates auth keys by default. Kilo sends these keys in the x-goog-api-key header required by the Gemini API. An auth key is not an OAuth access token, so you do not need to configure OAuth.
Google began rejecting unrestricted Standard keys on June 19, 2026. If Gemini returns Request had invalid authentication credentials, open the key in Google AI Studio and check its type and status. Replace a Standard key with a new auth key. If the rejected key is already an auth key, check its Gemini API access or create a replacement before updating Kilo.
You can temporarily keep a Standard key working by restricting it to the Gemini API (generativelanguage.googleapis.com), but Google will reject all Standard keys in September 2026. See Google's Gemini API key documentation for restriction and migration steps.
{% tabs %} {% tab label="VSCode" %}
Open Settings (gear icon) and go to the Providers tab to add Google Gemini 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 GOOGLE_GENERATIVE_AI_API_KEY="your-api-key"
Config file (~/.config/kilo/kilo.json or ./kilo.json):
{
"provider": {
"google": {
"env": ["GOOGLE_GENERATIVE_AI_API_KEY"],
},
},
}
Then set your default model:
{
"model": "google/gemini-2.5-pro",
}
{% /tab %} {% /tabs %}
gemini-embedding-001 model is specifically supported for codebase indexing, providing high-quality embeddings for semantic code search.