Getting the Free Gemini API in 2026 (3-min setup, no credit card)
AI 工具白嫖系列 — 把"免费但限速"的大模型 API 一次说清,顺便贴一张图给你看效果。
Google's Gemini API has had a free tier for a while, and in 2026 it's still the most generous
"no card required" option for indie devs. Here's the exact steps I use whenever I want a quick LLM
endpoint for a side project, scraping prototype, or Telegram bot.
1. Get the key
- Go to https://aistudio.google.com/app/apikey while signed in to any Google account.
- Click Create API key → Create key in new project.
- Copy the key. It starts with
AIzaSy….
Heads-up: this key is bound to the project, not the account. Don't paste it into client-side
code — proxy it.
2. Test it (curl)
curl -s "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$KEY" \
-H "Content-Type: application/json" \
-d '{"contents":[{"parts":[{"text":"Say hi in 6 words"}]}]}' | jq .candidates[0].content.parts[0].text
You should get back something like "Greetings, fellow human explorer."
3. Free-tier limits that actually matter
| Model | RPM | RPD | Notes |
|---|---|---|---|
| gemini-2.5-flash | 60 | 1k | Best price/perf for chat. |
| gemini-2.5-pro | 5 | 25 | Slow but strong; great for eval. |
| gemini-2.0-flash | 60 | 1k | Older; still fine for summaries. |
Numbers are correct as of writing; Google's docs are the source of truth if it changes.
4. When the free tier is not enough
- Switch to paid tier (still cheap, $0.075/M input for 2.5 Flash) at the same page.
- Or pair it with a local Ollama + Llama 3.2 3B for fallback when you hit 429.
- Don't hammer with retries — the rate limiter will block you for ~10 min.
That's it. Three minutes, one key, one curl. If you want a ready-made Node/Python wrapper
to cache responses to SQLite, let me know in the comments — happy to share mine.
Tags: #ai #gemini #apitutorial #freestuff

Top comments (0)