Google AI Studio (Gemini) Free API
aistudio.google.comThe most generous permanent free tier for a frontier model.
Opens Google AI Studio (Gemini)’s official key page. You create and own the key — FreeLLMKeys never sees or stores it.
Quick facts
https://generativelanguage.googleapis.com/v1beta/openai/About Google AI Studio (Gemini)’s free API
Google AI Studio gives you a free API key for the Gemini family in a couple of clicks — no credit card, no billing account. It is the single most generous permanent free tier available for a frontier-class model, which is why it tops this list.
The free tier runs on a per-model daily quota (requests per minute and requests per day) rather than a credit balance, so it refreshes every day. Gemini 2.5 Flash is the best default: fast, cheap, multimodal, and with a 1M-token context window. Gemini 2.5 Pro is available on the free tier with tighter limits for harder reasoning tasks.
Gemini exposes an OpenAI-compatible endpoint, so you can keep your existing OpenAI SDK code and just swap the base URL and key. Note that on the free tier Google may use your prompts to improve its products — do not send sensitive data.
How to get a free Google AI Studio (Gemini) API key
- 1Go to the official key page: https://aistudio.google.com/apikey
- 2Create a free account — no credit card needed.
- 3Open the API keys section and generate a new key. Copy it somewhere safe.
- 4In your code, set the base URL to
https://generativelanguage.googleapis.com/v1beta/openai/and paste your key. - 5Call a model such as
gemini-2.5-flashusing the examples below.
Code examples
Replace YOUR_GOOGLE_AI_STUDIO_KEY with the key you created.
from openai import OpenAI
client = OpenAI(
base_url="https://generativelanguage.googleapis.com/v1beta/openai/",
api_key="YOUR_GOOGLE_AI_STUDIO_KEY"
)
resp = client.chat.completions.create(
model="gemini-2.5-flash",
messages=[{"role": "user", "content": "Hello!"}]
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://generativelanguage.googleapis.com/v1beta/openai/",
apiKey: process.env.API_KEY, // your free Google AI Studio (Gemini) key
});
const resp = await client.chat.completions.create({
model: "gemini-2.5-flash",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);curl https://generativelanguage.googleapis.com/v1beta/openai//chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "gemini-2.5-flash",
"messages": [{"role":"user","content":"Hello!"}]
}'Pros & cons
Pros
- Frontier-quality model for free
- Native 1M-token context
- Multimodal (image, audio, video, PDF)
- OpenAI-compatible endpoint
Cons
- Free-tier prompts may be used to improve products
- Daily caps can be hit on heavy use
Google AI Studio (Gemini) free API — FAQ
Is the Google AI Studio (Gemini) API really free?+
Yes. Google AI Studio (Gemini) offers free tier access: Permanent free tier with a daily request quota per model — no billing enabled required. No credit card is required to start.
How do I get a free Google AI Studio (Gemini) API key?+
Create a free account at https://aistudio.google.com/apikey, open the API keys section, generate a key, then set your base URL to https://generativelanguage.googleapis.com/v1beta/openai/ in your OpenAI-compatible code.
Which models does Google AI Studio (Gemini) offer for free?+
Gemini 2.5 Pro, Gemini 2.5 Flash, Gemini 2.5 Flash-Lite, Gemini 2.0 Flash, Gemini 2.0 Flash-Lite, Gemma 3.
What are the Google AI Studio (Gemini) free-tier rate limits?+
Gemini 2.5 Flash ≈ 10 RPM / 250 req per day (free tier).
Is Google AI Studio (Gemini) OpenAI-compatible?+
Yes. Google AI Studio (Gemini) exposes an OpenAI Chat Completions compatible endpoint, so you can reuse your existing OpenAI SDK code and only change the base URL and API key.
Popular free models on Google AI Studio (Gemini)
Related free LLM APIs
OpenRouter
One key, 300+ models — dozens are completely free.
Groq
The fastest free inference on the planet — 500+ tokens/sec.
Cerebras
Wafer-scale inference — frontier open models at record speed, free.