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"
  }'
बनाना शुरू करें

एपीआई पासकोड पाने और कुछ ही मिनटों में अपना पहला एपीआई कॉल करने के लिए, हमारी क्विकस्टार्ट गाइड का इस्तेमाल करें.


मॉडल के बारे में जानकारी

सभी देखें

सुविधाओं के बारे में जानें