Gemini API

ننصحك باستخدام واجهة Interactions API لجميع المشاريع الجديدة. تم تحسينه ليتوافق مع مهام سير العمل المستندة إلى الذكاء الاصطناعي المستقلّ وإدارة الحالة وأحدث النماذج. يمكنك الاطّلاع على مزيد من المعلومات في نظرة عامة على Interactions API.

أسرع طريقة للانتقال من الطلب إلى الإنتاج باستخدام Gemini وVeo وNano Banana والمزيد

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"
  }'
بدء التركيب

اتّبِع دليل البدء السريع للحصول على مفتاح واجهة برمجة التطبيقات وإجراء طلب بيانات من واجهة برمجة التطبيقات الأول في غضون دقائق.


التعرّف على النماذج

عرض الكل

استكشاف الإمكانيات