Nano Banana 2 API
AI ImageNano Banana 2 is Google's fast Gemini 3.1 Flash image route on OmniaKey, covering text-to-image generation and reference-based edits at a low per-call price.
- Per successful call$0.019–$0.039
- OperationsText to image
- Image edit
- IDsgemini-3.1-flash-image-preview
- View tool pricing and billing rules
Your result will appear here once you run the model.
01
Where it fits
Nano Banana 2 is Google's fast Gemini 3.1 Flash image route on OmniaKey, covering text-to-image generation and reference-based edits at a low per-call price.
Reach for Nano Banana 2 when you want fast, inexpensive Gemini image generation inside a product or agent loop, and step up to Nano Banana Pro when an edit needs more reasoning.
Both IDs call the same product with the same capabilities and price. Use either one.
02
What it does
Text to image
gemini-3.1-flash-image
Turn a text prompt into a new image.
Image edit
gemini-3.1-flash-image
Change an existing image from a prompt and reference input.
03
Call it
Media models run asynchronously. Create a task, poll it until it finishes, then download the signed asset URL.
# 1. Create the job. 202 Accepted; the body carries the task id,
# the pre-charged price, and a poll_url. Reuse one Idempotency-Key
# across retries so a timeout never starts a second paid job.
curl --fail-with-body https://api.omniakey.com/v1/media/tasks \
-H "Authorization: Bearer $OMNIAKEY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: gemini-3.1-flash-image-001" \
-d '{
"model": "gemini-3.1-flash-image",
"type": "image",
"operation": "generate",
"input": {"prompt": "a paper boat on a quiet lake at sunset"},
"parameters": {"aspect_ratio": "1:1"}
}'
# 2. Poll GET /v1/media/tasks/{id} until status is
# succeeded | failed | canceled. Progress carries percent and stage.
curl --fail-with-body https://api.omniakey.com/v1/media/tasks/TASK_ID \
-H "Authorization: Bearer $OMNIAKEY_API_KEY"
# 3. Download assets[0].url before expires_at, or poll again for a
# fresh signed URL. Failed and canceled jobs are refunded.
curl -sS -o out.png "$(jq -r '.assets[0].url' result.json)"04
Pricing
Image jobs are billed per successful call, not per token. Failed or canceled jobs are refunded automatically.
$0.019–$0.039per callSave 72%
image_size
- 1K
- $0.019per call
- 2K
- $0.029per call
- 4K
- $0.039per call
More Google image models
Related articles
Nano Banana 2.1 Review: API Access & Pricing
Compare Nano Banana 2.1 with Nano Banana 2, then create supported Nano Banana image tasks through OmniaKey.
Read articleNano Banana 2 Lite vs Nano Banana 2
Choose by resolution, editing needs and cost per usable image.
Read articleGPT Image 2 vs Nano Banana 2
GPT Image 2 is the simpler OpenAI-shaped route; Nano Banana 2 is the more flexible reference-image route. Choose by the request contract and accepted-task cost.
Read articleNano Banana 2 vs Pro
Nano Banana 2 is the sensible high-volume starting point; Pro earns its premium when a complex visual needs more context, control, or iteration.
Read articleFrequently asked questions
How do I call Nano Banana 2 on OmniaKey?
POST to /v1/media/tasks with the model id, type "image", and operation "generate" or "edit". Reuse one Idempotency-Key across retries so a timeout never starts a second paid job.
What does Nano Banana 2 cost?
Nano Banana 2 bills $0.019–$0.039 per call. Creation pre-charges that amount from your prepaid balance, and failed or canceled jobs are refunded automatically.
Why does the API return a task id instead of the image?
Provider latency runs from seconds to about a minute, so OmniaKey normalizes every image route into one asynchronous lifecycle. Poll GET /v1/media/tasks/{id} until the status is succeeded, then read the signed asset URL.
