Gemini API

Gemini API は、Gemini、Veo、Nano Banana などを活用して、プロンプトから運用までを最速で実現する手段です。これらの生成モデルをアプリケーションに統合して、テキストと画像を生成したり、マルチモーダル入力を分析したり、会話型エージェントを構築したりできます。

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

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"
  }'
構築を開始する

スタートガイドに沿って、API キーを取得し、最初の API 呼び出しを数分で行います。


各モデルについて

すべて表示

機能を確認する

Interactions API

Interactions API は 2026 年 6 月にデフォルトのインターフェースとなり、今後 Gemini モデルとエージェントを構築する最善の方法となります。新しいプロジェクトを開始する場合は、Interactions API を使用する必要があります。generateContent API は引き続きサポートされますが、現在はレガシーと見なされています。