Gemini Developer API बनाम Gemini प्लैटफ़ॉर्म

Gemini की मदद से जनरेटिव एआई सलूशन डेवलप करते समय, Google दो एपीआई प्रॉडक्ट उपलब्ध कराता है: Gemini Developer API और Gemini Platform API.

Gemini Developer API की मदद से, Gemini की सुविधाओं वाले ऐप्लिकेशन को तेज़ी से बनाया, प्रोडक्शन में लाया, और स्केल किया जा सकता है. ज़्यादातर डेवलपर को Gemini Developer API का इस्तेमाल करना चाहिए. हालांकि, अगर एंटरप्राइज़ के लिए खास कंट्रोल की ज़रूरत हो, तो वे Gemini Enterprise API का इस्तेमाल कर सकते हैं.

Gemini प्लैटफ़ॉर्म, एंटरप्राइज़ के लिए तैयार सुविधाओं और सेवाओं का एक पूरा नेटवर्क उपलब्ध कराता है. इनकी मदद से, Google Cloud पर जनरेटिव एआई ऐप्लिकेशन बनाए और डिप्लॉय किए जा सकते हैं.

हमने हाल ही में, इन सेवाओं के बीच माइग्रेट करने की प्रोसेस को आसान बना दिया है. Gemini Developer API और Gemini Platform API, दोनों को अब Google GenAI SDK और Interactions API के ज़रिए ऐक्सेस किया जा सकता है.

कोड की तुलना: Interactions API (सुझाया गया)

Gemini मॉडल और एजेंट के साथ काम करने के लिए, Interactions API का इस्तेमाल करने का सुझाव दिया जाता है. यहां दिए गए उदाहरणों में, Gemini Developer API और Gemini प्लैटफ़ॉर्म के बीच टेक्स्ट जनरेट करने की तुलना की गई है.

Python

Gemini Developer API और Gemini प्लैटफ़ॉर्म, दोनों की सेवाओं को google-genai लाइब्रेरी (>= 2.3.0) के ज़रिए ऐक्सेस किया जा सकता है. google-genai को इंस्टॉल करने के निर्देशों के लिए, लाइब्रेरी पेज देखें.

Gemini Developer API

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-3.8-flash",
    input="Explain how AI works in a few words",
)
print(interaction.output_text)

Gemini प्लैटफ़ॉर्म API

from google import genai

client = genai.Client(
    enterprise=True, project="your-project-id", location="global"
)

interaction = client.interactions.create(
    model="gemini-3.8-flash",
    input="Explain how AI works in a few words",
)
print(interaction.output_text)

JavaScript और TypeScript

Gemini Developer API और Gemini प्लैटफ़ॉर्म, दोनों की सेवाओं को @google/genai लाइब्रेरी (>= 2.3.0) के ज़रिए ऐक्सेस किया जा सकता है. @google/genai को इंस्टॉल करने के निर्देशों के लिए, लाइब्रेरी पेज देखें.

Gemini Developer API

import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({});

const interaction = await ai.interactions.create({
  model: "gemini-3.8-flash",
  input: "Explain how AI works in a few words",
});
console.log(interaction.output_text);

Gemini प्लैटफ़ॉर्म API

import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({
  enterprise: true,
  project: "your_project",
  location: "global",
});

const interaction = await ai.interactions.create({
  model: "gemini-3.8-flash",
  input: "Explain how AI works in a few words",
});
console.log(interaction.output_text);

कोड की तुलना: generateContent API

नए प्रोजेक्ट के लिए, Interactions API का इस्तेमाल करने का सुझाव दिया जाता है. हालांकि, generateContent API का इस्तेमाल अब भी किया जा सकता है.

Python

google-genai लाइब्रेरी के ज़रिए, Gemini Developer API और Gemini प्लैटफ़ॉर्म, दोनों की सेवाओं को ऐक्सेस किया जा सकता है. google-genai को इंस्टॉल करने का तरीका जानने के लिए, लाइब्रेरी पेज पर जाएं.

Gemini Developer API

from google import genai

client = genai.Client()

response = client.models.generate_content(
    model="gemini-3.8-flash", contents="Explain how AI works in a few words"
)
print(response.text)

Gemini प्लैटफ़ॉर्म API

from google import genai

client = genai.Client(
    vertexai=True, project='your-project-id', location='us-central1'
)

response = client.models.generate_content(
    model="gemini-3.8-flash", contents="Explain how AI works in a few words"
)
print(response.text)

JavaScript और TypeScript

@google/genai लाइब्रेरी के ज़रिए, Gemini Developer API और Gemini प्लैटफ़ॉर्म, दोनों की सेवाओं को ऐक्सेस किया जा सकता है. @google/genai को इंस्टॉल करने के निर्देश पाने के लिए, लाइब्रेरी पेज देखें.

Gemini Developer API

import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({});

async function main() {
  const response = await ai.models.generateContent({
    model: "gemini-3.8-flash",
    contents: "Explain how AI works in a few words",
  });
  console.log(response.text);
}

main();

Gemini प्लैटफ़ॉर्म API

import { GoogleGenAI } from '@google/genai';
const ai = new GoogleGenAI({
  vertexai: true,
  project: 'your_project',
  location: 'your_location',
});

async function main() {
  const response = await ai.models.generateContent({
    model: "gemini-3.8-flash",
    contents: "Explain how AI works in a few words",
  });
  console.log(response.text);
}

main();

ऐप पर जाएं

google.golang.org/genai लाइब्रेरी के ज़रिए, Gemini Developer API और Gemini प्लैटफ़ॉर्म, दोनों की सेवाओं को ऐक्सेस किया जा सकता है. google.golang.org/genai को इंस्टॉल करने के निर्देश पाने के लिए, लाइब्रेरी पेज देखें.

Gemini Developer API

import (
  "context"
  "encoding/json"
  "fmt"
  "log"
  "google.golang.org/genai"
)

// Your Google API key
const apiKey = "your-api-key"

func main() {
  ctx := context.Background()
  client, err := genai.NewClient(ctx, nil)
  if err != nil {
      log.Fatal(err)
  }

  // Call the GenerateContent method.
  result, err := client.Models.GenerateContent(ctx, "gemini-3.8-flash", genai.Text("Tell me about New York?"), nil)

}

Gemini प्लैटफ़ॉर्म API

import (
  "context"
  "encoding/json"
  "fmt"
  "log"
  "google.golang.org/genai"
)

// Your Google Cloud project
const project = "your-project"

// A Google Cloud location like "us-central1"
const location = "some-gcp-location"

func main() {
  ctx := context.Background()
  client, err := genai.NewClient(ctx, &genai.ClientConfig
  {
        Project:  project,
      Location: location,
      Backend:  genai.BackendVertexAI,
  })

  // Call the GenerateContent method.
  result, err := client.Models.GenerateContent(ctx, "gemini-3.8-flash", genai.Text("Tell me about New York?"), nil)

}

इस्तेमाल के अन्य उदाहरण और प्लैटफ़ॉर्म

अन्य प्लैटफ़ॉर्म और इस्तेमाल के उदाहरणों के लिए, Gemini Developer API के दस्तावेज़ और Gemini प्लैटफ़ॉर्म के दस्तावेज़ में, इस्तेमाल के उदाहरणों से जुड़ी गाइड देखें.

माइग्रेशन से जुड़ी ज़रूरी बातें

माइग्रेट करने पर:

अगर आपको Gemini Developer API के लिए, Gemini API पासकोड का इस्तेमाल नहीं करना है, तो सुरक्षा के सबसे सही तरीकों को अपनाएं और इसे मिटा दें.

किसी एपीआई पासकोड को मिटाने के लिए:

  1. Google Cloud API के क्रेडेंशियल पेज खोलें.

  2. वह एपीआई पासकोड ढूंढें जिसे आपको मिटाना है. इसके बाद, कार्रवाइयां आइकॉन पर क्लिक करें.

  3. एपीआई पासकोड मिटाएं को चुनें.

  4. क्रेडेंशियल मिटाएं मोडल में जाकर, मिटाएं को चुनें.

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

अगले चरण