رابط برنامهنویسی نرمافزار Gemini سریعترین مسیر از اعلان تا تولید با Gemini، Veo، Nano Banana و موارد دیگر است. این رابط به شما امکان میدهد این مدلهای مولد را در برنامههای خود ادغام کنید تا متن و تصاویر تولید کنید، ورودیهای چندوجهی را تجزیه و تحلیل کنید و عاملهای محاورهای بسازید.
پایتون
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)
جاوا اسکریپت
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(""));
برو
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)
}
}
استراحت
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 TTS جدیدمدل تبدیل متن به گفتار در سطح استودیویی با بازیگری رسا، طراحی صدای سفارشی و تکثیر صدا.
جمینی ۳.۵ فلش-لایتمدلی با حجم بالا و حساس به هزینه که برای وظایف زیرعامل با تأخیر کم و توان عملیاتی بالا بهینه شده است.
جمینی ۳.۱ پروهوشمندترین مدل ما، بهترین مدل در جهان برای درک چندوجهی، که همگی بر اساس استدلال پیشرفته ساخته شدهاند.
🍌 نانو موز ۲ و نانو موز پرومدلهای پیشرفته تولید و ویرایش تصویر.
Gemini Omni Flashمدل پیشرفتهی ما در تولید و ویرایش ویدیو.
Gemini 3.5 رونویسی جدیدمدل تبدیل گفتار به متن با تأخیر کم با تشخیص زبان مبتنی بر گفتار، تشخیص گویشور و مهر زمانی کلمات.
رباتیک جمینییک مدل زبان بینایی (VLM) که قابلیتهای عاملمحور Gemini را به رباتیک میآورد و استدلال پیشرفته در دنیای فیزیکی را امکانپذیر میکند.
بررسی قابلیتها
تولید تصویر
تصاویر بسیار متنی را به صورت بومی با Nano Banana تولید و ویرایش کنید.
متن طولانی
میلیونها توکن را به مدلهای Gemini وارد کنید و از تصاویر، ویدیوها و اسناد بدون ساختار، درک لازم را به دست آورید.
خروجیهای ساختاریافته
Gemini را مجبور کنید تا با JSON پاسخ دهد، یک فرمت داده ساختار یافته مناسب برای پردازش خودکار.
فراخوانی تابع
با اتصال Gemini به APIها و ابزارهای خارجی، گردشهای کاری عاملمحور بسازید.
تولید ویدیو با Veo 3.1
با استفاده از مدل پیشرفته ما، محتوای ویدیویی با کیفیت بالا از متن یا تصویر ایجاد کنید.
عاملهای صوتی با API زنده
با استفاده از Live API، اپلیکیشنها و عاملهای صوتی بلادرنگ بسازید.
ابزارها
Gemini را از طریق ابزارهای داخلی مانند جستجوی گوگل، متن URL، نقشههای گوگل، اجرای کد و استفاده از رایانه به جهان متصل کنید.
درک سند
پردازش تا ۱۰۰۰ صفحه فایل PDF با درک کامل چندوجهی یا سایر انواع فایلهای مبتنی بر متن.
تفکر
بررسی کنید که چگونه قابلیتهای تفکر، استدلال برای وظایف و عاملهای پیچیده را بهبود میبخشد.
ایجاد عاملها
عاملهای مدیریتشده به Gemini یک فضای کاری برای برنامهریزی و انجام وظایف به تنهایی میدهند. Gemini میتواند با یک درخواست واحد، کد بنویسد و اجرا کند، در وب جستجو کند و در یک محیط sandbox میزبانیشده فایل ایجاد کند. با عامل Antigravity از پیش ساخته شده ما شروع کنید یا آن را با دستورالعملها و ابزارهای خود سفارشی کنید.
پایتون
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)
جاوا اسکریپت
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(""));
برو
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)
}
}
استراحت
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"
}'
API تعاملات
از ژوئن ۲۰۲۶، رابط برنامهنویسی کاربردی (API) تعاملات (Interactions API) به رابط پیشفرض ما تبدیل شده است و بهترین راه برای ساخت مدلها و عاملهای Gemini در آینده است. اگر در حال شروع یک پروژه جدید هستید، باید از API تعاملات (Interactions API) استفاده کنید. در حالی که همچنان پشتیبانی میشود، API generateContent API) اکنون به عنوان یک رابط قدیمی در نظر گرفته میشود.
مرور کلی تعاملات
بیاموزید که چگونه API تعاملات، وضعیت مکالمه، پیامها و قالبهای خروجی را مدیریت میکند.
راهنمای مهاجرت
راهنمای گام به گام برای انتقال کد شما از generateContent به Interactions API.
پخش جریانی
توکنها، افکار افزایشی و رویدادهای فراخوانی ابزار را به صورت بلادرنگ پخش کنید.
اعلانها را آزمایش کنید، کلیدهای API خود را مدیریت کنید، میزان استفاده را زیر نظر داشته باشید و نمونههای اولیه بسازید.
از دیگر توسعهدهندگان و مهندسان گوگل سوال بپرسید و راهحل پیدا کنید.
اطلاعات دقیق در مورد API مربوط به Gemini را در مستندات مرجع رسمی بیابید.
وضعیت Gemini API، Google AI Studio و سرویسهای مدل ما را بررسی کنید.