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"
  }'
אני רוצה להתחיל לפתח

כדאי לעיין במדריך למתחילים כדי לקבל מפתח API ולבצע את הקריאה הראשונה ל-API תוך כמה דקות.


הכירו את המודלים

הצג הכול

יכולות נוספות