首页 AI How to Get a Gemini API Key in Google AI Studio (2026): Step-by-Step, Auth Keys vs Standard Keys, Projects, Billing and Fixes

How to Get a Gemini API Key in Google AI Studio (2026): Step-by-Step, Auth Keys vs Standard Keys, Projects, Billing and Fixes

Get a Gemini API key in Google AI Studio step by step: default projects, importing Cloud projects, the new authorization keys, paid tier billing and common errors.

Last updated: 13 November 2026. All prices checked on the vendors’ official pages that day.

The fastest way to get a Gemini API key is in Google AI Studio. For new users it takes a few minutes: accept the terms, and AI Studio creates a Google Cloud project and a key for you. For companies that already use Google Cloud, a few extra steps apply. Google also changed how keys work in 2026, so older tutorials are out of date. This guide follows Google’s current Gemini API key documentation, checked on 13 November 2026.

Prices for the models you will call are in Gemini API pricing. Chinese-language readers can use our 繁體中文 Gemini API Key 申請教學.

Check availability first

Google AI Studio and the Gemini API are only available in Google’s listed regions (Singapore and Taiwan are on the list, for example). If AI Studio does not open, your region may not be supported. The account holder must also meet Google’s age and terms requirements.

How to get a Gemini API key in Google AI Studio

How to get a Gemini API key in Google AI Studio in six steps
  1. Open Google AI Studio’s API keys page: aistudio.google.com/apikey, and sign in with a Google account (preferably a company Google Workspace account).
  2. New users: after you accept the Terms of Service, AI Studio automatically creates a default Google Cloud project and an API key. You can rename the project under Projects.
  3. Existing Google Cloud users: AI Studio does not create a default project. Open the Dashboard, select Projects, click Import projects, choose your Cloud project and import it.
  4. Create the API key in that project. Since 28 May 2026, new keys created in AI Studio are authorization keys bound to a service account.
  5. Store the key as an environment variable. The Gemini client libraries read GEMINI_API_KEY or GOOGLE_API_KEY (if both are set, GOOGLE_API_KEY wins).
  6. Enable billing when you are ready for production: link a billing account and prepay at least $5 to move from the Free tier to the Paid tier.
export GEMINI_API_KEY="YOUR_API_KEY"
curl "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Api-Revision: 2026-05-20" \
  -X POST -d '{"model": "gemini-4-hydrogen", "input": "Explain how AI works in a few words"}'

Auth keys vs standard keys: what changed in 2026

Authorization (auth) keyStandard key
Bound toA Google Cloud service accountA Google Cloud project
Default for new keysYes, since 28 May 2026No
Access controlGranular (service account identity)Coarse (no caller identity)
ScopeGemini API only by defaultMust be restricted, or requests are rejected
Leak protectionFast leaked-key enforcementManual: restrict and rotate
Gemini API authorization keys vs standard API keys compared

The practical impact: if you have an old, unrestricted standard key in production, requests will be rejected. Either restrict it to the Gemini API in the Google Cloud console or create a new authorization key. Note that requests authenticated by auth keys are not recorded in the service account usage metrics in Cloud; use AI Studio’s Usage page instead.

Free tier vs paid tier for your key

  • Free tier: limited models and rate limits; Google uses free-tier content to improve its products.
  • Paid tier: higher limits, context caching, Batch API at 50% off, access to Gemini 4 Carbon and Argon, and your content is not used to improve Google’s products.
  • Billing tiers: Tier 1 (billing linked, $250 cap), Tier 2 ($100 paid + 3 days, $2,000 cap), Tier 3 ($1,000 paid + 30 days, $20,000–$100,000+ cap). Details in Google’s billing guide.

Troubleshooting

ProblemCauseFix
“You do not have permission to create a key”Missing IAM permissions on the projectAsk for a role such as Project Editor, or use a project outside the organisation
Request rejected with a standard keyKey is unrestrictedRestrict it to the Gemini API or create a new auth key
Free tier not available on projectProject made outside AI Studio needs verificationComplete project verification
Region not supportedAccount or traffic outside listed regionsUse an entity in a listed region; no workarounds
Quota or 429 errorsFree-tier limits or billing tier capSet up billing and prepay; tiers rise with spend
Common Gemini API key errors in Google AI Studio and how to fix them

Secure your Gemini API key

  • Never commit keys to source control.
  • Never ship keys in web or mobile apps; call Gemini from a backend.
  • Add IP or application restrictions in the Google Cloud console.
  • Use separate projects (and keys) for development and production.
  • Rotate keys and delete unused ones.

Using Gemini with GPT and Claude

Many teams use Gemini for long-context or multimodal tasks and another vendor for the rest. Compare prices in our LLM API pricing comparison and see the key guides for OpenAI and Claude. PandaWM helps companies run Gemini under their own Google Cloud billing account (or one owned by a legitimately established overseas entity), or alongside other models through one compliant unified API: Overseas AI Token service: account setup + API access (PandaWM).

FAQ

Is a Gemini API key free?

Yes, creating a key is free and the Free tier lets you try some models at no cost within limits. Paid usage requires billing.

Where is my Gemini API key?

On the API keys page in Google AI Studio (aistudio.google.com/apikey), listed by project.

Why does my old Gemini key stop working?

The Gemini API now rejects unrestricted standard keys. Restrict the key to the Gemini API or create a new authorization key.

Can I use a Gemini API key in a browser app?

Not safely in production. Route requests through your backend.

Which environment variable does the SDK use?

GEMINI_API_KEY or GOOGLE_API_KEY; GOOGLE_API_KEY takes precedence if both are set.

Can PandaWM create a Gemini key for us?

We do not sell or share keys. We help your company set up its own project, billing and keys, or connect through a compliant unified API.

Compliance note: Each model vendor only serves customers in its supported countries and regions and requires accurate account, identity and billing information. PandaWM helps companies use AI models through their own accounts or overseas entities that are legitimately established in supported regions, or through a compliant unified API. We do not sell, rent, share or transfer accounts or API keys, and we do not help anyone bypass regional restrictions, KYC, sanctions or payment controls. We are not an official partner or reseller of OpenAI, Anthropic, Google or any other vendor. Prices on this page are the vendors’ public list prices, not PandaWM prices.

Related guides

Talk to PandaWM about overseas AI Token access

Tell us which models you need (GPT, Claude, Gemini or others), your expected monthly token volume, where your company and any overseas entity are registered, and whether you prefer your own vendor accounts or one unified API. We help companies open and manage their own official accounts (billing, keys, usage controls) or connect through a compliant unified API. We do not sell, rent or share accounts, and we are not an official reseller of any model vendor.

WhatsApp: +852 5904 8602Telegram: @PANDA0134WeChat: szcwh99

PandaWM WeChat QR code szcwh99

Official sources

All official pages checked on 2026-11-13. Prices are in USD per 1 million tokens (MTok), before tax. Vendors change prices; the official pages prevail.

本文来自网络,不代表熊猫出海立场。转载请注明出处: https://www.pandawm.com/blog/get-gemini-api-key-google-ai-studio-guide-2026-en.html
上一篇
下一篇

作者: 熊猫出海编辑团队

熊猫出海(PandaWM)编辑团队,来自香港出海服务商熊猫出海,专注 Facebook、TikTok、Google 等海外广告开户与代投,以及 GEO/AI 搜索优化、多语言独立站建设。有Facebook白名单牌照户、TikTok加白户、Google G2认证户等核心资源 。

为您推荐

发表回复

联系我们

联系我们

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部