モデル

Google: Nano Banana 2.1

Markdown · JSON

Google: Nano Banana 2.1

Gemini Nano Banana 2.1は、テキストと視覚資料を基に、会話形式で画像を生成・編集します。文字の描画、インフォグラフィックの配置、複数ターンにわたる一貫性を改善しており、明確なビジュアル制作指示に対して1K~4Kの出力と最大14枚の参照画像に対応します。

モデルについて

この説明はモデルの機能を紹介するものです。Ailootで利用できる入力、出力、オプションは、選択したメソッドごとに以下に記載されています。

Gemini Nano Banana 2.1は、Googleの画像生成・会話型編集モデルです。Nano Banana 2の更新版で、視覚的な写実性、指示遵守、文字の描画、編集を重ねた際のキャラクターの一貫性が改善されています。入力仕様にはテキスト、画像、動画、PDFが含まれ、出力は画像とテキストです。商品のシーン、インフォグラフィック、具体的な修正を数回加えて展開するビジュアルシリーズに活用できます。

出力には1K、2K、4Kがあり、デフォルトは1Kです。Nano Banana 2の0.5Kオプションは引き継いでいません。公開されているアスペクト比は1:1、2:3、3:2、3:4、4:3、4:5、5:4、9:16、16:9、21:9に加え、縦長またはパノラマ形式の1:4、4:1、1:8、8:1です。Googleは、後者の横長・縦長形式について、2Kと4Kでタイル状アーティファクトを修正したと説明しています。解像度のラベルはサイズ区分であり、固定の長方形を表すものではありません。4Kの正方形画像は4096 × 4096ですが、公開されている16:9の4K出力は5504 × 3072です。

文字はビジュアル制作の重要な要素です。このモデルは、装飾された文字を読みやすく描画し、インフォグラフィックの要素をより正確に整理するよう設計されています。正確な見出し、ラベル、読む順番を用意し、承認済みの文言を使った画像を依頼してください。メニュー、図、説明用グラフィックでは、キャプションと視覚要素の関係を明示します。Googleは文言を先に作成してから画像を依頼することを勧めており、確定したテキストの指示を起点に構図を作れます。

参照画像の融合は最大14枚に対応します。公開仕様では、最大4人のキャラクターの一貫性と、最大10個の物体への忠実度が対象です。各参照画像に、認識可能な状態を保つ商品、キャラクターの外見、目的の背景、ビジュアルスタイルといった役割を割り当てます。商品向けの依頼例は「画像Aをボトルの形とラベルの参照に、画像Bを置き面と照明の参照にしてください。商品を変えず、折りたたんだタオルの隣に配置し、上部には指定の見出しを置くための空間を確保してください」です。

Google Web SearchとImage Searchによるグラウンディングは、生成に最新情報と視覚的な文脈を提供できます。Image Searchはウェブから取得した画像を参照として渡し、通常のウェブグラウンディングは対象に関する情報を提供します。事実に基づくグラフィックや、実在する物体の外見が重要なシーンに役立ちます。この画像検索の手順は、この目的で現実の人物画像を取得することには対応していません。Googleが公開している手順では、グラウンディングされた回答に出典と帰属のメタデータが付くため、アプリケーションは生成結果とともに保存してください。

思考レベルはminimal、medium、highから設定でき、このモデルのデフォルトはmediumです。最終出力の前に、構図や複雑な指示を検討する助けになります。画像ガイドには、その処理過程での中間構図画像が説明されていますが、目的とする最終成果物とは区別されます。プロンプト内の説明だけですべての出力設定が決まると期待せず、必要な最終レイアウト、アスペクト比、解像度を明示してください。

会話型編集では、追加の依頼で既存の結果の一部を変えられます。照明の調整、物体の移動、ラベルの翻訳などを、ほかの構図を保ちながら行います。前の画像または対話を次のターンに引き継ぎ、求める変更と保持する特徴の両方を示してください。キャラクターシリーズでは外見の参照を統一し、新しい角度や複雑なポーズが重要な場合はポーズ参照も使います。実用的な修正指示は「商品、ラベル、レイアウトを保持し、背景だけを暖かみのあるグレーにしてください」と書けます。

モデル仕様表には、入力上限131,072トークン、出力上限32,768トークンと記載されています。画像生成と検索グラウンディングは対応していますが、この版では音声生成、コード実行、関数呼び出し、構造化出力、キャッシュ、ファイル検索、URLコンテキスト、Live APIは対応機能として挙げられていません。動画は、生成する静止画の情報源として利用できますが、このモデル自体が動画生成モデルになるわけではありません。Googleは、画像枚数を正確に指定しても、その枚数にならない場合があるとも述べています。生成されるすべての画像にはSynthIDの透かしが含まれます。

最初の有用な制作指示には、画像の目的、被写体、構図、照明、カメラ視点、必要な文字、出力の形を含めます。たとえば、ラベル付きの3段階、読みやすい見出し、指定した色の階層を持つ縦長インフォグラフィックを依頼し、次の編集前に文言と相対的な配置を確認します。結果は商品イラスト、記事用グラフィック、デザイン参照として使え、選んだ画像とその説明文を一緒に保管できます。

実用タスク

実用タスク

英語の技術例

Refine an approved poster background

Edit the supplied event poster. Preserve every word, the headline hierarchy, illustration placement and portrait composition. Change only the background from cool white to warm ivory, keeping dark text readable and retaining the original accent color. Do not add shapes, badges, textures or extra captions. Return the revised poster image.

期待される結果

One edited poster with the original wording and layout preserved over a warm ivory background.

結果の確認

Compare every word and element position against the supplied poster, then inspect text contrast.
Ailoot Ultra · OpenAI チャット POST /v1/chat/completions google/gemini-nano-banana-2.1

google/gemini-nano-banana-2.1

Google /google/gemini-nano-banana-2.1

はじめに

Gemini Nano Banana 2.1は、テキストと視覚資料を基に、会話形式で画像を生成・編集します。文字の描画、インフォグラフィックの配置、複数ターンにわたる一貫性を改善しており、明確なビジュアル制作指示に対して1K~4Kの出力と最大14枚の参照画像に対応します。

対応する入力
テキスト
結果
テキスト

Ailootで利用可能 · 入力とメソッド

Ailoot Ultra · OpenAI チャット POST /v1/chat/completions
入力の種類
text
出力の種類
text
出力形式
jsonまたはSSE
フィールド種類要件値と制限デフォルト
フィールドmodel種類string要件必須値と制限
google/gemini-nano-banana-2.1
デフォルト—
フィールドmessages種類message[]要件必須値と制限
最小項目数: 1
デフォルト—
フィールドmessages[].role種類string要件必須値と制限
例:system, user, assistant, tool, function
条件: これらのロールはソースコードの互換型で明示されています。正確なロールの集合はモデルごとに異なります。
モデルによる
デフォルト—
フィールドmessages[].content種類string|content_part[]|null要件任意値と制限デフォルト—
フィールドmessages[].tool_calls種類tool_call[]要件任意値と制限デフォルト—
フィールドmessages[].tool_call_id種類string要件任意値と制限
適用条件: role=tool。実際に返されたIDを使ってください
デフォルト—
フィールドmessages[].name種類string要件任意値と制限デフォルト—
フィールドmessages[].reasoning_content種類string要件任意値と制限
適用条件: このモデルが使用する場合は、実際に返された推論をそのまま次のリクエストへ戻してください
デフォルト—
フィールドmessages[].reasoning_details種類object|array要件任意値と制限
モデルによる
デフォルト—
フィールドmax_tokens種類integer要件任意値と制限
最小値: 1
モデルによる
デフォルト—
フィールドmax_completion_tokens種類integer要件任意値と制限
最小値: 1
モデルによる
デフォルト—
フィールドstream種類boolean要件任意値と制限デフォルトfalse
フィールドstream_options.include_usage種類boolean要件任意値と制限
モデルによる
デフォルト—
フィールドtemperature種類number要件任意値と制限
モデルによる
デフォルト—
フィールドtop_p種類number要件任意値と制限
モデルによる
デフォルト—
フィールドstop種類string|string[]要件任意値と制限
モデルによる
デフォルト—
フィールドtools種類function_tool[]要件任意値と制限
モデルによる
デフォルト—
フィールドtools[].type種類string要件任意値と制限
function
モデルによる
デフォルト—
フィールドtools[].function.name種類string要件必須値と制限
適用条件: 関数ツールの指定あり
デフォルト—
フィールドtools[].function.description種類string要件任意値と制限デフォルト—
フィールドtools[].function.parameters種類JSON_schema要件任意値と制限デフォルト—
フィールドtool_choice種類string|object要件任意値と制限
モデルによる
デフォルト—
フィールドparallel_tool_calls種類boolean要件任意値と制限
モデルによる
デフォルト—
フィールドresponse_format種類object要件任意値と制限
モデルによる
デフォルト—
フィールドreasoning_effort種類string要件任意値と制限
モデルによる
デフォルト—
フィールドreasoning種類object要件任意値と制限
モデルによる
デフォルト—
フィールドservice_tier種類string要件任意値と制限
モデルによる
デフォルト—
フィールドinstructions種類string要件任意値と制限
互換性用のフィールド
デフォルト—
フィールドfunctions種類function[]要件任意値と制限
モデルによる
デフォルト—
フィールドfunction_call種類string|object要件任意値と制限
モデルによる
デフォルト—
フィールドprompt_cache_options種類object要件任意値と制限
モデルによる
デフォルト—
フィールドmodalities種類string[]要件任意値と制限
text
デフォルト—
フィールドprovider種類object要件任意値と制限
条件: このUltraテキストルートではprovider.optionsは拒否されます
デフォルト—
フィールドcache_control.ttl種類string要件任意値と制限
条件: 実際のプロンプトキャッシュの指定箇所では1hは拒否されます
デフォルト—
入力素材の組み合わせ

テキスト · UTF8テキスト

messages[].content

メソッドのパラメータとライフサイクル
パラメータ仕様
パラメータcontent_type仕様application/json
パラメータrequired仕様model, messages
パラメータmaterial_types仕様text
パラメータmessages仕様role/content形式のメッセージ配列
パラメータfile_material仕様実際のUTF-8文書をテキストとしてそのまま挿入します。ファイルIDは推定しません
パラメータoptional_controls仕様stream, temperature, top_p, stop, max_tokens, max_completion_tokens, reasoning, response_format, tools, tool_choice
パラメータcontrol_scope仕様モデル固有。ユーザーの関数ツールとホスト側のツールは異なります
パラメータoutput_modalities仕様text
パラメータhosted_operations仕様false
パラメータmultimodal_input_binding仕様null

ライフサイクル: synchronous_or_streamed

正確なモデルIDをmessagesとともに送ってください。

コンテキスト長は出力上限ではありません。

テキストファイルはテキストをそのまま提供できます。画像/音声/ファイルオブジェクトの入力には正確なバインディングが必要です。

料金

料金情報はリクエストの機能を追加しません。対応するパラメーターは選択したメソッドに記載されています。

高速モード
標準料金 高速モードが選択されている場合
Flex モード
標準料金 flex モードが選択されている場合
最大推論量
標準料金 推論量が最大で、調整に既定値(default)を使用する場合
推論量 · 高
標準料金 推論量が高い場合
推論量 · 最小(minimal)
標準料金 推論量が最小(minimal)の場合
明示的キャッシュの料金
無効 明示的キャッシュを要求した場合

Ailootの料金

設定別の価格

各料金を表示された条件と照合してください。選択肢となる設定の各組には、いずれか1つの料金を適用します。

設定料金表コンテキストトークン数が次の値を超える場合コンテキストトークン数が次の値以下の場合料金
設定トークンの基本単価料金表基本料金コンテキストトークン数が次の値を超える場合—コンテキストトークン数が次の値以下の場合上限なし料金
入力 · 入力トークン $0.003 / 1K トークン
出力 · 出力トークン $0.015 / 1K トークン
入力 · キャッシュ読み取り — / 1K トークン
入力 · キャッシュ書き込み — / 1K トークン
入力 · キャッシュ書き込み、1時間 — / 1K トークン
出力 · 出力画像トークン $0.06 / 1K 画像トークン
設定リクエスト長に応じた料金区分 1料金表—コンテキストトークン数が次の値を超える場合0コンテキストトークン数が次の値以下の場合上限なし料金
入力 · 入力トークン $0.003 / 1K トークン
出力 · 出力トークン $0.015 / 1K トークン
入力 · キャッシュ読み取り — / 1K トークン
入力 · キャッシュ書き込み — / 1K トークン
入力 · キャッシュ書き込み、1時間 — / 1K トークン

参考料金の詳細

モデル単位の参照料金表は、メソッド選択、見積もり、課金を変更しません。実際の課金には、選択したAilootメソッドの料金を適用します。

Google: Nano Banana 2.1

設定別の価格

設定課金条件料金
設定Google: Nano Banana 2.1 · 標準設定課金条件デフォルト設定料金
入力 · 入力トークン $0.003 / 1K トークン
出力 · 出力トークン $0.015 / 1K トークン
出力 · 出力画像 $0.06 / 1K トークン
出力 · ウェブ検索 $0.028 検索ごと

Ailootはリクエスト前に見積額を確保します。結果の取得後、実測使用量に基づいて最終料金を精算します。ストリーミング時の精算には最終の使用量記録を使用します。金額の確保と精算の仕組み →

リクエスト例

Ailoot Ultra · OpenAI チャット

curlPython SDKPythonストリーミング
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "google/gemini-nano-banana-2.1", "messages": [{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}]}')

Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
r=json.loads(Path("result.json").read_text())
for x in r.get("choices",[]):
    if x.get("message",{}).get("content"): print(x["message"]["content"])
PY_RESULT
from openai import OpenAI
import os

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.chat.completions.create(model='google/gemini-nano-banana-2.1',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}])
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(result.to_dict(mode="json"))
from openai import OpenAI
import os
from pathlib import Path

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

with client.chat.completions.stream(model='google/gemini-nano-banana-2.1',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
    with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
        for event in stream:
            payload=event.to_dict(mode="json")
            log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
            print(json.dumps(payload,ensure_ascii=False))
    final=stream.get_final_completion()
    save_result(final.to_dict(mode="json"),"stream-result")

結果を受け取って保存

Ailoot Ultra · OpenAI チャット

jsonまたはSSE

完了した結果をすべて保存

返された完全なレスポンス、ファイル、コンテンツ部分をすべて保存してください。

すべての選択肢と、その内容・ツール呼び出し・推論を保持してください。SSEでは選択肢/ツールのインデックスごとに差分を組み立て、最終的な終了理由と使用量を残します。

元のレスポンスを確認する場合

リクエスト/応答IDとヘッダーを保持してください。テキストジョブを取得する汎用URLは提供されません。

レスポンスのフィールド
フィールド種類
フィールドchoices[].index種類integer
フィールドchoices[].message.content種類string|null
フィールドchoices[].message.tool_calls種類tool_call[]
フィールドchoices[].message.reasoning_content種類string
フィールドchoices[].message.reasoning_details種類object|array
フィールドchoices[].finish_reason種類string|null
フィールドusage種類object
エラーと次の手順
レスポンス条件次の手順
レスポンス400 · invalid_request_error条件必須フィールド、素材の表現形式、またはパラメーター値が不正です次の手順新しい生成リクエストを送る前に、指定されたフィールドを修正してください。

エイリアス

モデルのエイリアス

Ailoot Ultra google/gemini-nano-banana-2.1

メソッドパスのエイリアス

/v1/images

関連する呼び出し用ID

google/gemini-nano-banana-2.1

Ailoot Ultra · 画像 POST /v1/images/generations google/gemini-nano-banana-2.1

google/gemini-nano-banana-2.1

Google /google/gemini-nano-banana-2.1

はじめに

Gemini Nano Banana 2.1は、テキストと視覚資料を基に、会話形式で画像を生成・編集します。文字の描画、インフォグラフィックの配置、複数ターンにわたる一貫性を改善しており、明確なビジュアル制作指示に対して1K~4Kの出力と最大14枚の参照画像に対応します。

対応する入力
テキスト · 画像
結果
画像

Ailootで利用可能 · 入力とメソッド

Ailoot Ultra · 画像 POST /v1/images/generations
入力の種類
text, image
出力の種類
image
フィールド種類要件値と制限デフォルト
フィールドmodel種類string要件必須値と制限
google/gemini-nano-banana-2.1
デフォルト—
フィールドprompt種類string要件必須値と制限
最小の長さ: 1
デフォルト—
フィールドresolution種類string要件任意値と制限
1K, 2K, 4K
デフォルト—
フィールドaspect_ratio種類string要件任意値と制限
1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9
デフォルト—
フィールドn種類integer要件任意値と制限
最小値: 1
最大値: 1
デフォルト—
フィールドinput_references種類array要件任意値と制限
最小項目数: 0
最大項目数: 14
デフォルト—
フィールドprovider種類object要件任意値と制限デフォルト—
メソッドのパラメータとライフサイクル
パラメータ仕様
パラメータcontent_type仕様application/json
パラメータrequired仕様model, prompt
パラメータmaterial_types仕様text, image

ライフサイクル: synchronous_result_then_owned_library

GET /v1/media/tasks/{task_id} · 実際に返された task_id またはメディアライブラリのレコード

GET /v1/media/assets/{asset_id}/content

GET /v1/media/assets

GET /v1/media/assets/{asset_id}

料金

最終料金の計算方法

表示料金は生成前の費用の見積もりです。最終請求額は、元の生成処理に記録された費用から計算されます。実測された出力時間や予測数量が、そのまま最終的な課金数量になるわけではありません。

料金情報はリクエストの機能を追加しません。対応するパラメーターは選択したメソッドに記載されています。

高速モード
未指定 高速モードが選択されている場合
Flex モード
未指定 flex モードが選択されている場合
最大推論量
未指定 推論量が最大で、調整に既定値(default)を使用する場合

比較用の推定料金

設定別の価格

各料金を表示された条件と照合してください。選択肢となる設定の各組には、いずれか1つの料金を適用します。

設定料金表予測数量料金
設定基本トークン料金料金表基本料金予測数量—料金
入力 · 入力トークン · 比較専用の見積もり — / 1K トークン
出力 · 出力トークン · 比較専用の見積もり — / 1K トークン
入力 · キャッシュ読み取り · 比較専用の見積もり — / 1K トークン
入力 · キャッシュ書き込み · 比較専用の見積もり — / 1K トークン
入力 · キャッシュ書き込み、1時間 · 比較専用の見積もり — / 1K トークン
設定生成費用の見積もり料金表—予測数量生成1回分の概算料金
出力 · 推定生成コスト · 比較専用の見積もり $0.24576 生成前の見積もり

この見積もりは追加料金ではなく、完了した生成処理に対する固定料金でもありません。

Ailootはリクエスト前に見積額を確保します。結果の取得後、実測使用量に基づいて最終料金を精算します。ストリーミング時の精算には最終の使用量記録を使用します。金額の確保と精算の仕組み →

リクエスト例

Ailoot Ultra · 画像

curl
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
export AILOOT_API_KEY
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p={'model': 'google/gemini-nano-banana-2.1', 'prompt': 'a red panda astronaut floating in space, studio lighting'}

Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/images/generations \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin

def save_images(items):
    if not items: raise SystemExit("No completed images; retain the full response")
    for index, item in enumerate(items):
        encoded=item.get("b64_json")
        uri=item.get("url", "")
        if not encoded and uri.startswith("data:image/"):
            header, separator, encoded=uri.partition(",")
            if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
        if encoded:
            raw=base64.b64decode(encoded,validate=True)
        elif uri:
            uri=urljoin("https://api.ailoot.ai",uri)
            parsed=urlsplit(uri)
            if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
                raise SystemExit("Invalid returned image URL")
            owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
            args=["curl","--fail-with-body","--silent","--show-error",uri]
            if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
            temporary=Path(f"image-{index}.bin")
            subprocess.run(args+["-o",str(temporary)],check=True)
            raw=temporary.read_bytes()
            temporary.unlink()
        else: raise SystemExit("Image has neither bytes nor URL")
        if not raw: raise SystemExit("Empty image result")
        ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
        Path(f"image-{index}.{ext}").write_bytes(raw)
    print("Every returned image saved; complete response metadata retained")
save_images(json.loads(Path("result.json").read_text())["data"])
PY_RESULT

結果を受け取って保存

Ailoot Ultra · 画像

返された画像をすべてダウンロードするか、Base64の内容を保存

  • GET /v1/media/tasks/{task_id}
  • GET /v1/media/assets/{asset_id}/content
  • GET /v1/media/assets
  • GET /v1/media/assets/{asset_id}
その他のコンテンツ取得
自分が所有する既存のアセットを読み取る
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/media/assets \
  -H "Authorization: Bearer $AILOOT_API_KEY" -o owned-assets.json
# Preserve every returned asset and follow its exact signed content URL. Do not construct a signed token.
完了した結果をすべて保存

完了した画像をすべて保存してください。返された各URLから取得するか、Base64の内容をデコードしてください。

レスポンスとヘッダーの全体、実際の出力すべて、最初に返された識別子、使用量フィールドすべてを保存してください。作成リクエストを再送せずに、元の操作を復旧してください。

元のレスポンスを確認する場合

照合のため、返された X-Client-Request-ID を保存してください。実際に返された task_id/asset_id の値、または自分が所有するメディアライブラリだけを使って読み取ってください。操作 ID からタスクの URL を組み立てたり、作成リクエストを再送したりしないでください。

レスポンスのフィールド
フィールド種類
フィールドcreated種類
フィールドdata[].url種類
フィールドdata[].b64_json種類
フィールドusage種類

エイリアス

モデルのエイリアス

Ailoot Ultra google/gemini-nano-banana-2.1

メソッドパスのエイリアス

/v1/images

関連する呼び出し用ID

google/gemini-nano-banana-2.1

Ailoot Ultra · Anthropic メッセージ POST /v1/messages google/gemini-nano-banana-2.1

google/gemini-nano-banana-2.1

Google /google/gemini-nano-banana-2.1

はじめに

Gemini Nano Banana 2.1は、テキストと視覚資料を基に、会話形式で画像を生成・編集します。文字の描画、インフォグラフィックの配置、複数ターンにわたる一貫性を改善しており、明確なビジュアル制作指示に対して1K~4Kの出力と最大14枚の参照画像に対応します。

対応する入力
テキスト
結果
json · sse

Ailootで利用可能 · 入力とメソッド

Ailoot Ultra · Anthropic メッセージ POST /v1/messages
入力の種類
text
出力の種類
json, sse
出力形式
JSONまたはSSE
フィールド種類要件値と制限デフォルト
フィールドmodel種類string要件必須値と制限
google/gemini-nano-banana-2.1
デフォルト—
フィールドmessages種類message[]要件必須値と制限デフォルト—
フィールドmessages[].role種類string要件必須値と制限
user, assistant
デフォルト—
フィールドmessages[].content種類string要件必須値と制限デフォルト—
フィールドmax_tokens種類integer要件必須値と制限デフォルト—
フィールドstream種類boolean要件任意値と制限デフォルトfalse
入力素材の組み合わせ

テキスト · UTF-8テキスト

messages[].contentの文字列

メソッドのパラメータとライフサイクル
パラメータ仕様
パラメータcontent_type仕様application/json
パラメータrequired仕様model, messages, max_tokens
パラメータoptional_controls仕様stream
パラメータmaterial_types仕様text
パラメータtext_file_material仕様実際のUTF-8文書を読み、その本文を指定された入力またはメッセージ内容の文字列に入れてください。

ライフサイクル: synchronous_or_streamed

料金

料金情報はリクエストの機能を追加しません。対応するパラメーターは選択したメソッドに記載されています。

高速モード
標準料金 高速モードが選択されている場合
Flex モード
標準料金 flex モードが選択されている場合
最大推論量
標準料金 推論量が最大で、調整に既定値(default)を使用する場合
推論量 · 高
標準料金 推論量が高い場合
推論量 · 最小(minimal)
標準料金 推論量が最小(minimal)の場合
明示的キャッシュの料金
無効 明示的キャッシュを要求した場合

Ailootの料金

設定別の価格

各料金を表示された条件と照合してください。選択肢となる設定の各組には、いずれか1つの料金を適用します。

設定料金表コンテキストトークン数が次の値を超える場合コンテキストトークン数が次の値以下の場合料金
設定トークンの基本単価料金表基本料金コンテキストトークン数が次の値を超える場合—コンテキストトークン数が次の値以下の場合上限なし料金
入力 · 入力トークン $0.003 / 1K トークン
出力 · 出力トークン $0.015 / 1K トークン
入力 · キャッシュ読み取り — / 1K トークン
入力 · キャッシュ書き込み — / 1K トークン
入力 · キャッシュ書き込み、1時間 — / 1K トークン
出力 · 出力画像トークン $0.06 / 1K 画像トークン
設定リクエスト長に応じた料金区分 1料金表—コンテキストトークン数が次の値を超える場合0コンテキストトークン数が次の値以下の場合上限なし料金
入力 · 入力トークン $0.003 / 1K トークン
出力 · 出力トークン $0.015 / 1K トークン
入力 · キャッシュ読み取り — / 1K トークン
入力 · キャッシュ書き込み — / 1K トークン
入力 · キャッシュ書き込み、1時間 — / 1K トークン

Ailootはリクエスト前に見積額を確保します。結果の取得後、実測使用量に基づいて最終料金を精算します。ストリーミング時の精算には最終の使用量記録を使用します。金額の確保と精算の仕組み →

リクエスト例

Ailoot Ultra · Anthropic メッセージ

必要最小限の完全な JSON ボディcurl · ご自身の UTF-8 ドキュメントを使用するPython · 結果全体を保存する
{
  "model": "google/gemini-nano-banana-2.1",
  "max_tokens": 128,
  "messages": [
    {
      "role": "user",
      "content": "Summarize the incident report."
    }
  ],
  "stream": false
}
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 document}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json, os
from pathlib import Path

source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
    raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
    raise SystemExit('Choose a document containing text')
payload = {'model': 'google/gemini-nano-banana-2.1', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}
payload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\n\n' + text
Path('request.json').write_text(json.dumps(payload, ensure_ascii=False), encoding='utf-8')
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
  -H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path

result = json.loads(Path('result.json').read_text(encoding='utf-8'))
print(json.dumps(result, ensure_ascii=False, indent=2))
PY_RESULT
import json, os
from pathlib import Path

source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
    raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
    raise SystemExit('Choose a document containing text')
payload = {'model': 'google/gemini-nano-banana-2.1', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}
payload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\n\n' + text
from urllib.request import Request, urlopen
from urllib.error import HTTPError

api_key = os.environ['AILOOT_API_KEY']
if not api_key.strip():
    raise SystemExit('Set AILOOT_API_KEY before making a request')
headers = {'x-api-key': 'PLACEHOLDER_KEY', 'anthropic-version': '2023-06-01', 'Content-Type': 'application/json'}
headers['x-api-key'] = api_key
request = Request('https://api.ailoot.ai/v1/messages', data=json.dumps(payload, ensure_ascii=False).encode('utf-8'), headers=headers, method='POST')
try:
    with urlopen(request, timeout=120) as response:
        raw = response.read()
        Path('response-headers.txt').write_text(str(response.headers), encoding='utf-8')
except HTTPError as error:
    Path('result.json').write_bytes(error.read())
    Path('response-headers.txt').write_text(str(error.headers), encoding='utf-8')
    raise
Path('result.json').write_bytes(raw)
import json
from pathlib import Path

result = json.loads(Path('result.json').read_text(encoding='utf-8'))
print(json.dumps(result, ensure_ascii=False, indent=2))

結果を受け取って保存

Ailoot Ultra · Anthropic メッセージ

JSONまたはSSE

完了した結果をすべて保存

返された完全なレスポンス、ファイル、コンテンツ部分をすべて保存してください。

すべてのコンテンツブロック、思考署名、実際のツール利用IDを保持してください。SSEのすべてのブロック差分を組み立てます。最初のテキストブロックだけでは完全な出力になりません。

元のレスポンスを確認する場合

リクエスト/応答IDとヘッダーを保持してください。テキストジョブを取得する汎用URLは提供されません。

レスポンスのフィールド
フィールド種類
フィールドid種類string
フィールドmodel種類string
フィールドcontent[]種類text|thinking|tool_use|other content block
フィールドstop_reason種類string|null
フィールドusage種類object
エラーと次の手順
レスポンス条件次の手順
レスポンス400 · invalid_request_error条件必須フィールド、素材の表現形式、またはパラメーター値が不正です次の手順新しい生成リクエストを送る前に、指定されたフィールドを修正してください。

エイリアス

モデルのエイリアス

Ailoot Ultra google/gemini-nano-banana-2.1

メソッドパスのエイリアス

/v1/images

関連する呼び出し用ID

google/gemini-nano-banana-2.1

FAQ · Google: Nano Banana 2.1
利用できる入力と結果は何ですか?

POST /v1/chat/completions · google/gemini-nano-banana-2.1: text → text

POST /v1/images/generations · google/gemini-nano-banana-2.1: text, image → image

POST /v1/messages · google/gemini-nano-banana-2.1: text → json, sse

リクエストはどの項目を使用しますか?

POST /v1/chat/completions · google/gemini-nano-banana-2.1: model, messages, stream, modalities, provider

POST /v1/images/generations · google/gemini-nano-banana-2.1: model, prompt, resolution, aspect_ratio, n, input_references, provider

POST /v1/messages · google/gemini-nano-banana-2.1: model, messages, max_tokens, stream

どの制限が適用されますか?

POST /v1/chat/completions · google/gemini-nano-banana-2.1: messages.min_items: 1

POST /v1/images/generations · google/gemini-nano-banana-2.1: n.minimum: 1; n.maximum: 1

詳細を見る

AilootをClaude Code、OpenCode、Hermes、自分のアプリに接続しましょう。

企業とそのプロジェクト群

企業とそのプロジェクト群:数百万の顧客、毎月数十億規模の売上。

トークンを割引価格で購入。

継続利用にサブスクリプション割引。プロモコードでトークン購入が最大50%割引。

サブスクリプション
定期的なリクエストに合う割引プランを選びましょう。
最大50%のプロモコード
購入時にコードを入力すると、実施中のキャンペーンに沿って価格を再計算します。
支出を履歴で確認
各リクエストのモデル、トークン、金額が保存されます。

サブスクリプションを選ぶ · モデルの価格を見る

販売する製品に、 APIを組み込みましょう。

SaaS、アプリ、ボットをAilootの公式サービス提供条件とライセンス契約に基づいて接続できます。再販にはリセラーライセンスを申請できます。

商用アプリ
サービスの有料機能に、文章、画像、動画、音声の生成を組み込めます。
リセラーライセンス
プロジェクトの説明とアクセスの仕組みをお送りください。利用・再販条件の書面を申請できます。
サイトで契約文書を確認
接続前にサービス提供条件、ライセンス契約、データ処理ポリシーを読めます。

リセラーライセンスを申請 · サービス提供条件とライセンス契約