The Gemini API is the fastest path from prompt to production with Gemini, Veo, Nano Banana, and more. It lets you integrate these generative models into your applications to generate text and images, analyze multimodal inputs, and build conversational agents.
Python
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3.7-flash",
input="Explain how AI works in a few words"
)
print(interaction.output_text)
JavaScript
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
const interaction = await ai.interactions.create({
model: "gemini-3.7-flash",
input: "Explain how AI works in a few words",
});
console.log(interaction.output_text);
Java
import com.google.genai.Client;
import com.google.genai.types.GenerateContentResponse;
Client client = new Client();
GenerateContentResponse response = client.models.generateContent("gemini-2.5-flash", "Hello, Gemini!", null);
System.out.println(response.text());
REST
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "gemini-3.7-flash",
"input": "Explain how AI works in a few words"
}'
Follow our getting started guide to get an API key and make your first API call in minutes.
Meet the models
View allGemini 3.7 Flash New
Our latest and most capable Flash model, built for complex coding, agentic workflows, and reliable multi-step execution.
Gemini 3.5 Flash-Lite
High-volume, cost-sensitive model optimized for low-latency high throughput subagent tasks.
Gemini 3.1 Pro
Our most intelligent model, the best in the world for multimodal understanding, all built on state-of-the-art reasoning.
Nano Banana 2 and Nano Banana Pro
State-of-the-art image generation and editing models.
Gemini Omni Flash
Our state-of-the-art video generation and editing model.
Gemini 3.5 Transcribe New
Low-latency speech-to-text model with utterance-based language detection, speaker diarization, and word timestamps.
Gemini Robotics
A vision-language model (VLM) that brings Gemini's agentic capabilities to robotics and enables advanced reasoning in the physical world.
Explore Capabilities
Image Generation
Generate and edit highly contextual images natively with Nano Banana.
Long Context
Input millions of tokens to Gemini models and derive understanding from unstructured images, videos, and documents.
Structured Outputs
Constrain Gemini to respond with JSON, a structured data format suitable for automated processing.
Function Calling
Build agentic workflows by connecting Gemini to external APIs and tools.
Video Generation with Veo 3.1
Create high-quality video content from text or image prompts with our state-of-the-art model.
Voice Agents with Live API
Build real-time voice applications and agents with the Live API.
Tools
Connect Gemini to the world through built-in tools like Google Search, URL Context, Google Maps, Code Execution and Computer Use.
Document Understanding
Process up to 1000 pages of PDF files with full multimodal understanding or other text-based file types.
Thinking
Explore how thinking capabilities improve reasoning for complex tasks and agents.
Interactions API
The Interactions API has become our default interface as of June 2026 and is the best way to build with Gemini models and agents going forward. If you're starting a new project, you should use the Interactions API. While it remains supported, the generateContent API is now considered legacy.