Nano Banana 2.1
Google Nano Banana 2.1 on reAPI — text-to-image and image editing with up to 14 references, 1K / 2K / 4K output, search grounding and thinking levels, one flat price per image.
Google's Nano Banana 2.1 image model on reAPI. Text-to-image,
image editing and multi-image fusion (up to 14 reference images and
10 reference videos),
Google Search grounding (web and image search), three thinking
levels, 14 aspect ratios and 1K / 2K / 4K output — all at one flat
price per image. Async-first: submit returns a task id; poll until ready.
See current pricing on the
model page.
Quick example
curl https://reapi.ai/api/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-2.1",
"prompt": "A clean infographic poster titled \"HOW COFFEE IS MADE\" with four labeled steps",
"aspect_ratio": "3:4",
"resolution": "2k"
}'import requests
resp = requests.post(
"https://reapi.ai/api/v1/images/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "nano-banana-2.1",
"prompt": 'A clean infographic poster titled "HOW COFFEE IS MADE" with four labeled steps',
"aspect_ratio": "3:4",
"resolution": "2k",
},
timeout=30,
)
print(resp.json())const r = await fetch("https://reapi.ai/api/v1/images/generations", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "nano-banana-2.1",
prompt: 'A clean infographic poster titled "HOW COFFEE IS MADE" with four labeled steps',
aspect_ratio: "3:4",
resolution: "2k",
}),
});
console.log(await r.json());package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
body, _ := json.Marshal(map[string]any{
"model": "nano-banana-2.1",
"prompt": `A clean infographic poster titled "HOW COFFEE IS MADE" with four labeled steps`,
"aspect_ratio": "3:4",
"resolution": "2k",
})
req, _ := http.NewRequest("POST",
"https://reapi.ai/api/v1/images/generations", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
}Authentication
Every call needs a Bearer token. Generate keys at reapi.ai/settings/apikeys.
Authorization: Bearer YOUR_API_KEYEndpoint
POST /api/v1/images/generations
GET /api/v1/tasks/{id}Submission is async. The POST returns immediately with a task id; the task
endpoint returns the same envelope until completion. Polling does not consume
credits. A typical image is ready in about 35–45 seconds — poll every 3–5
seconds and allow a few minutes before giving up.
Request body
Mode is implicit: no image_urls / video_urls is text-to-image; references
turn it into editing, reference-guided generation, multi-image fusion or
video-to-image.
| Field | Type | Default | Notes |
|---|---|---|---|
model | string | — | nano-banana-2.1. Required. |
prompt | string | — | What to generate or how to edit the references, 1–262,144 chars. Google limits the whole input to 131,072 tokens, so a very long prompt can still be rejected upstream. Required. |
aspect_ratio | string | auto | auto or one of 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. auto (or leaving it out) lets the model pick the frame — set a ratio when you need a predictable size. |
resolution | string | 1k | 1k / 2k / 4k (case-insensitive). Every tier costs the same. |
image_urls | string[] | — | Up to 14 reference images (up to 10 objects and up to 4 characters). Public HTTP(S) URLs. |
video_urls | string[] | — | Up to 10 reference videos used as context (thumbnails, posters, recaps). Public HTTP(S) URLs; mp4, mov, webm and the other formats Google lists. Videos are sent inline, so the whole request — base64-encoded, about a third larger than the files — must stay under 20 MB: keep the videos under about 14 MB in total. YouTube links are not accepted. |
google_search | boolean | false | Ground the image in Google web search results — see Grounding. |
google_image_search | boolean | false | Ground the image in Google image search. Works on its own or together with google_search. |
thinking_level | string | medium | minimal / medium / high — see thinking_level. |
Checked before anything is submitted or charged:
promptis presentaspect_ratioisautoor one of the 14 ratios above (9:21and pixel sizes are rejected)resolutionis1k,2kor4k— there is no0.5kon this modelpromptis at most 262,144 charactersimage_urlshas at most 14 entries andvideo_urlsat most 10, all public HTTP(S) URLsthinking_levelisminimal,mediumorhigh- No
n,seed,temperatureortop_p— one image per request
google_search / google_image_search — boolean, default false
Grounding lets the model look things up before drawing — today's weather for a
forecast card, a real landmark, the current look of a product. Turn on
google_search for web results, google_image_search for reference images
from Google image search, or both. Google does not use real-world images of
people from web search for grounding.
When Google returns search suggestions for a grounded request, they come
back as an HTML snippet in output.search_suggestions. Google requires you to
display these search suggestions when you use image search grounding, and its
Gemini API terms set the full display rules for grounded results. Render the
snippet as-is (for example in a sandboxed iframe) next to the image. Not every
grounded result carries one.
thinking_level — string, default medium
How much the model reasons about the prompt before generating. minimal is
the fastest; high spends more reasoning on dense layouts, infographics and
long text. Leaving it out is the same as medium. The level does not change
the price.
Troubleshooting
| Failure | What it means | What to do |
|---|---|---|
| Synchronous 400 on submit | A field breaks a rule above (unknown ratio, 0.5k, more than 14 images or 10 videos, an over-long prompt, …) | The error names the field — fix and resubmit; nothing was charged |
Task fails citing content policy (80006) | The prompt, a reference image or the generated image was blocked by safety filtering | Fully refunded. Rephrase the prompt or replace the image |
Task fails with an invalid-input error (80007) | A reference URL could not be downloaded (404, not an image or video, too large), or the request with videos exceeds 20 MB once encoded | Fully refunded. Check that every URL is public and returns the file; shorten or compress the videos |
Task fails with a provider error (80001) | Upstream timed out or was unavailable | Fully refunded. Resubmit |
402 on submit | Not enough credits | Top up |
See the errors catalog for every code.
No data: URIs. reAPI rejects base64 inputs platform-wide — every URL
field must be a public HTTP(S) URL. Upload to your own object storage (S3, R2,
OSS, …) and pass the URL.
Response envelope
Submit and poll share the same shape — only status and output fill in over
time.
{
"id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e",
"model": "nano-banana-2.1",
"status": "completed",
"created_at": 1735000000,
"output": {
"image_urls": ["https://cdn.reapi.ai/media/tasks/.../0.jpg"],
"search_suggestions": "<style>…</style><div class=\"container\">…</div>"
},
"error": null
}Poll GET /api/v1/tasks/{id} (see the Tasks reference) until
status === "completed". Images are JPEG. search_suggestions appears only on
grounded results that include it. Generated URLs expire — mirror the files to
your own storage.
Pricing
Nano Banana 2.1 bills one flat price per image:
credits = ceil(per_image_price × 1000) 1 credit = $0.001The live per-image rate is on the model page. Failed tasks are always refunded in full.
1k, 2k and 4k cost the same, and so do reference images and videos,
grounding and every thinking level. That makes 2k or 4k the sensible choice whenever you
need the detail.
Tips
- Spell out the exact text you want in the image, in quotes
(
titled "HOW COFFEE IS MADE") — text rendering and infographic layout are the areas Google improved most in this version. - For multi-image fusion, say which reference is which in the prompt ("the mug from the first image on the beach from the second").
- Wide panoramas (
4:1,8:1) and tall strips (1:4,1:8) at2kand4k: Google fixed the tiling artifacts that Nano Banana 2 showed at these ratios. - Use
thinking_level: "high"for infographics, menus and dense layouts;minimalfor quick drafts.
Related
- Nano Banana 2 — the previous version
- Nano Banana Pro
- Nano Banana 2 Lite
- Tasks reference
- Errors catalog