Generate image with Nano Banana 2
Google Nano Banana 2 (Gemini 3.1 Flash Image) — high-efficiency text-to-image and image editing with multi-reference composition from up to 9 reference images and 0.5K-4K output. Billing: 65 credits per image at 1K (default); 50 at 0.5K, 100 at 2K, 150 at 4K.
Asynchronous. Returns a job id (the image is not in this response). Poll GET /v1/images/{id} until status is succeeded — the generated image URLs are in that response’s images array (each { url, position }).
Authorizations
API key as a bearer token: Authorization: Bearer bpx_live_xxx
Body
Text description of the image to generate.
Output aspect ratio.
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 Number of images to generate.
1 <= x <= 4Optional reference images (up to 9) for image editing and multi-reference composition. Each item is a public image URL, a data URI, raw base64, or an uploaded-file URL from POST /v1/uploads. Omit for text-to-image.
9Output resolution tier. 1K bills 65 credits per image; 0.5K bills 50, 2K bills 100, 4K bills 150.
0.5K, 1K, 2K, 4K