Gemini を使用して生成 AI ソリューションを開発する場合、Google は 2 つの API プロダクトを提供しています。 Gemini Developer API と Gemini Enterprise Agent Platform API です。
Gemini Developer API は、Gemini を搭載したアプリケーションの構築、本番環境への移行、スケーリングを最も迅速に行う方法を提供します。特定のエンタープライズ コントロールが必要な場合を除き、ほとんどのデベロッパーは Gemini Developer API を使用する必要があります。
Gemini Enterprise Agent Platform は、Google Cloud Platform を基盤とする生成 AI アプリケーションの構築とデプロイのための、エンタープライズ対応の機能とサービスの包括的なエコシステムを提供します。
Google は最近、これらのサービス間の移行を簡素化しました。Gemini Developer API と Gemini Enterprise Agent Platform API の両方に、統合された Google Gen AI SDKを介してアクセスできるようになりました。
コードの比較
このページでは、テキスト生成用の Gemini Developer API と Gemini Enterprise Agent Platform のクイックスタートのコードを並べて比較しています。
Python
google-genai ライブラリを介して、Gemini Developer API と Gemini Enterprise Agent Platform の両方のサービスにアクセスできます。ライブラリのページ
で、google-genai のインストール方法をご覧ください。
Gemini Developer API
from google import genai
client = genai.Client()
response = client.models.generate_content(
model="gemini-3-flash-preview", contents="Explain how AI works in a few words"
)
print(response.text)
Gemini Enterprise Agent Platform 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-flash-preview", contents="Explain how AI works in a few words"
)
print(response.text)
JavaScript と TypeScript
@google/genai ライブラリを介して、Gemini Developer API と Gemini Enterprise Agent Platform の両方のサービスにアクセスできます。ライブラリのページで、
@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-flash-preview",
contents: "Explain how AI works in a few words",
});
console.log(response.text);
}
main();
Gemini Enterprise Agent Platform 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-flash-preview",
contents: "Explain how AI works in a few words",
});
console.log(response.text);
}
main();
Go
google.golang.org/genai ライブラリを介して、Gemini Developer API と Gemini Enterprise Agent Platform の両方のサービスにアクセスできます。ライブラリのページで、
のインストール方法をご覧ください。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-flash-preview", genai.Text("Tell me about New York?"), nil)
}
Gemini Enterprise Agent Platform API
import (
"context"
"encoding/json"
"fmt"
"log"
"google.golang.org/genai"
)
// Your GCP project
const project = "your-project"
// A GCP 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-flash-preview", genai.Text("Tell me about New York?"), nil)
}
その他のユースケースとプラットフォーム
他のプラットフォームとユースケースについては、Gemini Developer API ドキュメント と Gemini Enterprise Agent Platform ドキュメント のユースケース固有のガイドをご覧ください。
移行に関する考慮事項
移行する場合:
認証には Google Cloud サービス アカウントを使用する必要があります。詳細については、Gemini Enterprise Agent Platform のドキュメント をご覧ください。
既存の Google Cloud プロジェクト (API キーの生成に使用したプロジェクト)を使用することも、新しい Google Cloud プロジェクト を作成することもできます。
サポートされているリージョンは、Gemini Developer API と Gemini Enterprise Agent Platform API で異なる場合があります。Google Cloud の生成 AI でサポートされているリージョンのリストをご覧ください。
Google AI Studio で作成したモデルは、Gemini Enterprise Agent Platform で再トレーニングする必要があります。
Gemini Developer API で Gemini API キーを使用する必要がなくなった場合は、セキュリティのベスト プラクティスに従ってキーを削除します。
API キーを削除するには:
Google Cloud API 認証情報 ページを開きます。
削除する API キーを見つけて、[操作] アイコンをクリックします。
[API キーを削除] を選択します。
[認証情報の削除] モーダルで、[削除] を選択します。
API キーの削除が反映されるまでには数分かかることがあります。削除が反映されると、以降その API キーを使ったトラフィックはすべて拒否されます。
次のステップ
- Gemini Enterprise Agent Platform の生成 AI ソリューションの詳細については、 Gemini Enterprise Agent Platform の生成 AI の概要 をご覧ください。