Gemini API

すべての新しいプロジェクトに Interactions API を使用することをおすすめします。エージェント ワークフロー、状態管理、最新モデル向けに最適化されています。詳しくは、Interactions API の概要をご覧ください。

Gemini、Veo、Nano Banana などを使用して、プロンプトから本番環境に移行する最も速い方法。

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-3.5-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.5-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.5-flash",
    "input": "Explain how AI works in a few words"
  }'
構築を開始

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


モデルの紹介

すべて表示

機能を確認する