Gemini API は、Gemini、Veo、Nano Banana などを利用して、プロンプトから運用までを最速で実現する手段です。これらの生成モデルをアプリケーションに統合して、テキストと画像を生成したり、マルチモーダル入力を分析したり、会話型エージェントを構築したりできます。
Python
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)
JavaScript
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);
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.8-flash",
"input": "Explain how AI works in a few words"
}'
各モデルについて
すべて表示Gemini 3.8 Flash 新モデル
長期的なソフトウェア エンジニアリング、自律エージェント、複雑なエンタープライズ ワークフロー向けに設計された、Google の最もインテリジェントな Flash モデル。
Gemini 3.5 Flash-Lite
低レイテンシの高スループット サブエージェント タスク向けに最適化された、大量のトラフィックを処理するコスト重視のモデル。
Gemini 3.1 Pro
最先端の推論に基づいて構築された、Google の最もインテリジェントなモデルであり、マルチモーダル理解において世界最高水準のモデルです。
Nano Banana 2 と Nano Banana Pro
最先端の画像生成および編集モデル。
Gemini Omni Flash
Google の最先端の動画生成および編集モデル。
Gemini 3.5 Transcribe 新機能
発話ベースの言語検出、話者ダイアライゼーション、単語タイムスタンプを備えた低遅延の音声文字変換モデル。
Gemini Robotics
Gemini のエージェント機能をロボット工学に導入し、物理世界での高度な推論を可能にする視覚言語モデル(VLM)。
機能を確認する
画像生成
Nano Banana を使用して、コンテキストに沿った画像をネイティブに生成、編集できます。
長いコンテキスト
Gemini モデルに数百万個のトークンを入力し、非構造化画像、動画、ドキュメントから理解を導き出します。
構造化出力
Gemini が JSON(自動処理に適した構造化データ形式)で応答するように制約します。
関数呼び出し
Gemini を外部 API やツールに接続して、エージェント ワークフローを構築します。
Veo 3.1 による動画生成
Google の最先端モデルを使用して、テキストや画像のプロンプトから高品質な動画コンテンツを作成できます。
Live API を使用した音声エージェント
Live API を使用して、リアルタイム音声アプリケーションとエージェントを構築します。
ツール
Gemini を Google 検索、URL コンテキスト、Google マップ、コード実行、コンピュータの使用などの組み込みツールを通じて世界に接続します。
ドキュメントの理解
最大 1,000 ページの PDF ファイルや、その他のテキストベースのファイル形式を、マルチモーダル理解で完全に理解して処理します。
思考
思考能力が複雑なタスクとエージェントの推論をどのように改善するかについて説明します。
エージェントを作成する
Managed Agents は、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(""));
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
2026 年 6 月より、Interactions API がデフォルトのインターフェースとなり、今後 Gemini モデルとエージェントを構築する最善の方法となります。新しいプロジェクトを開始する場合は、Interactions API を使用する必要があります。generateContent API は引き続きサポートされますが、現在はレガシーと見なされています。