Gemini API は、Gemini、Veo、Nano Banana などを使用して、プロンプトから本番環境への移行を最速で実現する手段です。これらの生成モデルをアプリケーションに統合して、テキストや画像の生成、マルチモーダル入力の分析、会話エージェントの構築を行うことができます。
Python
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-4-argon",
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-4-argon",
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-4-argon"))
.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(""));
Go
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateModelInteraction{
Model: interactions.Model("gemini-4-argon"),
Input: interactions.NewInteractionsInput("Explain how AI works in a few words"),
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
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-4-argon",
"input": "Explain how AI works in a few words"
}'
モデルの紹介
すべて表示Gemini 4 Argon New
100 万トークンの共有コンテキスト ウィンドウと最大 100 万トークンの長いデコードを備えた、Google のフラッグシップ推論モデル。
Gemini 3.8 Flash New
Google 史上最もインテリジェントな Flash モデル。長期的なソフトウェア エンジニアリング、自律型エージェント、複雑なエンタープライズ ワークフロー向けに設計されています。
Gemini 3.8 Flash TTS 新規
表現力豊かな演技、カスタム音声デザイン、ボイス レプリケーションを備えたスタジオ品質のテキスト読み上げモデル。
Gemini 3.5 Flash-Lite
低レイテンシ、高スループットのサブエージェント タスク向けに最適化された、大量の処理に対応するコスト重視のモデル。
Nano Banana
最先端の画像生成および編集モデル。
Gemini Omni Flash
Google の最先端の動画生成および編集モデル。
Gemini 3.5 Transcribe New
発話ベースの言語検出、話者ダイアライゼーション、単語タイムスタンプを備えた低レイテンシの音声文字変換モデル。
Gemini Robotics
Gemini のエージェント機能をロボティクスに導入し、物理世界での高度な推論を可能にする視覚言語モデル(VLM)。
機能を確認する
画像生成
Nano Banana を使用して、コンテキストに沿った画像をネイティブに生成、編集できます。
長いコンテキスト
数百万のトークンを Gemini モデルに入力し、非構造化画像、動画、ドキュメントから理解を導き出します。
構造化出力
Gemini が JSON(自動処理に適した構造化データ形式)で応答するように制限します。
関数呼び出し
Gemini を外部 API やツールに接続して、エージェント ワークフローを構築します。
Gemini Omni Flash による動画生成
Google の最先端モデルを使用して、テキストや画像のプロンプトから高品質な動画コンテンツを作成できます。
Live API を使用した音声エージェント
Live API を使用して、リアルタイムの音声アプリケーションとエージェントを構築します。
ツール
Google 検索、URL コンテキスト、Google マップ、コード実行、コンピュータの使用などの組み込みツールを使用して、Gemini を世界に接続します。
ドキュメントの理解
完全なマルチモーダル理解またはその他のテキストベースのファイル形式で、最大 1,000 ページの PDF ファイルを処理します。
思考中
思考機能によって、複雑なタスクやエージェントの推論がどのように向上するかをご覧ください。
エージェントを作成する
マネージド エージェントは、Gemini が独自にタスクを計画して完了するためのワークスペースを提供します。Gemini は、1 つのリクエストで、コードの作成と実行、ウェブの検索、ホストされたサンドボックス環境でのファイルの作成を行うことができます。事前構築済みの Antigravity エージェントから始めることも、独自の指示やツールでカスタマイズすることもできます。
Python
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-09-2026",
input=(
"Research the top 5 sustainable fashion brands, "
"compare their materials and pricing tiers, and "
"build an interactive dashboard in analysis.html."
),
environment="remote"
)
print(interaction.output_text)
JavaScript
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
const interaction = await ai.interactions.create({
agent: "antigravity-preview-09-2026",
input:
"Research the top 5 sustainable fashion brands, " +
"compare their materials and pricing tiers, and " +
"build an interactive dashboard in analysis.html.",
environment: "remote",
});
console.log(interaction.output_text);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.AgentOption;
import com.google.genai.gaos.models.interactions.CreateAgentInteraction;
import com.google.genai.gaos.models.interactions.CreateAgentInteractionEnvironment;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
Client client = new Client();
CreateAgentInteraction params =
CreateAgentInteraction.builder()
.agent(AgentOption.of("antigravity-preview-09-2026"))
.input(
InteractionsInput.of(
"Research the top 5 sustainable fashion brands, "
+ "compare their materials and pricing tiers, and "
+ "build an interactive dashboard in analysis.html."))
.environment(CreateAgentInteractionEnvironment.of("remote"))
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(params))
.interaction()
.get();
System.out.println(interaction.outputText().orElse(""));
Go
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateAgentInteraction{
Agent: interactions.AgentOption("antigravity-preview-09-2026"),
Input: interactions.NewInteractionsInput(
"Research the top 5 sustainable fashion brands, " +
"compare their materials and pricing tiers, and " +
"build an interactive dashboard in analysis.html.",
),
Environment: genai.Ptr(interactions.NewCreateAgentInteractionEnvironment("remote")),
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
REST
curl -X POST \
"https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"agent": "antigravity-preview-09-2026",
"input": "Research the top 5 sustainable fashion brands, compare their materials and pricing tiers, and build an interactive dashboard in analysis.html.",
"environment": "remote"
}'
Interactions API
Interactions API は、2026 年 6 月よりデフォルトのインターフェースとなり、Gemini モデルとエージェントを使用して構築するための最適な方法となります。新しいプロジェクトを開始する場合は、Interactions API を使用する必要があります。generateContent API は引き続きサポートされますが、現在は以前の API と見なされています。