ModelsAgenticFrameworks

Gemini API Documentation

by Google

All LevelsDocumentationFreemium~6-10 hours across the quickstarts and capability guides; ongoing reference, self-paced

The reference for building on Gemini directly — models, tools, Live API, caching and cost controls.

Start LearningAdded Jul 13, 2026 · Updated Aug 23, 2026

Overview

The Gemini API documentation on ai.google.dev is Google's developer reference for calling Gemini models directly, as distinct from the enterprise Vertex AI path. Navigation is organised into Get started (overview, API keys, pricing, coding-agent setup), Models, Core capabilities, Agents, Tools, the Live API, Optimization, Guides, Safety and Frameworks. The Models section catalogues the current lineup with exact model IDs: stable Gemini 3.x Flash and Flash-Lite tiers, a preview Gemini 3.1 Pro, the Gemini 2.5 Pro/Flash/Flash-Lite generation, the Nano Banana image models (gemini-3.1-flash-image and gemini-3-pro-image), Veo 3.1 for video, text-to-speech models and the gemini-embedding family. Core capabilities documents text, image generation and understanding, video, document and audio input, thinking and reasoning controls, structured outputs, function calling and long context. The Tools section covers server-side tools you enable rather than implement: Google Search grounding, Google Maps, code execution, URL context, computer use and file search. The Agents section documents managed agents, environments, hooks and a deep-research agent. The Live API section covers bidirectional streaming audio, session management and ephemeral tokens for browser clients. Optimization covers the Batch API, webhooks, flex and priority inference tiers, and context caching for reusing large prompts cheaply. Every guide shows Python, JavaScript and REST side by side against the google-genai SDK, with Go, Node.js, Java and C# SDKs also published, and API keys are issued through Google AI Studio alongside a documented free tier.

At a Glance

Topic
Models
Level
All Levels
Format
Documentation
Cost
Freemium
Duration
~6-10 hours across the quickstarts and capability guides; ongoing reference, self-paced
Provider
Google
Hands-on
Yes — code/exercises
Certificate
None

What You’ll Learn

  • Pick the right Gemini model ID for a workload by cost, latency and modality
  • Call the API from Python, JavaScript or curl using the google-genai SDK
  • Force schema-conformant JSON with structured outputs instead of parsing free text
  • Implement function calling so the model can invoke your own application code
  • Enable server-side tools: Google Search grounding, code execution and URL context
  • Stream bidirectional audio conversations through the Live API with ephemeral tokens
  • Cut cost on repeated long prompts using context caching and the Batch API
  • Configure safety settings and thinking budgets before putting traffic in production

Highlights

  • Every guide shows Python, JavaScript and REST side by side, so it works whatever your stack
  • Documents server-side tools — Search grounding, code execution, computer use — that you would otherwise build yourself
  • Concrete model IDs and a published pricing page, including a free tier via Google AI Studio
  • Cost-control features (context caching, Batch API, flex inference) are documented as first-class, not footnotes
  • Known friction, honestly: developers report API-key and billing setup as the hardest part — a Hacker News thread on key acquisition drew 845 points, and an unrestricted browser key once ran up a €54k bill in 13 hours. Restrict your keys before shipping
  • The companion google-gemini/cookbook repo (17k+ stars, Apache-2.0) carries the runnable notebooks the docs reference

Who It’s For

Best For

  • Developers building directly on Gemini without Google Cloud or Vertex AI
  • Engineers who need multimodal input — video, audio, PDFs — through one API
  • Teams optimising LLM spend with caching, batching and tiered inference

Prerequisites

  • Basic Python or JavaScript, or comfort with curl and REST APIs
  • A Google account to create an API key in Google AI Studio, plus billing for paid tiers

FAQ

What is Gemini API Documentation?

Google's official developer documentation for the Gemini API — the direct, API-key path rather than Vertex AI. It covers model selection with exact IDs, text, image, video, audio and document input, thinking controls, structured outputs and function calling, server-side tools like Search grounding and code execution, the streaming Live API, context caching, batch inference and safety settings, with Python, JavaScript and REST examples throughout.

Is Gemini API Documentation free?

Gemini API Documentation offers free content, with paid options for certificates or premium features.

What level is Gemini API Documentation for?

Gemini API Documentation is aimed at a all levels audience. Recommended background: Basic Python or JavaScript, or comfort with curl and REST APIs, A Google account to create an API key in Google AI Studio, plus billing for paid tiers.

How long does Gemini API Documentation take?

Expect roughly ~6-10 hours across the quickstarts and capability guides; ongoing reference, self-paced. Most learners work through it at their own pace.

What will I learn from Gemini API Documentation?

You'll learn: Pick the right Gemini model ID for a workload by cost, latency and modality; Call the API from Python, JavaScript or curl using the google-genai SDK; Force schema-conformant JSON with structured outputs instead of parsing free text; Implement function calling so the model can invoke your own application code; Enable server-side tools: Google Search grounding, code execution and URL context; Stream bidirectional audio conversations through the Live API with ephemeral tokens; Cut cost on repeated long prompts using context caching and the Batch API; Configure safety settings and thinking budgets before putting traffic in production.

Topics

geminillm-apifunction-callingmultimodalstructured-outputs

Sources

This page was written from 4 sources, 2 on domains other than ai.google.dev.

  1. 1.ai.google.devdocsvendor
  2. 2.ai.google.devmodelsvendor
  3. 3.github.comcookbook
  4. 4.ankursethi.comgemini api key frustration