Nano Banana Pro troubleshooting should start with one current check: are you actually calling gemini-3-pro-image through the Gemini API surface your code was written for? A large share of failures that look like rate limits, blank images, unsupported parameters, or model-not-found errors come from old examples that still use gemini-3-pro-image-preview, the older google.generativeai package, or generate_content image snippets copied from pre-Interactions API tutorials.
As of July 8, 2026, Google's Gemini 3 Pro Image model page lists gemini-3-pro-image as the stable Nano Banana Pro model code. The Gemini image generation docs also say the Interactions API is generally available and recommended for access to the latest image features and models. Use that as your baseline before debugging prompts, quotas, or providers.
Quick Diagnosis Table
Use this table to decide what to inspect first. It avoids fixed quotas and old model strings because active limits vary by project, model, tier, account state, and time.
| Symptom | Most likely area | First check |
|---|---|---|
429 RESOURCE_EXHAUSTED | Rate, token, daily, or spend-based limit | Check the active model limits in AI Studio, slow down, reduce expensive requests, then retry |
403 PERMISSION_DENIED | API key, permissions, billing, or wrong auth surface | Verify the key/project, billing state, and whether you are mixing AI Studio keys with Vertex auth |
| "API key was reported as leaked" | Blocked exposed key | Create a new key in Google AI Studio and rotate secrets |
400 Bad Request | Bad request shape, stale parameter, wrong endpoint | Replace old generate_content image code with the current Interactions API shape |
| Model not found | Wrong model ID or unsupported surface | Use gemini-3-pro-image for Nano Banana Pro and confirm the model is available for your account |
| Empty output or no image part | Response parsing, safety block, or overly complex request | Inspect the response, simplify the request, and request only image output when needed |
Timeout or 503 UNAVAILABLE | Long-running generation or transient service issue | Retry with backoff, lower output size for diagnosis, or move non-urgent work to batch |
| Safety block | Prompt or generated image violated a safety layer | Reframe the task safely; do not build a bypass path |
Step 1: Fix Model ID And API Shape
Start here even if the error message looks unrelated. Old image-generation examples can fail in several confusing ways:
gemini-3-pro-image-previewmay appear in older posts, wrappers, and provider examples. Treat it as stale unless a specific platform still documents it for that exact surface.google.generativeaiexamples usinggenai.GenerativeModel(...).generate_content(...)are not the best default for current Nano Banana Pro image work.responseModalities,imageConfig, and similar older parameter names can produce malformed-request errors when copied into newer SDK patterns.
Use the Interactions API shape for new Gemini image troubleshooting:
hljs pythonfrom google import genai
import base64
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3-pro-image",
input=[
{
"type": "text",
"text": "Create a clean 2K product photo of a ceramic mug on a walnut desk.",
}
],
response_format={
"type": "image",
"mime_type": "image/png",
"aspect_ratio": "1:1",
"image_size": "2K",
},
)
if not interaction.output_image:
raise RuntimeError("No image returned. Inspect output_text and safety/error metadata.")
with open("nano-banana-pro-test.png", "wb") as f:
f.write(base64.b64decode(interaction.output_image.data))
This minimal test separates API health from prompt ambition. If this fails, do not debug your full production prompt yet. Fix the key, model, SDK, endpoint, or project first. For a deeper setup walkthrough, use the Nano Banana Pro API integration guide.
Step 2: Handle 429 Without Guessing The Quota
Google's rate-limit page describes Gemini API limits across several dimensions, including RPM, TPM, RPD, image-specific limits for image models, and spend-based rate limits. It also states that limits are applied per project, not per API key, and that active limits should be viewed in AI Studio. That means rotating API keys inside the same project will not create fresh capacity.
For 429 RESOURCE_EXHAUSTED, use this order:
- Check the active limits for the exact project and model in AI Studio.
- Confirm whether the failing workload is request-heavy, token-heavy, image-heavy, or spend-heavy.
- Add backoff and jitter instead of retrying immediately.
- Reduce expensive request shape for diagnosis: smaller image size, fewer references, simpler prompt, or fewer concurrent requests.
- Move non-urgent volume to Batch API if delayed completion is acceptable.
- Request a rate-limit increase only after normal usage consistently hits the limit.
Use a retry wrapper like this:
hljs pythonfrom google import genai
import base64
import random
import time
client = genai.Client()
def generate_image_with_backoff(prompt, attempts=5):
for attempt in range(attempts):
try:
return client.interactions.create(
model="gemini-3-pro-image",
input=prompt,
response_format={
"type": "image",
"mime_type": "image/png",
"aspect_ratio": "1:1",
"image_size": "1K",
},
)
except Exception as exc:
message = str(exc)
if "429" not in message and "RESOURCE_EXHAUSTED" not in message:
raise
delay = min(60, (2 ** attempt) + random.random())
time.sleep(delay)
raise RuntimeError("Gemini API still returned 429 after retries.")
interaction = generate_image_with_backoff("A simple studio product photo of a desk lamp.")
with open("retry-test.png", "wb") as f:
f.write(base64.b64decode(interaction.output_image.data))
If you need a rate-limit-specific branch, use the Gemini image 429 troubleshooting guide or the broader Gemini API rate limits guide. Keep this hub focused on triage.
Step 3: Separate Auth Errors From Model Errors
Authentication problems are often misread as model availability problems. A 403 can mean the key lacks the required permissions, the wrong project is being used, billing is not set up for the expected route, or your code is mixing AI Studio and Vertex authentication assumptions.
Use this split:
| Surface | Credential pattern | Common mistake |
|---|---|---|
| Gemini API through AI Studio | API key from the selected AI Studio project | Key belongs to a different project or has been rotated |
| Vertex AI | Google Cloud service account / OAuth flow | Trying to use an AI Studio key against Vertex-style endpoints |
| Gateway or aggregator | Provider-specific key and base URL | Assuming the gateway supports every Gemini parameter |
If the message says Your API key was reported as leaked. Please use another API key., stop retrying. Google says known leaked keys can be blocked, and the action is to generate new keys in Google AI Studio and review key-management practices. Do not keep a leaked key in production just because a local test still works somewhere.
Step 4: Fix 400 And Stale Parameter Errors
A 400 error is usually your request shape, not the model's creativity. Look for these mistakes:
- Old model ID:
gemini-3-pro-image-preview - Old SDK style:
google.generativeaiwith image-generation code copied from an older guide - Old parameters:
responseModalities,imageConfig, lowercase1k/2k/4k, or mixed REST and SDK shapes - Wrong output parsing: assuming every response has an image without checking
output_image - Unsupported input combination for the selected model or surface
For current Nano Banana Pro calls, specify image output through response_format. Use uppercase 1K, 2K, or 4K for image size where the docs require it. If you need both text and image output, request both explicitly and parse both. If you only need the final image, request image output and validate that interaction.output_image exists before writing files.
Step 5: Treat Safety Blocks As Product Constraints
Do not build a "bypass the filter" workflow. Safety blocks are not just an engineering nuisance; they are part of the platform contract. If a request involves real people, minors, private images, sexualized edits, impersonation, harassment, or an attempt to evade provider safety controls, the correct fix is to stop or redesign the task.
For legitimate commercial or educational image work that gets blocked unexpectedly, improve clarity rather than weakening safeguards:
- State the lawful context: "fashion catalog product photo", "medical education diagram", or "retail listing image" when that is true.
- Describe clothing, pose, age, and setting precisely if people are involved.
- Remove ambiguous wording that could imply nudity, coercion, private imagery, or real-person sexualization.
- Generate safer base assets first, then edit in controlled steps.
- Log the prompt, model, response metadata, and final decision so reviewers can see why the request was allowed or rejected.
For deeper policy-specific handling, use the Nano Banana Pro policy-blocked error guide.
Step 6: Recover From Empty Outputs And Timeouts
Empty output is not always a failed generation. Sometimes the response contains text, safety metadata, or an error object while your code only looks for an image part. First, print the response shape in a safe staging environment and check whether output_image exists.
If the response is valid but no image is returned, simplify the request:
- Remove reference images and test text-only generation.
- Drop to
1Koutput for diagnosis. - Reduce the number of subjects and text elements.
- Remove Search grounding until the base prompt works.
- Add one requirement back at a time.
Timeouts need a similar reduction path. 4K, many reference images, grounded factual diagrams, and complex typography all increase processing cost and latency. If the task is not interactive, batch processing is often cleaner than forcing a long synchronous request. Google's image generation docs state that image-generation capabilities can be run as batch jobs, with higher rate limits in exchange for turnaround up to 24 hours.
Step 7: Decide Whether A Gateway Is Actually Helping
Gateways can help with payment, routing, observability, or regional connectivity, but they can also hide the real cause of a failure. Do not treat any gateway as proof that Nano Banana Pro itself is down or that official quotas do not matter.
Before routing production traffic through a third-party provider, verify:
| Check | What to confirm |
|---|---|
| Model truth | The backend is actually gemini-3-pro-image, not a substituted model |
| Parameter support | response_format, image size, references, grounding, batch, and error metadata survive the wrapper |
| Billing evidence | Failed-call billing, retry behavior, and per-request logs match your expectations |
| Latency | Measure your own workload by region and output size |
| Data handling | Prompts, uploads, and generated images follow your privacy and retention requirements |
| Support owner | You know who handles incidents: the gateway, Google, or your own team |
If cost routing is the real question, use the separate Nano Banana Pro API cost route guide. Do not overload a troubleshooting page with unverified discount claims.
Prevention Checklist
Before shipping Nano Banana Pro to users, run this checklist:
- Pin the current SDK and document the SDK version used in production.
- Use
gemini-3-pro-imageunless a specific platform documents another model ID. - Keep a minimal health-check prompt separate from production prompts.
- Log model ID, endpoint, image size, reference count, status code, and retry count.
- Watch active rate limits in AI Studio instead of copying static quota numbers.
- Add exponential backoff with jitter for 429, 5xx, and transient network failures.
- Set budget alerts and spend controls for projects that can generate images at scale.
- Use batch for large non-interactive jobs.
- Rotate any exposed key immediately.
- Review safety-blocked prompts instead of automatically weakening policy controls.
FAQ
What is the current Nano Banana Pro model ID?
Use gemini-3-pro-image for current Gemini API planning. Google's Gemini 3 Pro Image model page lists it as the stable model code for Nano Banana Pro.
Is gemini-3-pro-image-preview still correct?
Treat it as stale for new code. It may still appear in old examples, third-party wrappers, or batch-limit tables, but new troubleshooting should start from the stable model ID and current docs.
Why did I get 429 if I waited 60 seconds?
The failing limit may not be RPM. Google evaluates usage across multiple dimensions, including requests, tokens, daily quotas, image-specific limits, and spend-based limits. Check the active limits for the model and project in AI Studio.
Can I fix a leaked API key?
No. If Google reports that a key was leaked, create a new key, update your environment variables or secret manager, remove the exposed key, inspect usage, and disable the compromised key.
Should I lower safety settings to fix IMAGE_SAFETY?
Do not treat safety as a toggle to bypass. For legitimate work, make the prompt clearer and safer. For real-person, private, sexualized, minor, or evasive requests, stop or redesign the workflow.
What should I do before contacting support?
Capture the model ID, SDK version, endpoint, project ID, timestamp, request ID if available, image size, reference count, status code, sanitized prompt category, and the exact error string. That evidence makes support and internal incident review faster.
Sources used for the July 8, 2026 refresh: Gemini 3 Pro Image model page, Gemini image generation docs, Gemini API rate limits, Gemini API troubleshooting, and Gemini API pricing.



