If you want to call the Nano Banana Pro API from your own code, the short version is this: "Nano Banana Pro" is Google's name for the gemini-3-pro-image model (its highest-fidelity image model, built for text rendering, brand-accurate compositions, and 4K output), and you reach it one of two ways. You can call Google's official Gemini API directly (billed per token), or call a unified API such as Modellix that fronts the same model behind one key (billed per image). Either way the code shape is identical: authenticate, submit an asynchronous task, then poll for the result or catch it on a webhook. This guide gives you the Pro-specific endpoint, parameters, a full submit-and-poll loop in code, the real per-image cost, and a straight answer on when Pro is worth it over the cheaper Nano Banana 2.
Every number below was pulled from the providers' own pages on July 25, 2026. Model IDs and prices move, so treat them as a dated snapshot and re-check the linked pages before you ship.
What the Nano Banana Pro API actually is (and when to use it over Nano Banana 2)
"Nano Banana Pro" is a nickname, not a separate product. On Google's own pricing page it is listed as "Gemini 3 Pro Image (Nano Banana Pro)" with the model ID gemini-3-pro-image. Google is the model maker here; the API you call is just how you reach it.
Google positions Pro as "the premium choice for the most complex visual tasks, offering the highest level of world knowledge, advanced localization, accurate brand consistency, and precision creative control." In practice, the Pro-specific strengths that matter for an integration are:
- Legible text rendering: Google describes it as "capable of generating legible, stylized text for infographics, menus, diagrams, and marketing assets." This is the one thing most image models still get wrong, and it's Pro's headline feature.
- High resolution: 1K, 2K, and 4K output.
- Complex compositions: up to 6 objects at high fidelity and up to 5 character images for consistency, plus a "thinking mode" that reasons through complex prompts and optional Google Search grounding.
One trap to know up front. The Pro model ID is gemini-3-pro-image (generation "3"), while the faster generalist Nano Banana 2 is gemini-3.1-flash-image (generation "3.1"). The higher-looking 3.1 is not the more capable model: Pro's image output is priced at $120 per 1M tokens versus $60 for Nano Banana 2, i.e. Pro is the higher tier despite the lower version number.
So when should you actually call Pro instead of Nano Banana 2?
| Nano Banana Pro | Nano Banana 2 | |
|---|---|---|
| Model ID | gemini-3-pro-image |
gemini-3.1-flash-image |
| Google's framing | "premium choice for the most complex visual tasks" | "generalist workhorse model for all tasks," speed-first |
| Output token price | $120 / 1M tokens | $60 / 1M tokens |
| Reach for it when | Legible in-image text, brand-accurate layouts, 4K finals, multi-reference consistency | High-speed, high-volume drafts, thumbnails, stylized iteration |
Use Pro when the output has to be right: an infographic with readable labels, a poster with correct brand type, a 4K hero image. Drop back to Nano Banana 2 when you're iterating fast or generating in bulk and don't need Pro's ceiling; for a full end-to-end walkthrough of the default model, see the how to use Nano Banana guide. And to be clear about the boundary: Pro is Google's model, and Modellix (used below) is one distribution layer that fronts it, not its maker.
Two ways to call the Nano Banana Pro API
There are two legitimate access paths, and picking the right one matters more than any single line of code.
Path A: Google's official Gemini API. You call Google directly. You authenticate with a Gemini API key, request the model gemini-3-pro-image through the Interactions API, and set a response_format (image type, aspect ratio, mime). Billing is token-based (see the cost section below).
Path B: a unified API (Modellix). Instead of integrating one provider at a time, you call one endpoint with one key and swap the model name in the path: Nano Banana Pro today, a different image or video model tomorrow. Modellix is one such Model-as-a-Service layer; it is a distribution layer, not the model's maker. Billing here is quoted per image, and every model uses the same asynchronous task interface.
| Official Gemini API | Unified API (Modellix) | |
|---|---|---|
| You integrate | One provider (Google) | One key across many image/video models |
| Billing | Per token | Per image |
| Interface | Gemini SDK / Interactions API | Uniform submit-and-poll async task |
| Best when | You only need Google's models and want the source of truth | You want to compare or mix providers without re-integrating |
Both routes call the same underlying Google model, so image quality is identical: which path is "better" depends only on whether you want a single provider or one key across many models, not on either platform being cheaper or exclusive. The worked example below uses the unified-API path because its request and response are fully documented and easy to reproduce; the same key-to-image logic applies to Google's official path.
The Nano Banana Pro endpoint and parameters
On the unified API, Nano Banana Pro lives at:
POST https://api.modellix.ai/api/v1/google/nano-banana-pro/async
There's a matching google/nano-banana-pro-edit endpoint for image edits: background replacement, style transforms, and detailed creative modifications on an existing image.
The request body is small. Only prompt is required:
| Parameter | Type | Required | Values |
|---|---|---|---|
prompt |
string | Yes | Your image description |
aspectRatio |
string | No | 10 options: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 |
imageSize |
string | No | 1K, 2K, 4K |
Note that Pro's imageSize starts at 1K; there is no 512px option the way there is on Nano Banana 2. That's consistent with Pro being the high-fidelity tier. On Google's official path the equivalent request sets model: "gemini-3-pro-image" and controls size and aspect ratio through the Interactions API's response_format.
The Modellix google/nano-banana-pro model page shows the endpoint's per-image price ($0.1265 to $0.2093/img) and the exact prompt / aspectRatio / imageSize parameters. Captured July 25, 2026.
Get and secure a Nano Banana Pro API key
There are two legitimate issuers, and the one you pick decides the header you send:
- Google AI Studio. Open the API Keys page and click Create API key; new keys are created as auth keys and stay retrievable in AI Studio. Send it as
x-goog-api-key. For the SDKs, installpip install google-genai(Python) ornpm install @google/genai(JavaScript), a step the image-generation page itself skips. - The Modellix console. Open API Key and create one. It is displayed only once, so store it the moment it appears. Send it as
Authorization: Bearer <key>.
A key in the wrong header returns a plain 401 that never mentions the header, so check that first. On "free" keys: Google lists no free API tier for gemini-3-pro-image, and the AI Studio playground's free quota is a browser preview, not an API allowance. Sites offering "free unlimited" Pro access or a "key generator" route you through someone else's platform and key, or harvest credentials.
Treat the key as a bearer credential. Keep it in an environment variable or secret manager (GEMINI_API_KEY or MODELLIX_API_KEY), keep .env files out of git, and use separate keys for dev, staging, and production. To rotate after any suspected leak, create a new key in the same console, deploy it, confirm one request succeeds, then delete the old key.
Call the Nano Banana Pro API: step by step
Here is the full loop, from zero to a saved 2K image.
Step 1: Get an API key. Create one in the Modellix console and store it immediately, since it is displayed only once (details in the section above). Google's Pro line-up on Modellix is listed on the Google provider page.
Step 2: Submit the task. Because generation is asynchronous, a successful POST does not return an image: it returns a task_id and a URL to fetch the result, with an initial status of pending.
Step 3: Poll for the result. Call GET /api/v1/tasks/{task_id} until the status is success, then read the image URL from data.result.resources[].url.
Step 4: Or skip polling with a webhook. Send an X-Webhook-URL header when you submit and Modellix POSTs the result to your public HTTPS endpoint when the task finishes (more on this below).
Step 5: Save the image. Generated results are only kept for 7 days, so download and persist the asset promptly.
Here is the whole loop in curl: submit, then poll:
# 1) Submit the Nano Banana Pro generation task
curl --request POST \
--url https://api.modellix.ai/api/v1/google/nano-banana-pro/async \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "A clean infographic titled \"How GPUs Work\", labeled arrows, brand-blue palette",
"aspectRatio": "4:3",
"imageSize": "2K"
}'
# Response returns a task_id and a get_result URL:
# {
# "code": 0,
# "message": "success",
# "data": {
# "status": "pending",
# "task_id": "task-abc123",
# "model_id": "nano-banana-pro",
# "get_result": {
# "method": "GET",
# "url": "https://api.modellix.ai/api/v1/tasks/task-abc123"
# }
# }
# }
# 2) Poll the task until status == "success"
curl --request GET \
--url https://api.modellix.ai/api/v1/tasks/task-abc123 \
--header 'Authorization: Bearer <YOUR_API_KEY>'
# On success, the image URL is in data.result.resources[].url
To move this into a real service, wrap the poll in exponential backoff (say 1s → 2s → 4s) or register a webhook and skip polling entirely. The prompt above deliberately asks for in-image text: the exact case Pro is built for. And because the model is just a string in the path, swapping nano-banana-pro for nano-banana-2 runs the identical code against the cheaper model; that path-swap is the whole point of a unified API. (Most SDKs, such as Python and JavaScript, wrap this same HTTP call, so you can keep the curl as your reference and reach for a client library when you productionize.)
Handle webhooks and errors like production
A hello-world call works; a production integration needs the two pieces most tutorials skip.
Webhooks. Include an X-Webhook-URL header on submit and Modellix POSTs to that URL when the task hits a terminal state: success, failed, or canceled. The endpoint must be a publicly reachable HTTPS URL (no localhost, no private IPs). Each callback carries X-Modellix-Event (prediction.task.succeeded / .failed / .canceled), plus X-Modellix-Task-ID, X-Modellix-Delivery-ID, and X-Modellix-Retry-Count headers, and a body identical to the poll response, including a billing.amount field. Return any 2xx (a plain 200 ok is enough) to acknowledge; the system only checks the status code. Two best practices worth building in from day one: dedupe on X-Modellix-Delivery-ID for idempotency, and persist the payload then return 2xx immediately, doing heavy work asynchronously so you don't time out.
Error codes. Every error is a unified JSON with a code matching the HTTP status. The important distinction is which ones you retry:
| Status | Meaning | Common cause | Retry? |
|---|---|---|---|
| 400 | Bad Request | Missing/invalid prompt or params |
No; fix the request |
| 401 | Unauthorized | Invalid, missing, or expired key | No; provide a valid key |
| 402 | Payment Required | Insufficient balance | No; top up first |
| 404 | Not Found | Unknown task/model/provider ID | No; check the ID |
| 429 | Too Many Requests | Rate or concurrency limit hit | Yes; back off; check X-RateLimit-Reset |
| 500 | Internal Server Error | Server-side error | Yes; retry up to 3× with backoff |
| 503 | Service Unavailable | Temporary outage / circuit breaker | Yes; retry with backoff |
The rule of thumb: 4xx (except 429) are your bug: fix the request. 429 and 5xx are transient: back off exponentially (1s → 2s → 4s) and retry. Google's official API follows the same shape; only the exact codes and headers differ.
Two more gateway details help when you branch on errors. The message field is formatted as "<Category>: <detail>" (for example "Invalid parameters: parameter 'prompt' is required"), so you can match on the category instead of parsing prose. And an uploaded input file above 16 MB returns 413 Payload Too Large, which is not retryable.
Response shape and limits
Google route. The image does not sit at the top level of the raw response. It arrives as a block inside steps, and text and image blocks can interleave when the model narrates its work:
{
"steps": [
{
"type": "model_output",
"content": [
{ "type": "text", "text": "Here is the diagram you asked for." },
{ "type": "image", "mime_type": "image/png", "data": "<base64>" }
]
}
]
}
The SDK's output_image property is a shortcut over that array; iterate steps and check each block's type if a response can hold a caption plus an image, or if you call the API over plain HTTP.
Gateway route. A finished task adds three fields worth storing: billing.amount (what the task actually cost), duration in milliseconds, and result_expires_at, the timestamp after which the asset URL stops working. A webhook handler should treat a canceled delivery as complete, not as a failure to retry.
| Limit | Nano Banana Pro |
|---|---|
| Default output size | 1K unless you set image_size / imageSize; 4K tops out at 4096×4096 |
| Reference images, Google route | Up to 6 objects, 5 characters, and 3 style references (Pro's split of the family's "up to 14") |
| Reference images, gateway edit route | image array of 1 to 14 URLs; sending a single string fails validation |
| Uploaded input files | 16 MB per file |
| Concurrency and rate limit | Scale with your single top-up: 2 concurrent tasks and 100 RPM under $10, up to 100 concurrent and 1,000 RPM at $1,000, per the entitlements table |
Pro's reference-image ceilings are the tightest of the three Gemini 3 image models, so a multi-reference pipeline ported from Nano Banana 2 usually needs resizing. On a 429, read X-RateLimit-Reset (alongside X-RateLimit-Limit and X-RateLimit-Remaining) instead of sleeping for a fixed interval; with multi-second 4K jobs, the concurrent-task cap usually binds long before the RPM cap.
How much does the Nano Banana Pro API cost?
Short version, because price deserves its own page. Pro has no free API tier for image output on either path: it's paid-only. On Google's official path it's billed per token and works out to roughly $0.134 per image at 1K/2K (more at 4K); on the unified path it's billed per image at a rate a little below Google's standard. There's a catch worth knowing before you pick a path on price alone: Google's Batch mode is cheaper than either standard rate, so no single path is universally cheapest.
Google's pricing page for Gemini 3 Pro Image (Nano Banana Pro): image output at $120/1M tokens ($0.134 per 1K/2K image, $0.24 at 4K) and no free tier. Captured July 25, 2026.
Ignore the "save 50% vs Google" headlines: they usually compare Google's Batch tier against its standard tier, or Nano Banana 2 against Pro: not like against like. Pick the path that fits your architecture, not a headline. The full ladder (every size, the batch math, and why the widely copied "$0.15/$0.30" figures are wrong) is in the dedicated Nano Banana Pro pricing breakdown.
FAQ
What is the Nano Banana Pro API model ID? It's gemini-3-pro-image: Google's ID for the model marketed as "Gemini 3 Pro Image (Nano Banana Pro)." Some older tutorials still use gemini-3-pro-image-preview, which Google shut down on June 25, 2026, so it now returns a 404; use the stable ID gemini-3-pro-image.
Is the Nano Banana Pro API free? No. Google's paid image models have no free API tier for Pro, and unified APIs are pay-as-you-go. Consumer Gemini apps may include some Pro generations on a subscription, but there's no free API allowance; see the Nano Banana Pro pricing page for the full breakdown.
How is the Nano Banana Pro API different from Nano Banana 2? Pro (gemini-3-pro-image) is the high-fidelity tier (legible text, brand-accurate layouts, 4K, multi-reference consistency) at $120/1M output tokens. Nano Banana 2 (gemini-3.1-flash-image) is the speed-first generalist at $60/1M. Reach for Pro when the output must be exact; use Nano Banana 2 for fast, high-volume work.
What is the difference between gemini-3-pro-image and google/nano-banana-pro? They name the same model. gemini-3-pro-image is Google's ID for the model field of a direct Gemini API call; google/nano-banana-pro is the gateway's provider/model route in the request path. Sending one where the other belongs is the most common cause of a 404 on a first integration.
How do I rotate a Nano Banana Pro API key? Create a new key in the console that issued the old one, deploy it, confirm one request succeeds, then delete the old key.
Do I need Google Cloud to use the Nano Banana Pro API? No. You need an API key: either an official Gemini API key from Google, or a key from a unified API like Modellix that fronts the same model.
Why doesn't the API return the image immediately? Image generation runs as an asynchronous task. The submit call returns a task_id; you then poll GET /tasks/{task_id} or receive a webhook when it's done.
What resolutions does the Nano Banana Pro API support? 1K, 2K, and 4K. Unlike Nano Banana 2, Pro has no 512px option; it starts at 1K, in keeping with its high-fidelity positioning.
Build with the latest AI models
Explore image, video and audio models through one API.
Start building



