Gemini API הוא הדרך המהירה ביותר להפוך הנחיה למוצר בעזרת Gemini, Veo, Nano Banana ועוד. הוא מאפשר לשלב את המודלים הגנרטיביים האלה באפליקציות כדי ליצור טקסט ותמונות, לנתח קלט מולטי-מודאלי ולבנות סוכנים בממשק שיחה.
Python
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3.8-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.8-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.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
Client client = new Client();
CreateModelInteraction params =
CreateModelInteraction.builder()
.model(Model.of("gemini-3.8-flash"))
.input(InteractionsInput.of("Explain how AI works in a few words"))
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
System.out.println(interaction.outputText().orElse(""));
Go
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateModelInteraction{
Model: interactions.Model("gemini-3.8-flash"),
Input: interactions.NewInteractionsInput("Explain how AI works in a few words"),
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
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.8-flash",
"input": "Explain how AI works in a few words"
}'
היכרות עם המודלים
הצג הכולGemini 4 Argon חדש
מודל הדגל שלנו לחשיבה רציונלית, עם חלון הקשר משותף של מיליון טוקנים ופענוחים ארוכים של עד מיליון טוקנים.
Gemini 3.8 Flash חדש
מודל Flash הכי חכם שלנו, שנועד לפיתוח תוכנה לטווח ארוך, לסוכנים אוטונומיים ולתהליכי עבודה מורכבים בארגונים.
Gemini 3.8 Flash TTS חדש
מודל להמרת טקסט לדיבור ברמה של אולפן, עם משחק אקספרסיבי, עיצוב קול מותאם אישית ושכפול קול.
Gemini 3.5 Flash-Lite
מודל שמתאים לנפח גבוה ורגיש לעלויות, שעבר אופטימיזציה למשימות של סוכני משנה עם זמן אחזור קצר וקצב העברת נתונים גבוה.
Nano Banana
מודלים מתקדמים ליצירה ולעריכה של תמונות.
Gemini Omni Flash
המודל המתקדם ביותר (SOTA) שלנו ליצירת סרטונים ולעריכתם.
Gemini 3.5 Transcribe חדש
מודל להמרת דיבור לטקסט (STT) עם זמן אחזור נמוך, זיהוי שפה שמבוסס על אמירות, חלוקת קובץ האודיו לפי דוברים וחותמות זמן של מילים.
Gemini Robotics
מודל שפה ויזואלי (VLM) שמביא את יכולות הסוכן של Gemini לרובוטיקה ומאפשר הסקת מסקנות מתקדמת בעולם הפיזי.
פרטים על היכולות
יצירת תמונות
יוצרים ועורכים תמונות בהתאם להקשר באופן מקורי באמצעות Nano Banana.
הקשר רחב
אפשר להזין מיליוני טוקנים למודלים של Gemini ולהפיק תובנות מתמונות, מסרטונים וממסמכים לא מובְנים.
פלט מובנה
מגבילים את Gemini כך שיגיב ב-JSON, פורמט נתונים מובְנים שמתאים לעיבוד אוטומטי.
בקשה להפעלת פונקציה
כדי ליצור תהליכי עבודה מבוססי-סוכנים, אתם יכולים לחבר את Gemini לממשקי API ולכלים חיצוניים.
יצירת סרטונים באמצעות Veo 3.1
אתם יכולים ליצור תוכן וידאו באיכות גבוהה מהנחיות טקסט או תמונה באמצעות המודל המתקדם שלנו.
סוכנים קוליים עם Live API
אתם יכולים לפתח אפליקציות וסוכנים קוליים שפועלים בזמן אמת באמצעות Live API.
כלים
Gemini יכול להתחבר לעולם באמצעות כלים מובנים כמו חיפוש Google, URL Context, מפות Google, הפעלת קוד ושימוש במחשב.
הבנת מסמכים
לעבד עד 1,000 דפים של קובצי PDF עם הבנה מולטי-מודאלית מלאה או סוגי קבצים אחרים שמבוססים על טקסט.
מעמיק
כדאי לבדוק איך יכולות החשיבה משפרות את ההיגיון במשימות מורכבות ובסוכנים.
יצירת סוכנים
סוכנים מנוהלים נותנים ל-Gemini סביבת עבודה שבה הוא יכול לתכנן ולבצע משימות בעצמו. בבקשה אחת, Gemini יכול לכתוב ולהריץ קוד, לחפש באינטרנט וליצור קבצים בסביבת ארגז חול (sandbox) מתארחת. אתם יכולים להתחיל עם סוכן Antigravity מוכן מראש, או להתאים אותו אישית באמצעות הוראות וכלים משלכם.
Python
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-09-2026",
input=(
"Research the top 5 sustainable fashion brands, "
"compare their materials and pricing tiers, and "
"build an interactive dashboard in analysis.html."
),
environment="remote"
)
print(interaction.output_text)
JavaScript
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
const interaction = await ai.interactions.create({
agent: "antigravity-preview-09-2026",
input:
"Research the top 5 sustainable fashion brands, " +
"compare their materials and pricing tiers, and " +
"build an interactive dashboard in analysis.html.",
environment: "remote",
});
console.log(interaction.output_text);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.AgentOption;
import com.google.genai.gaos.models.interactions.CreateAgentInteraction;
import com.google.genai.gaos.models.interactions.CreateAgentInteractionEnvironment;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
Client client = new Client();
CreateAgentInteraction params =
CreateAgentInteraction.builder()
.agent(AgentOption.of("antigravity-preview-09-2026"))
.input(
InteractionsInput.of(
"Research the top 5 sustainable fashion brands, "
+ "compare their materials and pricing tiers, and "
+ "build an interactive dashboard in analysis.html."))
.environment(CreateAgentInteractionEnvironment.of("remote"))
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(params))
.interaction()
.get();
System.out.println(interaction.outputText().orElse(""));
Go
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateAgentInteraction{
Agent: interactions.AgentOption("antigravity-preview-09-2026"),
Input: interactions.NewInteractionsInput(
"Research the top 5 sustainable fashion brands, " +
"compare their materials and pricing tiers, and " +
"build an interactive dashboard in analysis.html.",
),
Environment: genai.Ptr(interactions.NewCreateAgentInteractionEnvironment("remote")),
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
REST
curl -X POST \
"https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"agent": "antigravity-preview-09-2026",
"input": "Research the top 5 sustainable fashion brands, compare their materials and pricing tiers, and build an interactive dashboard in analysis.html.",
"environment": "remote"
}'
Interactions API
החל מיוני 2026, Interactions API הוא הממשק שמוגדר כברירת מחדל, והוא הדרך הטובה ביותר לפתח באמצעות מודלי Gemini וסוכנים. אם אתם מתחילים פרויקט חדש, כדאי להשתמש ב-Interactions API. ה-API של generateContent עדיין נתמך, אבל הוא נחשב עכשיו ל-API מדור קודם.