How to get a Gemini API key
Updated · 2 min read
A Gemini API key lets apps use Google's Gemini models under your own Google Cloud project. It is the easiest key to start with, because Google offers a free tier for several models, so you can try BYOK apps before paying anything.
Step by step
- Open Google AI Studio at aistudio.google.com/apikey and sign in with your Google account.
- Create an API key. Every key belongs to a Google Cloud project. New users get a default project; if you already have Cloud projects, import one into AI Studio first.
- Restrict the key to the Gemini API. Google rejects unrestricted standard keys for Gemini, and a restricted key limits the damage if it leaks.
- Copy the key and paste it into the app, usually under Providers → Google or Gemini.
Free tier: what you get
On 2026-10-23, Google listed a free tier for these models (among others): Gemini 3.8 Flash, 3.6 Flash, 3.5 Flash-Lite, 3.1 Flash-Lite, 2.5 Pro, 2.5 Flash and 2.5 Flash-Lite, plus several audio, speech and embedding models. Gemini 3.1 Pro Preview has no free tier.
Free-tier usage is capped by requests per minute, tokens per minute and requests per day. Google shows your exact limits in AI Studio; daily limits reset at midnight Pacific time. Limits apply per project, not per key.
The trade-off is data: on the free tier, Google says your content is used to improve its products for most models. On the paid tier it is not. Use the free tier for experiments and public material, and switch to paid for anything private.
Paid prices
Prices per million tokens on Google's pricing page, 2026-10-23 (standard tier):
| Model | Input | Output |
|---|---|---|
| Gemini 3.1 Pro Preview | $2.00 | $12.00 (prompts up to 200K tokens) |
| Gemini 3.8 Flash | $0.75 | $3.75 (until 2026-12-31; $1.50 / $7.50 from 2027-01-01) |
| Gemini 3.5 Flash-Lite | $0.30 | $2.50 |
A chat turn of about 2,000 tokens in and 500 out costs roughly $0.003 with 3.8 Flash and $0.010 with 3.1 Pro Preview. Batch requests are half price.
To go paid, set up billing in AI Studio and link an active billing account to the project (Tier 1). Higher tiers follow as you spend more.
Keep the key safe
- Never put the key in client-side code of a website or mobile app you publish; Google recommends a backend proxy for that. Pasting it into a desktop app or extension you use yourself is fine.
- Keep keys out of Git and shared documents.
- Add API restrictions and set up billing alerts in Google Cloud once you enable billing.
- One project per purpose if you want separate limits and bills.
Apps that work with your Gemini API key

VisitAnythingLLM
Free · macOS, Windows, Linux · Open source
Private AI app for chatting with your documents. Runs local models or connects to OpenAI, Anthropic, Gemini and others with your key.
Works with:OpenAIAzure OpenAIAnthropicGoogle Gemini+9 more





Gemini through other routes
You can also reach Gemini models through OpenRouter with one key for many providers, or through Google Vertex AI if your company already uses Google Cloud. For other free options, see free AI API keys.
Questions
Is the Gemini API free?
Yes, within limits. Several Gemini models (including Flash, Flash-Lite and 2.5 Pro) have a free tier with per-minute and per-day request limits. Some newer models, such as Gemini 3.1 Pro Preview, have no free tier.
Does Google use my prompts on the free tier?
Google's pricing page says content sent on the free tier is used to improve Google's products for most models; on the paid tier it is not. Don't send confidential material through a free-tier key.
Are rate limits per key?
No. Gemini rate limits apply per Google Cloud project, so several keys in the same project share one limit. Daily limits reset at midnight Pacific time.
How do I move to the paid tier?
Set up billing in Google AI Studio and link an active billing account to the project. Moving from Free to Tier 1 usually takes effect right away.
Sources
Checked against the providers' own documentation on 2026-10-23. Prices and limits change; the links below have the current figures.