توفّر 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);
جافا
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.7-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 3.8 Flash جديد
نموذج Flash الأكثر ذكاءً لدينا، وهو مصمّم لهندسة البرامج على المدى الطويل، ووكلاء الذكاء الاصطناعي المستقلين، ومهام سير العمل المعقّدة في المؤسسات.
Gemini 3.8 Flash TTS جديد
نموذج تحويل النص إلى كلام بجودة الاستوديو مع أداء تعبيري وتصميم صوت مخصّص وتكرار الصوت
Gemini 3.5 Flash-Lite
نموذج عالي الأداء ومحسَّن لمهام الوكيل الفرعي التي تتطلّب معدّل أعلى لنقل البيانات ووقت استجابة منخفضًا، كما أنّه يراعي التكلفة.
Gemini 3.1 Pro
نموذجنا الأكثر ذكاءً، وهو الأفضل في العالم لفهم المحتوى المتعدد الوسائط، تم تصميمه بالكامل استنادًا إلى مهارات استدلالية متقدّمة.
Nano Banana 2 وNano Banana Pro
نماذج متطورة لإنشاء الصور وتعديلها
Gemini Omni Flash
نموذجنا الأحدث لإنشاء الفيديوهات وتعديلها
Gemini 3.5 Transcribe جديد
نموذج لتحويل الصوت إلى نص بزمن استجابة منخفض مع ميزات التعرّف على اللغة استنادًا إلى الجملة، وتمييز أصوات المتحدّثين، والطوابع الزمنية للكلمات
Gemini Robotics
هو نموذج للرؤية واللغة (VLM) يتيح استخدام قدرات Gemini المستندة إلى الذكاء الاصطناعي الوكيل في مجال الروبوتات، كما يتيح إجراء استدلال متقدّم في العالم المادي.
استكشاف الإمكانات
إنشاء الصور
أنشئ صورًا عالية الصلة بالموضوع وعدِّلها بشكلٍ أصلي باستخدام Nano Banana.
سياق طويل
إدخال ملايين الرموز المميزة إلى نماذج Gemini واستخلاص المعلومات من الصور والفيديوهات والمستندات غير المنظَّمة
المُخرجات المنظَّمة
يمكنك حصر ردود Gemini على تنسيق JSON، وهو تنسيق بيانات منظَّمة مناسب للمعالجة الآلية.
استدعاء الدالة
يمكنك إنشاء مهام مبرمَجة من خلال ربط Gemini بواجهات برمجة التطبيقات والأدوات الخارجية.
إنشاء الفيديوهات باستخدام Veo 3.1
أنشِئ محتوى فيديو عالي الجودة من طلبات نصية أو صور باستخدام نموذجنا الأحدث.
وكلاء صوتيون باستخدام Live API
يمكنك إنشاء تطبيقات ووكلاء صوتيين في الوقت الفعلي باستخدام Live API.
الأدوات
يمكنك ربط Gemini بالعالم من خلال أدوات مدمجة، مثل "بحث Google" و"سياق عنوان URL" و"خرائط Google" و"تنفيذ الرموز البرمجية" و"استخدام الكمبيوتر".
فهم المستندات
معالجة ما يصل إلى 1,000 صفحة من ملفات PDF مع إمكانية فهم المحتوى المتعدد الوسائط بالكامل أو أنواع أخرى من الملفات النصية
جارٍ التفكير
استكشِف كيف تحسّن إمكانات التفكير عملية الاستدلال في المهام والوكلاء المعقّدين.
إنشاء وكلاء
تمنح "الوكلاء المُدارون" Gemini مساحة عمل للتخطيط للمهام وإكمالها بنفسه. في طلب واحد، يمكن لـ Gemini كتابة الرمز البرمجي وتشغيله، والبحث على الويب، وإنشاء ملفات في بيئة تجريبية مستضافة. يمكنك البدء باستخدام وكيل 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);
جافا
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
أصبحت واجهة برمجة التطبيقات Interactions API واجهتنا التلقائية اعتبارًا من يونيو 2026، وهي أفضل طريقة للاستفادة من نماذج Gemini والوكلاء في المستقبل. إذا كنت بصدد بدء مشروع جديد، عليك استخدام Interactions API. على الرغم من أنّ واجهة برمجة التطبيقات generateContent لا تزال متاحة، إلا أنّها تُعدّ الآن قديمة.