Nano Banana 2· テキストから画像
https://api.foxwire.ai/v1/media/generationsPricing Model
1K 3,4 ₽ · 2K 5,1 ₽ · 4K 7,65 ₽ per image. Billed only on success.
Execution Flow
Asynchronous submission model. Submitting requests queues background workers.
#タスクを送信
メディア生成は非同期です。待たずにすぐタスクIDを取得できます。
curl https://api.foxwire.ai/v1/media/generations \
-H "Authorization: Bearer $CORRY_KEY" \
-H "Content-Type: application/json" \
-d '{ "model": "nano-banana-2", "prompt": "a cute robot mascot, flat vector logo" }'
# → { "id": "cmus7q0x9000108l3f5g2abcd", "status": "queued" }#リクエストパラメータ
| パラメータ | 種類 | 必須 | デフォルト | 説明 |
|---|---|---|---|---|
prompt | string | はい | — | Text prompt describing the image to generate (max 20000 chars). |
image_input | string[] | いいえ | — | Optional reference/source image URLs to transform (max 14, ≤30MB each; jpeg/png/webp). |
aspect_ratio | string | いいえ | auto | Aspect ratio of the output image. 選択肢: auto, 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 |
resolution | string | いいえ | 1K | Output resolution. Higher resolutions take longer to generate. 選択肢: 1K, 2K, 4K |
output_format | string | いいえ | jpg | Format of the output image. 選択肢: jpg, png |
callback_url | string | いいえ | — | Optional public http(s) URL. We POST the task result here the moment generation finishes (success or failure). |
#Poll for the result
Generation runs asynchronously — the submit call returns immediately with a task id. Poll this endpoint with that id every few seconds until status becomes succeeded (result ready) or a terminal error (failed / timeout).
https://api.foxwire.ai/v1/media/generations/{id}# take the id from the submit response, then poll every ~3s
curl https://api.foxwire.ai/v1/media/generations/cmus7q0x9000108l3f5g2abcd \
-H "Authorization: Bearer $CORRY_KEY"
# repeat until "status" is "succeeded" (or "failed" / "timeout")#レスポンス例
送信時
{
"id": "cmus7q0x9000108l3f5g2abcd",
"status": "queued",
"type": "image",
"model": "nano-banana-2"
}成功時(ポーリング後)
{
"id": "cmus7q0x9000108l3f5g2abcd",
"status": "succeeded",
"type": "image",
"model": "nano-banana-2",
"result": { "urls": ["https://cdn.sozdai.ai/image/1782537315223-b49c0c1b771f.png"] },
"cost": "0.0500",
"currency": "USD"
}レスポンスのフィールド
| フィールド | 種類 | 説明 |
|---|---|---|
status | string | タスクのステータス:queued / submitted / succeeded / failed / timeout。 |
type | string | メディアの種類:image / video / music。 |
model | string | リクエストしたモデル。 |
result | object | 成功時に存在します。result.urls は永続的なファイルURLの配列です。 |
error | string | エラーメッセージ。タスクが失敗したときに存在します。 |
cost | string | このタスクの請求額 — USD 文字列(例:"0.1200")。currency フィールドを参照してください。 |
currency | string | Currency of cost — always "USD". |



