AI Developer/Google AI Studio

Google AI Studio & Gemini Models

Personal notes on the Gemini ecosystem. What each model does, what it can handle, and what's free.


What is Google AI Studio

Google AI Studio is the browser-based IDE for Gemini. You can:

  • Chat with any Gemini model directly
  • Write and test system prompts
  • Generate API keys
  • Monitor usage and rate limits
  • Try image, audio, video, and code generation in one place
  • Export prompts as Python or JavaScript code with one click

Access it at: aistudio.google.com


Gemini Model Families

As of September 2026, Google runs two active Flash lines plus legacy 2.x models.

Gemini 3.x Flash (newest)

ModelAPI IDBest For
Gemini 3.8 Flashgemini-3.8-flashMost capable Flash, complex tasks, agentic workflows
Gemini 3.7 Flashgemini-3.7-flashHigh quality, complex coding and reasoning
Gemini 3.6 Flashgemini-3.6-flashBalanced speed and capability
Gemini 3.5 Flashgemini-3.5-flashNear-Pro intelligence at Flash cost
Gemini 3.5 Flash Litegemini-3.5-flash-liteFastest 3.5, high-throughput tasks
Gemini 3.1 Flash Litegemini-3.1-flash-liteMost cost-efficient, high-volume low-latency
Gemini 3 Flashgemini-3-flash-previewMultimodal general tasks
Gemini 3.1 Progemini-3.1-pro-previewFrontier-class reasoning

Gemini 2.5 (stable)

ModelAPI IDBest For
Gemini 2.5 Flashgemini-2.5-flashBest price/performance, reasoning-capable
Gemini 2.5 Flash Litegemini-2.5-flash-liteFastest and cheapest in 2.5 family
Gemini 2.5 Progemini-2.5-proDeep reasoning, complex coding

Specialized Models

ModelAPI IDCategory
Gemini 3.8 Flash (image)Nano Banana 2gemini-3.1-flash-image
Gemini 2.5 Flash TTSgemini-2.5-flash-preview-ttsText to speech
Gemini 3.1 Flash TTSgemini-3.1-flash-tts-previewText to speech
Gemini 3.5 Transcribegemini-3.5-transcribeSpeech to text
Gemini Embedding 1gemini-embedding-001Text embeddings
Gemini Embedding 2gemini-embedding-2-previewMultimodal embeddings
Veo 3veo-3-generate-previewVideo generation
Lyria 3lyria-3-pro-previewMusic generation
Antigravityantigravity-previewAutonomous coding agent
Deep Research Prodeep-research-previewMulti-step research agent

Features & API Functions (Free Tier Flash)

A summary of what you can do with Flash/Flash-Lite models — all available on the free tier. Note: Pro models have broader access (larger context, deeper reasoning), and other AI providers like OpenAI or Anthropic have entirely different APIs.

#FeatureWhat It DoesTierFunction
1Text Chat & ReasoningQ&A, writing, coding, translation, brainstormingFlash / Flash-LitegenerateContent()
2VisionSend images or screenshots, model describes the contentFlash / Flash-LitegenerateContent([image, text])
3Web Search GroundingPulls real-time info from Google before answering5,000 prompts/month (Gemini 3.x), over quota → billed per 1,000 promptsgenerateContent() + tools: [{ googleSearch: {} }]
4Function / Tool CallingModel can call custom functions you defineFlash / Flash-LitegenerateContent() + tools: [{ functionDeclarations }]
5Structured Output (JSON)Response comes back as structured JSON, easy to parseFlash / Flash-LitegenerateContent() + responseMimeType: "application/json"
6Long ContextContext window up to 1M tokens (~750K words)Flash models only — not all modelsgenerateContent() with long input
7Document UnderstandingRead and understand PDFs and other document filesFlash / Flash-LitegenerateContent([filePart, text]) via File API

Code examples

1. Text Chat

const result = await model.generateContent("Explain DeFi in 2 sentences.");
console.log(result.response.text());

2. Vision — send an image

const result = await model.generateContent([
  { inlineData: { mimeType: "image/jpeg", data: base64Image } },
  "What is in this image?",
]);

3. Web Search Grounding

const result = await model.generateContent({
  contents: [{ role: "user", parts: [{ text: "What is the ETH price today?" }] }],
  tools: [{ googleSearch: {} }],
});

4. Function Calling

const tools = [{
  functionDeclarations: [{
    name: "getTokenPrice",
    description: "Fetch token price from a DEX",
    parameters: {
      type: "object",
      properties: {
        symbol: { type: "string", description: "Token ticker, e.g. ETH" },
      },
      required: ["symbol"],
    },
  }],
}];

const result = await model.generateContent({
  contents: [{ role: "user", parts: [{ text: "What is the SOL price right now?" }] }],
  tools,
});
// Check result.response.functionCalls() for the called function name and args

5. Structured Output (JSON)

const model = genAI.getGenerativeModel({
  model: "gemini-2.5-flash",
  generationConfig: {
    responseMimeType: "application/json",
    responseSchema: {
      type: "object",
      properties: {
        name: { type: "string" },
        score: { type: "number" },
      },
    },
  },
});

const result = await model.generateContent("Give me the name and score of the best crypto project.");
const json = JSON.parse(result.response.text());

6. Long Context — send a large document

// Just pass the long text directly — Flash models handle up to 1M tokens
const result = await model.generateContent([
  longDocumentText,
  "Write an executive summary of this document.",
]);

7. Document Understanding — upload a PDF

import { GoogleAIFileManager } from "@google/generative-ai/server";

const fileManager = new GoogleAIFileManager(process.env.GEMINI_API_KEY!);
const uploadResult = await fileManager.uploadFile("./whitepaper.pdf", {
  mimeType: "application/pdf",
  displayName: "Whitepaper",
});

const result = await model.generateContent([
  { fileData: { mimeType: "application/pdf", fileUri: uploadResult.file.uri } },
  "What are the key points of this whitepaper?",
]);

What Each Model Can Do

Text and Chat

All Gemini Flash and Pro models support:

  • Multi-turn chat with history
  • Long context (up to 1M tokens on 2.5+)
  • System instructions
  • Function calling / tool use
  • Structured JSON output
  • Code generation and debugging
  • Reasoning and analysis
import { GoogleGenerativeAI } from "@google/generative-ai";

const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY!);
const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash" });

const result = await model.generateContent("Explain RAG in 3 sentences");
console.log(result.response.text());

Vision (Image Input)

Most Flash models accept images alongside text. Useful for: analyzing screenshots, reading charts, describing photos, OCR.

const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash" });

const result = await model.generateContent([
  { inlineData: { mimeType: "image/jpeg", data: base64Image } },
  "What is in this image?",
]);

Image Generation

Nano Banana models generate and edit images natively.

const model = genAI.getGenerativeModel({ model: "gemini-3.1-flash-image" });

const result = await model.generateContent(
  "A minimal dark logo for a crypto trading app"
);
// result contains generated image data

Audio: Text to Speech

Gemini TTS models generate natural speech. Supports multiple voices and expressive audio tags.

const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash-preview-tts" });

const result = await model.generateContent({
  contents: [{ parts: [{ text: "Hello, I'm Wayan Phantom." }] }],
  generationConfig: { responseModalities: ["AUDIO"] },
});

Audio: Speech to Text

Gemini 3.5 Transcribe handles speech-to-text with speaker diarization and word-level timestamps.

Video Generation

Veo 3 generates cinematic video from text prompts. Still in preview — not on free tier.

Embeddings

Convert text or images to vectors for semantic search and RAG.

const model = genAI.getGenerativeModel({ model: "gemini-embedding-001" });
const result = await model.embedContent("What is DeFi?");
const vector = result.embedding.values; // float[]

Free Tier Rate Limits (Real Data)

These are the actual limits on the free tier from my API key as of September 2026. RPM = requests/minute, TPM = tokens/minute, RPD = requests/day.

ModelRPMTPMRPD
Gemini 3.8 Flash5250K20
Gemini 3.7 Flash5250K20
Gemini 3.6 Flash5250K20
Gemini 3.5 Flash5250K20
Gemini 3.5 Flash Lite15250K500
Gemini 3.1 Flash Lite15250K500
Gemini 3 Flash5250K20
Gemini 2.5 Flash5250K20
Gemini 2.5 Flash Lite10250K20
Gemini 2.5 Flash TTS310K10
Gemini 3.1 Flash TTS310K10
Gemini 3.5 Transcribe310K25
Gemini Embedding 110030K1K
Gemini Embedding 210030K1K
Antigravity Agent60100K100
Gemma 4 26B3016K14.4K
Gemma 4 31B3016K14.4K

Not on free tier (0/0 limits): Gemini 2.5 Pro, Gemini 3.1 Pro, Veo 3, Lyria 3, Nano Banana image models, Gemini Omni.


Model Selection Guide

Need fast chat responses?      → gemini-2.5-flash or gemini-3.5-flash
Need most capable?             → gemini-3.8-flash or gemini-3.1-pro
Need cheapest/most quota?      → gemini-3.5-flash-lite or gemini-3.1-flash-lite
Need image understanding?      → any flash model (pass image as input)
Need image generation?         → gemini-3.1-flash-image (Nano Banana 2)
Need voice output?             → gemini-2.5-flash-preview-tts
Need speech to text?           → gemini-3.5-transcribe
Need embeddings for RAG?       → gemini-embedding-001
Need autonomous coding?        → antigravity-preview
Need deep research?            → deep-research-preview

Fallback Chain for Production

Since free tier limits are low (20 RPD on most models), use a fallback chain so your app doesn't break when quota runs out.

const MODEL_CHAIN = [
  "gemini-2.5-flash",       // fastest, most reliable
  "gemini-2.5-flash-lite",  // cheaper fallback
  "gemini-3.5-flash",
  "gemini-3.1-flash-lite",  // highest RPD (500/day)
];

The chatbot on this portfolio uses this exact pattern. See LLM Stack for the full implementation.


Last updated: September 2026. Rate limits sourced from my own Google AI Studio API key. Free tier limits change — check ai.google.dev for current limits.

Last updated · September 2026