Gemini API

Wir empfehlen, für alle neuen Projekte die Interactions API zu verwenden. Sie ist für agentische Workflows, die Statusverwaltung und die neuesten Modelle optimiert. Weitere Informationen finden Sie in der Übersicht zur Interactions API.

Der schnellste Weg vom Prompt zur Produktion mit Gemini, Veo, Nano Banana und mehr.

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' \
  -d '{
    "model": "gemini-3.5-flash",
    "input": "Explain how AI works in a few words"
  }'
Losstaunen

Folgen Sie unserer Kurzanleitung, um einen API-Schlüssel zu erhalten und Ihren ersten API-Aufruf in wenigen Minuten zu senden.


Die Modelle

Alle ansehen

Funktionen