Blogs
News

How to Access nano banana Pro API ?

OpenQiao
Jan 5, 2026 • 5 min read

How to Access Nano Banana Pro API ?

Accessing the Nano Banana Pro API allows developers to harness Google’s most advanced model for text‑to‑image synthesis, multimodal editing, and dynamic composition control. Built on the Gemini 3 Pro Image foundation, Nano Banana Pro delivers professional‑grade visual output, supporting detailed prompts, factual grounding, and fine‑grained quality adjustments.
In this guide, you’ll learn how to get your API key, configure the SDK, execute generation requests, and test integrations efficiently.
OpenQiao stands out as the best official alternative to native APIs, offering unified access to leading AI models with built‑in reliability, intelligent routing, and automatic insurance coverage for output quality.

What is Nano Banana Pro and Why Use Its API

Nano Banana Pro stands for Google’s next‑generation multimodal AI based on Gemini 3 Pro Image technology. It’s capable of producing photorealistic results with precise text rendering inside images, refined lighting and depth, and the ability to blend multiple reference inputs.

Developers use it to:
● Generate high‑quality images up to 4K resolution
● Edit photos by combining text + image prompts seamlessly
● Ground results on live Google Search data for factual visuals
● Maintain color consistency and object coherence across multiple sources

Each generation includes an embedded SynthID watermark, guaranteeing output authenticity and provenance.

Step 1: Obtain Your API Key

To get started, you’ll need valid credentials. Follow these steps:

  1. Sign in to your Google AI Studio account.
  2. Click “Get API Key.” A unique key will be generated instantly. Store it securely — never expose it in code or commit it to public repositories.
  3. Set environment variables for safety:
Shell
export GOOGLE_API_KEY=your_api_key_here
  1. Alternatively, enable the API through Vertex AI by locating “Nano Banana Pro (Gemini 3 Pro Image)” in the Model Garden and creating your credentials.

Your API key authenticates every generation request you send to Nano Banana Pro endpoints.

Step 2: Call the Nano Banana Pro API

Once your key is ready, you can generate content directly from your terminal or preferred coding environment.

Here’s a sample curl request:

Shell
curl https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-image-preview:generateContent \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: $GOOGLE_API_KEY" \
  -d '{
    "contents": [{
      "role": "user",
      "parts": [{
        "text": "Generate a 4K photorealistic image of a yellow banana floating in space with Earth in the background and the text \"Nano Banana Pro.\""
      }]
    }],
    "generationConfig": {
      "responseModal": "IMAGE"
    }
  }'

The response returns Base64‑encoded image data, which you can decode or save as a .png file.

Use the Official Python SDK

Developers can simplify API communication using the official Python SDK integrated through OpenQiao:

Shell
pip install -U google-generativeai

Example setup:

Python
import google.generativeai as genai

genai.configure(api_key="YOUR_API_KEY")

model = genai.GenerativeModel('models/gemini-3-pro-image-preview')

response = model.generate_content(
    "Create an ultra-realistic city skyline at sunset with flying cars and glowing neon reflections, 4K resolution",
    generation_config=genai.types.GenerationConfig(
        response_mime_type="image/png"
    )
)

with open("output.png", "wb") as f:
    f.write(response.candidates[0].content.parts[0].inline_data.data)

The SDK automatically handles retries, streaming, and file encoding, ensuring efficiency when generating or editing visuals.

Editing, Blending, and Multi‑Image Prompts

Nano Banana Pro excels in image manipulation and style transfer. It supports up to 14 input images and multiple subjects while preserving coherence.

Example workflow:

Python
import PIL.Image
image = PIL.Image.open("reference.jpg")

response = model.generate_content(
    [image, "Edit this photo: change daytime to sunset, enhance reflection, retain facial features"]
)

Mix and match images and text instructions in a single prompt for complex compositions like collages, design mockups, and artistic variations.

Advanced Features and Parameters

Grounding with Search Data

Embed real‑time facts into your visual outputs by activating Google Search grounding:

JSON
"systemInstruction": {
  "parts": [{"text": "Use search grounding for factual accuracy"}]
}

Safety Settings

Adjust content controls for compliance:

Python
model = genai.GenerativeModel(
    'models/gemini-3-pro-image-preview',
    safety_settings=[
        {"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "BLOCK_NONE"}
    ]
)

Aspect Ratio and Quality

Manage visual composition precisely through custom parameters:

Python
generation_config=genai.types.GenerationConfig(
    candidate_count=1,
    temperature=0.7,
    extra_params={"aspect_ratio": "16:9", "quality": "highest"}
)

These settings give you full creative control over lighting, style, and resolution.

Pricing and Usage Best Practices

Nano Banana Pro is a premium tier model, so optimize to reduce compute overheads:

  • Cache frequently used prompts.
  • Use lower temperature values for consistent results.
  • Batch processing where possible (though image generation is non‑parallel).
  • Apply exponential backoff on 429 rate‑limit responses. OpenQiao’s built‑in cost monitoring automatically flags abnormal spending and suggests optimization options based on historical data.

Conclusion: Streamline Your Gemini 3 Image API Access with OpenQiao

You now know how to access and integrate the Nano Banana Pro API step by step — from initial authentication to advanced configuration and testing.
By deploying through OpenQiao, you gain a unified gateway to manage Gemini 3 Pro Image models along with other leading LLMs. The platform’s automatic compensation for low‑quality outputs, global CDN support, and token‑level billing accuracy enable developers to build high‑reliability AI applications without risk.
OpenQiao — The LLM Gateway Where You Pay for Results, Not Hallucinations.
Build boldly. Deploy securely. Create without limits.