🌐 US-Proxy
class="gemini-api color-scheme--light" template="page" theme="googledevai-theme" type="article" appearance layout="docs" display-toc pending>

Gemini API

We recommend using the Interactions API for all new projects. It is optimized for agentic workflows, state management, and the latest models. Learn more in the Interactions API Overview.

The fastest path from prompt to production with Gemini, Veo, Nano Banana, and more.

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-3.5-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.5-flash",
  input: "Explain how AI works in a few words",
});

console.log(interaction.output_text);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -H "Api-Revision: 2026-05-20" \
  -d '{
    "model": "gemini-3.5-flash",
    "input": "Explain how AI works in a few words"
  }'
Start building

Follow our Quickstart guide to get an API key and make your first API call in minutes.


Meet the models

View all

Explore Capabilities