AI Token Price

How to Get a Gemini API Key: Free Tier, Prices and Limits

A Gemini API key takes a couple of minutes and starts on a free tier. The details that catch people out come later: which models are free, what happens to your data, and the prepaid balance that switches every key off when it hits zero.

Guide Published 6 min read By AI Token Price

Short answer: sign in to Google AI Studio with a Google account and accept the terms. New users get a Google Cloud project and an API key created for them. That key works straight away on the free tier for models such as Gemini 4 Hydrogen and Gemini 3.8 Flash. To use Gemini 4 Carbon, Argon or Neon, or to keep Google from using your prompts, set up billing and prepay at least $5. Per 1M input and output tokens, Gemini 4 Hydrogen costs $1.50 / $7.50 and Gemini 4 Neon $3.00 / $15.00.

How to get a Gemini API key, step by step

  1. Open Google AI Studio at aistudio.google.com/apikey and sign in with a Google account.
  2. Accept the Terms of Service. If you've never used Google Cloud, AI Studio creates a default project and an API key for you.
  3. Copy the key from the API Keys page. To make another one, click Create API key and choose a project.
  4. Already use Google Cloud? AI Studio won't create a default project. Open Dashboard, then Projects, then Import projects, and pick the project to use. Imported projects may need to be verified before they can use the free tier.
  5. Store the key as an environment variable named GEMINI_API_KEY. Google's code libraries read it automatically. (If GOOGLE_API_KEY is also set, that one wins.)

If the Create API key button is greyed out with "You do not have permission to create a key in this project", the project belongs to an organisation that hasn't given you the right role. Ask its administrator, or create a new project outside the organisation.

Keep the key private. Since 28 May 2026, new keys made in AI Studio are "authorization keys" tied to a service account, and Google says it quickly blocks keys it detects as leaked. The Gemini API also rejects older standard keys that have no restrictions. Never put a key in a website or a public repository.

Make your first call

Install Google's library (pip install -U google-genai for Python, npm install @google/genai for JavaScript), then:

from google import genai

client = genai.Client()  # reads GEMINI_API_KEY
interaction = client.interactions.create(
    model="gemini-4-hydrogen",
    input="Explain how AI works in a few words"
)
print(interaction.output_text)

That's Google's own quickstart example. Swap the model name for gemini-3.8-flash, gemini-4-neon or another model ID from the table below. You can also try every model in AI Studio's chat window before writing any code; on the free tier that costs nothing.

What the free tier covers

New keys start on the free tier. These models are free within rate limits:

  • Text: Gemini 4 Hydrogen, Gemini 3.8 Flash, Gemini 3.6 Flash and the Flash-Lite models.
  • Other: the embedding models, Gemini text to speech and transcription, and Gemini Decision 1.
  • Not free: Gemini 4 Carbon, Gemini 4 Argon, Gemini 4 Neon, Gemini 3.1 Pro, and the image and video models (Nano Banana, Gemini Omni). These need billing.

Two catches. First, on the free tier Google may use your prompts and responses to improve its products; on the paid tier it doesn't. Fine for experiments, not for customer or company data. Second, rate limits (requests per minute, tokens per minute and requests per day) apply per project, not per key, so extra keys in the same project don't add capacity. Your current limits are on AI Studio's rate limit page.

See how Google's free tier compares with other providers' on our free AI APIs page.

Turning on billing: prepaid credit and tiers

To leave the free tier, open the API Keys or Projects page in AI Studio and click Set up billing next to the project. You link a Google billing account and, for most accounts, prepay at least $5 of credit. Usage then comes off that balance in near real time.

  • When the balance hits $0, every key stops at once. All keys in every project on that billing account fail with an HTTP 402 error until you add credit. Turn on auto-reload if anything in production depends on Gemini.
  • Credits expire after 12 months and aren't refundable, so don't buy far more than you'll use.
  • Prepaid credit is for the Gemini API only. It can't pay for other Google Cloud services.
  • Some accounts are on Postpay instead, billed after use. AI Studio's Billing page shows which plan you're on.
TierHow you reach itMonthly cap on the billing account
FreeAn active project; some need verificationNone (free models only)
Tier 1Link a billing account$250
Tier 2$100 paid, and 3 days since your first payment$2,000
Tier 3$1,000 paid, and 30 days since your first payment$20,000–$100,000+

From Google's Gemini API billing page, checked 26 November 2026. You move up tiers automatically. Tier 1 also caps spending at $10 in any 10 minutes, and Tiers 2 and 3 at $200.

You can also set your own monthly spend cap per project on AI Studio's Spend page. Google calls the feature experimental: usage can run over the cap for about 10 minutes, and long batch jobs and agent sessions can overshoot it.

What the Gemini API costs

You pay per token, with output (including the model's thinking) costing more than input. Current prices per 1M input and output tokens:

ModelInput / output per 1MFree tier
Gemini 3.5 Flash-Lite$0.30 / $2.50Yes
Gemini 3.8 Flash$0.75 / $3.75Yes
Gemini 4 Hydrogen$1.50 / $7.50Yes
Gemini 4 Neon$3.00 / $15.00No
Gemini 4 Argon$2.00 / $10.00No
Gemini 4 Carbon$2.00 / $10.00No

Two prices are about to change. Gemini 4 Argon and Carbon cost an introductory $2 / $10 until 30 November 2026, then $4 / $20. Gemini 3.8 Flash costs $0.75 / $3.75 until 31 December 2026, then $1.50 / $7.50, the same as Gemini 4 Hydrogen. Batch requests are half price on all of these.

What a month of use costs, for an app sending 9M input and 1.2M output tokens:

ModelInput / output per 1MPer month
Gemini 3.5 Flash-Lite$0.30 / $2.50$5.70
Gemini 3.8 Flash$0.75 / $3.75$11.25
Gemini 4 Hydrogen$1.50 / $7.50$22.50
Gemini 4 Argon$2.00 / $10.00$30.00
Gemini 4 Carbon$2.00 / $10.00$30.00
Gemini 4 Neon$3.00 / $15.00$45.00

9M input and 1.2M output tokens a month. Prices checked 18–23 Nov 2026; this table updates automatically.

Grounding answers with Google Search is free for the first 5,000 searches a month across Gemini 3 and newer models, then $14 per 1,000. Our agent tool pricing page compares that with other providers' search fees.

Other ways to use Gemini

  • The Gemini app and Google AI subscriptions (AI Plus, AI Pro and AI Ultra) cover chatting with Gemini and Google's own tools. They don't include API usage, which is billed separately.
  • Google Cloud's Gemini Enterprise Agent Platform (formerly Vertex AI) sells Gemini models with enterprise terms and its own price list, billed through your normal Google Cloud account. Gemini API prepaid credit can't be spent there. Choose it if your company already runs on Google Cloud; otherwise an AI Studio key is simpler.
  • Google's Antigravity coding tool is free to start, with higher limits on Google AI Pro and Ultra; see our AI coding plans comparison.

Questions

Is the Gemini API free?

Partly. Gemini 4 Hydrogen, Gemini 3.8 Flash, the Flash-Lite models and several others are free within rate limits, but Google may use free-tier prompts to improve its products. Gemini 4 Carbon, Argon and Neon are paid only.

How much does a Gemini API key cost?

The key itself is free. You pay only for paid-tier usage, per token, from a prepaid balance (minimum $5). Gemini 4 Hydrogen costs $1.50 / $7.50 per 1M input and output tokens.

Does Google AI Pro include the Gemini API?

No. Google AI subscriptions cover the Gemini app and Google's tools; API usage is billed separately through AI Studio or Google Cloud.

Why did my Gemini API key stop working?

On the paid tier, the usual reason is a prepaid balance of $0: every key on the billing account then returns HTTP 402 until you add credit. Other causes are a leaked key that Google has blocked, an older standard key with no restrictions, or hitting the free tier's rate limits.

Can I use one key for several apps?

Yes, but rate limits and billing are per project, not per key. Separate projects, each with its own key and spend cap, keep one app from using up another's limits.

Sources: Google's Gemini API documentation on API keys, billing, rate limits, the quickstart and pricing, read 26 November 2026. Prices in the tables update automatically.

Which Gemini model should you use? Compare every Gemini model's price, free-tier status and capability score. See Gemini API pricing

Prices in this article come from each provider’s pricing page or, for open-weight models sold by other hosts, the cheapest host listed on OpenRouter. Live prices are always on the price table; tables marked “updates automatically” use current data.

More guides

All guides