ナビゲーションにスキップ

Nano Banana 2

Generate or edit images from text and up to 14 public HTTPS reference images, with 1K, 2K, or 4K output.

Supported modes

ModeRequired inputRules
Text to imagemodel, promptOmit images.
Reference imagemodel, prompt, imagesProvide 1–14 public HTTPS PNG, JPEG or WebP image URLs.

Async flow: Create the task, save data.id, then poll the Task with GET /v1/tasks/{task_id}. On succeeded, read data.output.media. On failed, read data.error_code and data.error_message, then follow the error and retry policy.

Using a local file? upload a local input first and pass the returned data.url.

認証

AuthorizationBearer

Send your API key as Authorization: Bearer <BEATAPI_API_KEY>.

ヘッダー

Idempotency-Keystringオプション<=255 characters

リクエスト

This endpoint expects an object.
model"nano-banana-2"必須

Must be nano-banana-2.

promptstring必須1-5000 characters

Generation or image-editing instructions.

imageslist of stringsオプション

Public HTTPS reference-image URLs in PNG, JPEG or WebP; each link is checked when the task is created, and one that is not such an image (an error page, a GIF, a 404) is refused with 400. Omit for text-to-image.

aspect_ratioenumオプションデフォルト値 1:1
Output image aspect ratio.
resolutionenumオプションデフォルト値 1K
Output resolution tier.
許可された値:
output_formatenumオプションデフォルト値 png
Output image file format.
許可された値:

レスポンス

Image generation task accepted

エラー

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error