Gemini API

Interactions API הוא הדרך הכי פשוטה וטובה שלנו לבנות באמצעות מודלים וסוכנים של Gemini. מידע נוסף זמין בסקירה הכללית על 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 תוך כמה דקות.


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

הצג הכול

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