October 20252 min readJohan Bretonneau

How to Get Your Google Gemini API Key (AI Studio)
Access Gemini 2.0 Flash, Pro, and multilingual embeddings in minutes

Step-by-step guide to get your Google Gemini API key via AI Studio, what models it unlocks, and how to use it securely in production.

Google's Gemini API is accessible through two paths: AI Studio for developers starting out, and Vertex AI for production deployments on Google Cloud. For most teams, AI Studio is where you start - it's fast, free up to generous limits, and your key works immediately. This guide covers the AI Studio path.

Prerequisites

  • A Google account (personal or Workspace)
  • No credit card required for the free tier via AI Studio
  • For Vertex AI / production scale: a Google Cloud project with billing enabled

Step-by-step: creating your API key

  1. Go to aistudio.google.com → sign in with your Google account
  2. Click "Get API key" in the top left panel → select "Create API key in new project" (or choose an existing project)
  3. Your key is generated immediately - copy it now
  4. You can access your key again later at aistudio.google.com/app/apikey - unlike OpenAI and Anthropic, Google lets you view the key again after creation
  5. For production use on Vertex AI: go to console.cloud.google.com → APIs and Services → Credentials → Create credentials

What this key unlocks

With a Google Gemini API key, you have access to:

  • LLMs: Gemini 2.0 Flash, Gemini 2.0 Pro, Gemini 1.5 Pro, Gemini 1.5 Flash
  • Image generation: Imagen 3 (available via Vertex AI)
  • Embeddings: text-embedding-004, textembedding-gecko - excellent multilingual performance, a strong choice for semantic search across non-English content
  • Audio and video: multimodal input processing via Vertex AI

Gemini 2.0 Flash is particularly competitive on the price-to-performance ratio and supports a 1M token context window, which makes it relevant for document-heavy workloads.

Free tier and pricing

AI Studio offers a generous free tier: Gemini 2.0 Flash runs at 60 requests per minute with no charge. This is enough for development, testing, and many light production workloads. When you exceed the free limits or need SLA guarantees, billing moves to Google Cloud pay-as-you-go pricing. Prices are competitive, especially for Flash models.

Security - the non-negotiables

  • Never commit your key to git. Store it in a .env file and add .env to your .gitignore
  • Restrict by referrer or IP in the Google Cloud Console if your key is used in a browser-facing context
  • Rotate your key every 90 days, or immediately if you suspect exposure

Using this key with HiWay2LLM

You now have access to the Gemini model family. Instead of managing the Google SDK alongside your other provider integrations, bring your key to HiWay2LLM. You get unified routing across Gemini, Claude, GPT-4o, and 200+ models, real-time cost monitoring, budget controls, and fallbacks - all through a single OpenAI-compatible endpoint. One key to rule them all, one endpoint to route them.

Bring my key to HiWay2LLM →

Connect in 30 seconds

Share

Was this useful?

Comments

Be the first to comment.