Runbase

Command Palette

Search for a command to run...

Gemini

Nano Banana 2

ID:google/nano-banana-2

Google の Nano Banana 2 画像生成 API — Gemini 3.1 Flash ベースで 4K 出力、15 種のアスペクト比、最大 5 キャラクターの一貫性維持に対応。

テキストから画像画像編集参照画像4Kテキストレンダリング

概要

Google の Nano Banana 2 画像生成 API — Gemini 3.1 Flash ベースで 4K 出力、15 種のアスペクト比、最大 5 キャラクターの一貫性維持に対応。

認証

すべての API リクエストには、Authorization ヘッダーで Bearer スキームを使用した有効な API キーが必要です。

クイックスタート

認証情報

環境変数 RUNBASE_API_KEY を設定してください。

Shell
export RUNBASE_API_KEY=your-api-key

実行を作成

Shell
curl -s https://runbase.net/api/v1/runs \
  -H "Authorization: Bearer $RUNBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/nano-banana-2",
    "input": {
      "prompt": "A cinematic product photo of a ceramic lamp"
    }
  }'

実行

実行は非同期で処理されます。リクエストを送信し、結果をポーリングで取得してください。

実行を作成

Shell
curl -s https://runbase.net/api/v1/runs \
  -H "Authorization: Bearer $RUNBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/nano-banana-2",
    "input": { "prompt": "A cinematic product photo of a ceramic lamp" }
  }'

実行ステータスを取得

Shell
curl -s https://runbase.net/api/v1/runs/RUN_ID \
  -H "Authorization: Bearer $RUNBASE_API_KEY"

結果を取得

status が "succeeded" になるまでステータスエンドポイントをポーリングし、レスポンスの output.urls を参照してください。

入力スキーマ

パラメータタイプ必須説明
promptstring必須Prompt
aspect_ratiostring任意Aspect ratioオプション: 1:11:41:82:33:23:44:14:34:55:48:19:1616:921:9auto
resolutionstring任意Resolutionオプション: 1K2K4K
image_urlsstring[]任意Reference images

出力スキーマ

フィールドタイプ説明
urlsstring[]生成された出力 URL

エラー

API は標準の HTTP ステータスコードで成功または失敗を示します。

ステータスコード説明
400Request không hợp lệ - thiếu hoặc sai định dạng tham số
401Xác thực thất bại - thiếu hoặc sai khóa API
402Không đủ tín dụng
403Bị từ chối - IP không được phép hoặc khóa API vượt giới hạn chi tiêu
404Không tìm thấy lượt chạy
429Vượt giới hạn tốc độ
500Lỗi máy chủ nội bộ