google/nano-banana-2
Nano Banana 2 is Google's new state-of-the-art fast image generation and editing model
Example output — click Run to generate your own
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
https://api.sandbase.ai/v1/rungoogle/nano-banana-2Input Schema
6 parameters · 1 required · 5 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Required | The text prompt to generate an image from. · Min length: 3 · Max length: 50000 · Default: "A photo of a close-up portrait of an elderly Japanese ceramicist with deep, sun-etched wrinkles and a warm, knowing smile. He is carefully inspecting a freshly glazed tea bowl. The setting is his rustic, sun-drenched workshop. The scene is illuminated by soft, golden hour light streaming through a window, highlighting the fine texture of the clay. Captured with an 85mm portrait lens, resulting in a soft, blurred background (bokeh). The overall mood is serene and masterful. Vertical portrait orientation." |
resolution | string | Optional | The resolution of the image to generate. · Options: 0.5K, 1K, 2K, 4K · Default: "1K" 0.5K1K2K4K |
aspect_ratio | string | Optional | The aspect ratio of the generated image. · Options: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16, 4:1, 1:4, 8:1, 1:8 · Default: "1:1" 21:916:93:24:35:41:14:53:42:39:164:11:48:11:8 |
output_format | string | Optional | The format of the generated image. · Options: jpeg, png · Default: "png" jpegpng |
enable_web_search | boolean | Optional | Enable Google web search grounding to provide background context for image generation. · Default: false |
enable_image_search | boolean | Optional | Enable Google image search to retrieve web images as visual background reference for generation. · Default: false |
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
Async Workflow
This model uses asynchronous execution. Submit a request and poll for the result.
- Submit — POST to /v1/run, receive an
id - Poll — GET /v1/run/{id} until status is
completed,failed, ortimeout - Retrieve — Read
outputsfrom the completed response
Code Examples
Ready-to-run snippets
# Step 1: Submit
curl -X POST https://api.sandbase.ai/v1/run \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "google/nano-banana-2",
"prompt": "A photo of a close-up portrait of an elderly Japanese ceramicist with deep, sun-etched wrinkles and a warm, knowing smile. He is carefully inspecting a freshly glazed tea bowl. The setting is his rustic, sun-drenched workshop. The scene is illuminated by soft, golden hour light streaming through a window, highlighting the fine texture of the clay. Captured with an 85mm portrait lens, resulting in a soft, blurred background (bokeh). The overall mood is serene and masterful. Vertical portrait orientation.",
"resolution": "1K",
"aspect_ratio": "1:1",
"output_format": "png",
"enable_web_search": false,
"enable_image_search": false
}'
# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
-H "Authorization: Bearer YOUR_API_KEY"API README
Google Nano Banana 2 Text-to-Image
Google's fast image generation model built on Gemini 3.1 Flash architecture. Optimized for speed and cost — delivers quality images with flexible resolutions, extended aspect ratios, and built-in web/image search grounding.
- Need to edit an existing image? Try Nano Banana 2 Edit.
Highlights
Fast generation — Optimized for speed, ideal for high-volume production workflows requiring rapid turnaround.
Web & Image Search grounding — Retrieve web images via Google Image Search as visual background context. Enables reference-aware generation without manually uploading assets.
Extended aspect ratios — Supports extreme ratios like 1:8 and 8:1 for banners, scrolls, and panoramic content, in addition to standard ratios.
Low-cost 0.5K resolution — New 512px output tier at reduced cost for thumbnails, previews, and prototyping.
Free Web & Image Search — Web search and image search grounding included at no extra cost.
Native text rendering — Renders readable text in images across Latin, CJK scripts with correct spelling and placement.
Pricing
| Resolution | Price |
|---|---|
| 0.5K | $0.04 |
| 1K | $0.06 |
| 2K | $0.10 |
| 4K | $0.14 |
| Web Search | Free |
| Image Search | Free |
When to Use
| ✅ Good fit | ❌ Consider alternatives |
|---|---|
| Rapid prototyping and previews | Highest quality brand assets (use Nano Banana Pro) |
| High-volume batch generation | Pixel-perfect text layout |
| Banners and ultra-wide/tall content | Video or animation |
| Thumbnails and social media content | Ultra-high resolution print (4K+) |
| Cost-sensitive workflows | Iterative mask-based editing (use Edit model) |
Prompt Guide
Structure your prompts for best results:
Scene: [environment, time of day, background]
Subject: [main focus, position, action]
Details: [materials, lighting, camera angle, mood]
Text: [exact text to render, font style, placement]
Style: [photorealistic, illustration, flat design, etc.]
Example:
A vibrant 16:9 banner for a music festival. Neon-lit stage with a crowd silhouette in the foreground, confetti in the air. Title text "SUMMER BEATS 2026" in bold graffiti style at center. Electric purple and cyan color palette.
Technical Specs
| Spec | Value |
|---|---|
| Input | Text prompt (max 50,000 characters) |
| Output | PNG or JPEG |
| Resolution | 0.5K / 1K / 2K / 4K |
| Aspect ratio | 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16, 4:1, 1:4, 8:1, 1:8 |
| Web Search | Google web + image search grounding |
| Reference images | Up to 14 |
| Execution | Async (submit → poll for result) |
| Typical latency | 15–30 seconds |
Related
- Nano Banana 2 Edit — Edit existing images with multi-image reference support
- Nano Banana Pro — Higher quality generation at higher cost

