Google AI Studio
& Gemini API
The complete developer reference. Every model, endpoint, and price verified against live Google documentation on Sep 1, 2026.
Audit Log
Breaking since the last guide: Gemini 2.0 Flash and Flash-Lite are fully shut down. Veo 3 GA endpoints retired June 30. The Nano Banana preview image endpoints are gone. The Interactions API legacy schema was removed June 8. Update model strings before deploying.
Gemini Omni Flash goes GA
gemini-omni-1.1-flash released, graduating the June preview. Natively multimodal video generation and conversational video editing from text, image, and video inputs.
Imagen 4 family shut down
imagen-4.0-generate-001, imagen-4.0-ultra-generate-001, and imagen-4.0-fast-generate-001 are gone. Migrate to the Nano Banana models: gemini-3-pro-image, gemini-3.1-flash-image, or gemini-3.1-flash-lite-image.
Gemini 3.7 Flash GA
The most intelligent workhorse model. 1M-token context, 64k max output, and tunable thinking levels (low, medium, high). Introductory pricing of $0.75 / $3.75 per 1M tokens runs through Dec 31, 2026, then rises to $1.50 / $7.50.
Gemini 3.6 Flash + 3.5 Flash-Lite GA
Stable, production-ready releases. 3.6 Flash shares 3.7 Flash's introductory pricing and built-in tool suite; 3.5 Flash-Lite lands at $0.30 / $2.50.
Omni Flash preview + Nano Banana 2 Lite GA
gemini-omni-flash-preview opened for multimodal video generation, and gemini-3.1-flash-lite-image went GA as the ultra-low-latency image tier at $0.0336 per 1K image.
Veo 2 and Veo 3 retired
veo-2.0-generate-001, veo-3.0-generate-001, and veo-3.0-fast-generate-001 shut down. Migrate to veo-3.1-generate-preview, veo-3.1-fast-generate-preview, or veo-3.1-lite-generate-preview.
Image preview endpoints retired
gemini-3.1-flash-image-preview and gemini-3-pro-image-preview shut down. Use the GA endpoints gemini-3.1-flash-image and gemini-3-pro-image.
Computer Use public preview on 3.5 Flash
The Computer Use tool entered public preview in Gemini 3.5 Flash with a simplified action set and refreshed safety policies.
Streaming TTS support
streamGenerateContent (and stream: true in the Interactions API) now supported for gemini-3.1-flash-tts-preview.
Interactions API schema finalized
Legacy outputs schema removed. The new steps schema and response_format configuration are now the only supported format.
Gemini 2.0 family shut down
gemini-2.0-flash, gemini-2.0-flash-001, gemini-2.0-flash-lite, and gemini-2.0-flash-lite-001 are gone. Use gemini-3.7-flash or gemini-3.1-flash-lite.
Getting Started
Get a key
Free at aistudio.google.com/apikey. One key covers AI Studio and the API.
Export it
Set GEMINI_API_KEY as an environment variable. SDKs pick it up automatically.
Install + call
Install the GenAI SDK for your language and make your first generateContent call.
Install the SDK
pip install -q -U google-genaiFirst request · gemini-3.7-flash
from google import genai
# Reads GEMINI_API_KEY from the environment
client = genai.Client()
response = client.models.generate_content(
model="gemini-3.7-flash",
contents="Explain how AI works in a few words"
)
print(response.text)Model Catalog
Gemini 3.7 Flash
gemini-3.7-flash
Current flagship. Most intelligent workhorse model: 1M-token context, 64k max output, tunable thinking levels. GA Aug 13.
Gemini 3.6 Flash
gemini-3.6-flash
Previous stable Flash. Shares the introductory pricing and built-in tool suite of 3.7 Flash. GA Jul 21.
Gemini 3.5 Flash
gemini-3.5-flash
Legacy Flash, still GA. Routine, high-throughput workloads. Superseded as flagship by 3.7 Flash.
Gemini 3.5 Flash-Lite
gemini-3.5-flash-lite
Fastest and most cost-effective option in the 3.5 line. GA Jul 21.
Gemini 3.1 Flash-Lite
gemini-3.1-flash-lite
Lowest-cost model, optimized for high-volume agentic tasks, translation, and data processing.
Gemini 3.1 Pro Preview
gemini-3.1-pro-preview
Advanced intelligence, complex problem solving, powerful agentic and vibe coding. Custom tools endpoint available.
Gemini 3 Flash Preview
gemini-3-flash-preview
Frontier-class performance rivaling larger models at a fraction of the cost.
Gemini 2.5 Pro
gemini-2.5-pro
Deep reasoning and coding, 1M token context window with adaptive thinking.
Gemini 2.5 Flash
gemini-2.5-flash
Best price-performance for low-latency, high-volume reasoning workloads.
Gemini 2.5 Flash-Lite
gemini-2.5-flash-lite
Fastest and most budget-friendly multimodal model in the 2.5 family.
Gemini Omni 1.1 Flash
gemini-omni-1.1-flash
GA Aug 27. Natively multimodal video generation and conversational video editing from text, image, and video inputs.
Nano Banana Pro
gemini-3-pro-image
Professional design engine with a reasoning core for studio-quality 4K visuals and precise text rendering.
Nano Banana 2
gemini-3.1-flash-image
High-efficiency production-scale image generation and editing, plus video-to-image from uploads or YouTube URLs.
Nano Banana 2 Lite
gemini-3.1-flash-lite-image
GA Jun 30. Ultra-low-latency image generation and the cheapest tier in the family.
Veo 3.1
veo-3.1-generate-preview
Cinematic video with synchronized audio. Standard and Fast variants. Veo 2 and Veo 3 retired Jun 30.
Veo 3.1 Lite
veo-3.1-lite-generate-preview
Developer-first, cost-efficient video generation for high-volume workloads.
Lyria 3 Pro
lyria-3-pro-preview
Full-length song generation with structural coherence. 48kHz stereo from text and image inputs.
Lyria 3 Clip
lyria-3-clip-preview
Short clips and loops up to 30 seconds, for stingers, beds, and UI sound.
Gemini 3.5 Transcribe
gemini-3.5-transcribe
Stable speech-to-text with automatic language detection and speaker diarization. The gemini-3.5-transcribe-live variant handles real-time streams.
3.5 Live Translate
gemini-3.5-live-translate-preview
Real-time speech translation across 70+ languages for live, voice-first experiences.
3.1 Flash Live
gemini-3.1-flash-live-preview
Low-latency audio-to-audio for real-time dialogue and voice-first apps.
3.1 Flash TTS
gemini-3.1-flash-tts-preview
Steerable speech generation with expressive audio tags. Streaming support added June 2026.
Antigravity Agent
antigravity-preview-05-2026
General-purpose managed agent. Plans, reasons, runs code, manages files, and browses the web in a Linux sandbox.
Deep Research
deep-research-preview-04-2026
Autonomous multi-step research across hundreds of sources with cited reports.
Deep Research Max
deep-research-max-preview-04-2026
Maximum-comprehensiveness variant for the deepest research synthesis runs.
Computer Use
gemini-2.5-computer-use-preview-10-2025
Sees a screen and performs UI actions: clicking, typing, navigating. Also available as a tool in Gemini 3.5 Flash since Jun 24.
Robotics-ER 2
gemini-robotics-er-2-preview
Advanced embodied reasoning for multi-robot coordination and long-horizon physical tasks.
Robotics-ER 1.6
gemini-robotics-er-1.6-preview
Embodied reasoning for physical spaces: instrument reading, spatial and physical reasoning.
Gemini Embedding 2
gemini-embedding-2
Multimodal embedding across text, images, video, audio, and PDFs in a unified space. GA since April.
Gemini Embedding 001
gemini-embedding-001
Text-only high-dimensional vectors for semantic search and classification.
Prices per 1M tokens, standard paid tier, unless noted. Pro tier prices shown for prompts up to 200k tokens.
Function Calling
The model decides when to call your functions and supplies the arguments. Your app executes them and returns results. Gemini 3 models attach a unique id to every call, and you must echo it back in your functionResponse. The SDKs handle this automatically.
Default. Model chooses between text or a function call.
Always calls a function, guaranteed schema adherence.
Function calls prohibited, tools stay defined.
Preview. Calls or text, both schema-validated.
Automatic function calling
from google import genai
from google.genai import types
def get_current_temperature(location: str) -> dict:
"""Gets the current temperature for a given location.
Args:
location: The city and state, e.g. San Francisco, CA
Returns:
A dictionary containing the temperature and unit.
"""
return {"temperature": 25, "unit": "Celsius"}
client = genai.Client()
config = types.GenerateContentConfig(
tools=[get_current_temperature] # automatic function calling
)
response = client.models.generate_content(
model="gemini-3.7-flash",
contents="What's the temperature in Boston?",
config=config,
)
print(response.text)MCP server integration
import asyncio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
from google import genai
client = genai.Client()
server = StdioServerParameters(
command="npx",
args=["-y", "@philschmid/weather-mcp"],
)
async def run():
async with stdio_client(server) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
response = await client.aio.models.generate_content(
model="gemini-2.5-flash",
contents="What is the weather in London today?",
config=genai.types.GenerateContentConfig(
tools=[session], # auto tool calling
),
)
print(response.text)
asyncio.run(run())Parallel
Multiple independent calls in one turn. Results map back via id, return them in any order.
Compositional
Chained calls where step two depends on step one. Native in the Python SDK and Live API.
Multi-tool
Combine Google Search or Maps with custom functions in a single Gemini 3 request.
Tools
Google Search
Real-time web grounding. Gemini 3 models: 5,000 free prompts per month shared, then $14 per 1,000 queries.
Google Maps
Location and mapping grounding, supported on Gemini 3 models since March 2026.
Code Execution
Sandboxed Python the model can write and iterate on. Billed at standard token rates. Image output supported on Gemini 3.
URL Context
Fetch and inject page content as context. Charged as input tokens.
Computer Use
Screen vision plus UI actions for browser automation agents.
File Search
Multimodal since May 2026: natively embed and search images via gemini-embedding-2 with visual citations and page numbers.
Live API
Bidirectional audio and video streaming over WebSockets for real-time conversational agents. The flagship model is gemini-3.1-flash-live-preview, an audio-to-audio model with acoustic nuance detection. A dedicated Live Translate capability is now documented alongside the core Live API.
Optimization
Context Caching
Store system prompts and large docs server-side so repeated context bills at the discounted cached-input rate instead of full price. Rates vary by model.
Batch API
Async bulk processing at 50 percent of standard price on every current model.
Webhooks
New since May 4. Event-driven callbacks replace polling for Batch and long-running operations.
Flex Inference
Same 50 percent discount as Batch for latency-tolerant synchronous traffic.
Priority Inference
Roughly 1.8x standard pricing for guaranteed throughput and latency SLAs.
Files API
Upload once, reference by URI for 48 hours. Limit raised from 20MB to 100MB, plus Cloud Storage and pre-signed URL sources.
Pricing
| Model | Standard in / out | Batch + Flex | Priority |
|---|---|---|---|
Gemini 3.7 Flash gemini-3.7-flash | $0.75 / $3.75 * | $0.375 / $1.875 | $1.35 / $6.75 |
Gemini 3.6 Flash gemini-3.6-flash | $0.75 / $3.75 * | $0.375 / $1.875 | $1.35 / $6.75 |
Gemini 3.5 Flash gemini-3.5-flash | $1.50 / $9.00 | $0.75 / $4.50 | $2.70 / $16.20 |
Gemini 3.5 Flash-Lite gemini-3.5-flash-lite | $0.30 / $2.50 | $0.15 / $1.25 | $0.54 / $4.50 |
Gemini 3.1 Pro Preview gemini-3.1-pro-preview | $2.00 / $12.00 | $1.00 / $6.00 | $3.60 / $21.60 |
Gemini 3.1 Flash-Lite gemini-3.1-flash-lite | $0.25 / $1.50 | $0.125 / $0.75 | $0.45 / $2.70 |
Gemini 2.5 Pro gemini-2.5-pro | $1.25 / $10.00 | $0.625 / $5.00 | $2.25 / $18.00 |
Gemini 2.5 Flash gemini-2.5-flash | $0.30 / $2.50 | $0.15 / $1.25 | $0.54 / $4.50 |
Gemini 2.5 Flash-Lite gemini-2.5-flash-lite | $0.10 / $0.40 | $0.05 / $0.20 | $0.18 / $0.72 |
Free tier
Generous limits in AI Studio and the API. Content may be used to improve Google products.
Paid tier
Higher rate limits, caching, Batch at 50 percent off. Content not used for training. Prepay and Postpay plans since March.
Grounding
Gemini 3: 5,000 free search prompts per month shared, then $14 per 1,000 queries. Gemini 2.5: 1,500 RPD then $35 per 1,000.
USD per 1M tokens, input / output. Pro rates shown for prompts up to 200k tokens. * 3.7 and 3.6 Flash are at introductory pricing through Dec 31, 2026, then $1.50 / $7.50. Full tables at ai.google.dev/gemini-api/docs/pricing.
Best Practices
Keep temperature at 1.0 on Gemini 3
Lowering it can cause looping or degraded reasoning on Gemini 3 models. Use low temperature (0) only on 2.5 series function calls.
Cap the active tool set at 10 to 20
Too many tools raises the risk of wrong selection. Use dynamic tool selection when your library is large.
Always echo the function call id
Gemini 3 returns a unique id per call. Include it in your functionResponse or the model cannot map the result.
Iterate the parts array
With built-in tools plus custom functions, functionCall is not guaranteed to be the last part. Never rely on position.
Validate consequential actions
Confirm with the user before executing orders, payments, sends, or deletes triggered by a function call.
Check finishReason every time
Handle safety blocks and malformed calls gracefully instead of assuming a clean response.
Use enums for fixed values
Strong typing plus enum constraints measurably improves argument accuracy.
Watch the deprecation page
Three model families were retired between June 1 and June 30 alone. Pin stable strings and subscribe to release notes.