Setup guide - Documented by Zed
Use Gemini in Zed
Zed's Google AI provider takes a Gemini API key (or GEMINI_API_KEY), and custom Gemini model ids can be added under language_models.google.available_models.
Last verified 3 steps3 official sources
Steps
- Step 1.
Go to Google AI Studio and create an API key.
- Step 2.
Open Agent Settings with agent::OpenSettings and go to the Google AI section. Enter your Google AI API key. Zed reads GEMINI_API_KEY, falling back to GOOGLE_AI_API_KEY, from the local Zed process environment.
- Step 3.
Optional: add custom Google AI models when you need a specific Gemini model version. Zed's documented example is below; add an entry with a current id such as gemini-3.8-flash the same way.
JSON{ "language_models": { "google": { "available_models": [ { "name": "gemini-3.1-pro-preview", "display_name": "Gemini 3.1 Pro", "max_tokens": 1000000, "mode": { "type": "thinking", "budget_tokens": 24000 } }, { "name": "gemini-3-flash-preview", "display_name": "Gemini 3 Flash (Thinking)", "max_tokens": 1000000, "mode": { "type": "thinking", "budget_tokens": 24000 } } ] } } }
Caveats
- This applies to the Zed Agent and other Zed-owned AI features (Inline Assistant, commit generation, thread summaries). It does not apply to External Agents or Terminal Threads, which handle their own model access.
- Adding gemini-3.8-flash or gemini-4-argon as custom entries combines Zed's documented available_models mechanism with Google's model ids. Zed's example lists only gemini-3.1-pro-preview and gemini-3-flash-preview.
More setup guides
Same tool, other providers
Related reading
- Do Your Agent Hooks Fail Open? Claude Code vs Codex vs Cursor vs Gemini CLIA guard hook that crashes, times out or points at a missing script lets the tool call through by default in Claude Code. v2.1.295 adds onFailure: block. Here is what each coding agent does when your policy hook breaks, with real test runs.
- Google AI Pro vs Gemini API: What Developers Actually GetGoogle AI Pro costs $19.99 a month and has no API key, but includes $10 of monthly Cloud credits. When the subscription wins and when to pay per token.
- How to Keep API Keys Away From Your AI Coding Agent: Claude Code vs Codex vs Cursor vs Gemini CLIA deny rule on .env stops cat but not a Python one-liner. Here are the three layers that actually keep secrets out of a coding agent's context - file rules, environment scrubbing and credential masking - and what Claude Code, Codex, Cursor and Gemini CLI give you for each, with real test runs.
- Google Gemini Agent: Coworker Agents With Their Own EmailGoogle's Gemini agent can create coworker agents with their own Workspace account, email and audit trail. What Google announced and what builders should copy.
- Gemini 4 Argon: What Developers Can Actually UseGemini 4 Argon for developers: what Google shipped, what is verified, why access starts narrow, and what to watch before planning a migration around it.
- Gemini 3.8 Live and 3.8 Live Extended Thinking: Google's Audio-to-Audio Voice Models, Benchmarked and PricedGemini 3.8 Live and 3.8 Live Extended Thinking are Google's audio-to-audio voice models with background tool calls. Benchmarks, pricing and how to build.
FAQ
How do I use Gemini in Zed?
Zed's Google AI provider takes a Gemini API key (or GEMINI_API_KEY), and custom Gemini model ids can be added under language_models.google.available_models.
Which Gemini model ids work in Zed?
The official docs read for this guide list gemini-4-argon, gemini-3.8-flash, gemini-3.6-flash, gemini-3.1-pro-preview, gemini-3-flash-preview and gemini-2.5-pro.
Is this an official Gemini and Zed setup?
Zed documents this setup in its own docs. It was last checked against 3 official pages on October 17, 2026.
Sources
Last verified against 3 official pages.
- raw.githubusercontent.comhttps://raw.githubusercontent.com/zed-industries/zed/main/docs/src/ai/use-api-access.md
- raw.githubusercontent.comhttps://raw.githubusercontent.com/zed-industries/zed/main/docs/src/ai/llm-providers.md
- ai.google.devhttps://ai.google.dev/gemini-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.