Gemini API

Gemini, Veo, Nano Banana वगैरह की मदद से, प्रॉम्प्ट से प्रोडक्शन तक पहुंचने का सबसे तेज़ तरीका Gemini API है. इसकी मदद से, जनरेटिव मॉडल को अपने ऐप्लिकेशन में इंटिग्रेट किया जा सकता है. इससे टेक्स्ट और इमेज जनरेट की जा सकती हैं, टेक्स्ट, इमेज वगैरह को प्रोसेस किया जा सकता है, और बातचीत करने वाले एजेंट बनाए जा सकते हैं.

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-3.7-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.7-flash",
  input: "Explain how AI works in a few words",
});

console.log(interaction.output_text);

Java

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(""));

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.7-flash",
    "input": "Explain how AI works in a few words"
  }'
बनाना शुरू करें

एपीआई पासकोड पाने और कुछ ही मिनटों में अपना पहला एपीआई कॉल करने के लिए, शुरू करने से जुड़ी हमारी गाइड देखें.


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

सभी देखें

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

Interactions API

Interactions API जून 2026 से हमारा डिफ़ॉल्ट इंटरफ़ेस बन गया है. यह Gemini मॉडल और एजेंट बनाने का सबसे अच्छा तरीका है. अगर कोई नया प्रोजेक्ट शुरू किया जा रहा है, तो आपको Interactions API का इस्तेमाल करना चाहिए. generateContent API अब भी काम करता है, लेकिन इसे अब लेगसी माना जाता है.