If you're an AI product developer looking to add high-quality image generation into your applications, Nano Banana 2 on WisGate offers an efficient and cost-effective solution. This article walks you through everything you need to get started with Nano Banana 2 on WisGate in under five minutes—from account setup and obtaining your API key, to no-code prompt testing in WisGate Studio, to full API integration with detailed examples and pricing insights.
Nano Banana 2 is accessible either through WisGate’s no-code AI Studio or via direct API calls using the Gemini-native endpoint. Thanks to WisGate’s competitive pricing at $0.058 per image—roughly 14.7% cheaper than Google's $0.068 per image—you get consistent image quality and generation times around 20 seconds from 0.5K up to 4K resolution. This guide ensures you’re ready to integrate Nano Banana 2 confidently whether you're starting with interactive prompt testing or deploying in production.
Before we dive in, why not open WisGate AI Studio in a new tab and try a few prompts yourself? It requires zero setup and gives you a feel for the model’s capabilities instantly.
Introduction
Nano Banana 2 is a versatile AI image generation model hosted on WisGate. Developers can access it either through a no-code Studio interface or via API for integration into custom workflows. WisGate offers a pricing advantage at $0.058 per image, compared to Google’s official rate of $0.068, without compromising on image quality or generation speed.
Images can be generated in resolutions from 0.5K (512px) up to 4K (4096px), with flexible aspect ratio controls including options for ultra-wide or portrait formats. The model can produce rich, creative content in about 20 seconds per image, suitable for production environments.
This article covers both entry points thoroughly, helping you go from account creation to your first image generation as quickly as possible.
Nano Banana 2 on WisGate — Quick Reference Card
Below is a compact technical summary to keep handy during development:
| Specification | Details |
|---|---|
| Model Name | Nano Banana 2 |
| Model ID | gemini-3.1-flash-image-preview |
| Context Window | 256K tokens |
| Pricing per Image | $0.058 (WisGate), $0.068 (Google official) |
| Generation Time | ~20 seconds for 0.5K to 4K outputs |
| Resolution Tiers | 0.5K = 512px, 1K = 1024px (default), 2K = 2048px, 4K=4096px |
| Aspect Ratio | Standard 1:1 plus ultra-wide and portrait extremes |
| Primary API Endpoint | https://wisgate.ai/v1beta/models/gemini-3.1-flash-image-preview:generateContent |
| Authentication Header | x-goog-api-key |
| No-code Studio URL | https://wisgate.ai/studio/image |
| API Key Portal | https://wisgate.ai/hall/tokens |
This summary gives quick access to the main specs and URLs you will use.
Account Setup — From Zero to API Key
To start using Nano Banana 2 on WisGate’s API, creating and configuring your account is straightforward:
- Visit https://wisgate.ai/hall/tokens to register or log in.
- After logging in, navigate to the API Key section and generate a new API key for your project.
- Copy the generated key and store it securely. Environment variables are recommended for security, for example:
export WISDOM_GATE_KEY="your_api_key_here"
- Keep your API key confidential. Avoid embedding it directly in client-side code or public repositories.
With your API key created, you’re ready to access the Nano Banana 2 model through WisGate endpoints. The next sections will walk you through two main entry points: the no-code AI Studio and the API.
Entry Point 1 — Nano Banana 2 on WisGate Studio Walkthrough
If you want to quickly explore Nano Banana 2’s image generation capabilities without writing code, the WisGate Studio is your best starting point.
- Open https://wisgate.ai/studio/image.
- Select the “Nano Banana 2” model or enter the model ID
gemini-3.1-flash-image-preview. - Enter your prompt describing the desired image. For example:
Da Vinci style anatomical sketch of a dissected Monarch butterfly. Detailed drawings of the head, wings, and legs on textured parchment with notes in English.
- Adjust optional settings such as resolution or aspect ratio.
- Click “Generate” to receive image outputs within roughly 20 seconds.
The Studio allows you to test and iterate on prompts effortlessly with no code. It provides immediate visualization of the model’s capabilities and helps develop prompt phrasing before jumping to API integration.
Entry Point 2 — AI Image API for Developers: Complete Integration Guide
For production applications, the API access to Nano Banana 2 on WisGate offers full control. Below is a detailed integration guide.
API Endpoint and Headers
Use the Gemini-native endpoint for full feature support:
https://wisgate.ai/v1beta/models/gemini-3.1-flash-image-preview:generateContent
Include the API key in the x-goog-api-key HTTP header.
Example request headers:
-H "x-goog-api-key: $WISDOM_GATE_KEY"
-H "Content-Type: application/json"
Sample cURL Request
Here is a minimal example generating a 2K image with text and image search grounding enabled:
curl -s -X POST \
"https://wisgate.ai/v1beta/models/gemini-3.1-flash-image-preview:generateContent" \
-H "x-goog-api-key: $WISDOM_GATE_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{
"parts": [{
"text": "Da Vinci style anatomical sketch of a dissected Monarch butterfly. Detailed drawings of the head, wings, and legs on textured parchment with notes in English."
}]
}],
"tools": [{"google_search": {}}],
"generationConfig": {
"responseModalities": ["TEXT", "IMAGE"],
"imageConfig": {
"aspectRatio": "1:1",
"imageSize": "2K"
}
}
}' | jq -r '.candidates[0].content.parts[] | select(.inlineData) | .inlineData.data' | head -1 | base64 --decode > butterfly.png
Parsing Image Response
The API returns a JSON response containing base64-encoded image data inside inlineData.data. The example above shows how to extract and decode the image using jq and base64 utilities.
Python Integration Example
import os
import requests
import base64
api_key = os.getenv("WISDOM_GATE_KEY")
url = "https://wisgate.ai/v1beta/models/gemini-3.1-flash-image-preview:generateContent"
headers = {
"x-goog-api-key": api_key,
"Content-Type": "application/json"
}
payload = {
"contents": [{"parts": [{"text": "A fantasy castle on a hill, sunset lighting."}]}],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {"aspectRatio": "16:9", "imageSize": "1K"}
}
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
base64_img = None
for part in data["candidates"][0]["content"]["parts"]:
if "inlineData" in part:
base64_img = part["inlineData"]["data"]
break
if base64_img:
with open("output.png", "wb") as f:
f.write(base64.b64decode(base64_img))
print("Image saved as output.png")
else:
print("No image returned")
Node.js Integration Example
const fetch = require('node-fetch');
const fs = require('fs');
const apiKey = process.env.WISDOM_GATE_KEY;
const url = 'https://wisgate.ai/v1beta/models/gemini-3.1-flash-image-preview:generateContent';
const body = {
contents: [{ parts: [{ text: 'A futuristic cityscape at night.' }] }],
generationConfig: { responseModalities: ['IMAGE'], imageConfig: { aspectRatio: '1:1', imageSize: '1K' } }
};
fetch(url, {
method: 'POST',
headers: { 'x-goog-api-key': apiKey, 'Content-Type': 'application/json' },
body: JSON.stringify(body)
})
.then(res => res.json())
.then(data => {
const parts = data.candidates[0].content.parts;
const imgData = parts.find(p => p.inlineData)?.inlineData.data;
if (imgData) {
const buffer = Buffer.from(imgData, 'base64');
fs.writeFileSync('output.png', buffer);
console.log('Image saved as output.png');
} else {
console.log('No image found in response');
}
});
This code structure supports flexible integration in common development environments.
OpenAI SDK Migration Path for AI Image API
If you already use OpenAI SDKs, migrating to WisGate’s Nano Banana 2 API involves a few key changes:
- Endpoint URL: Update to WisGate’s Gemini-native endpoint
https://wisgate.ai/v1beta/models/gemini-3.1-flash-image-preview:generateContent - Authentication Header: Replace
Authorization: Bearerwith WisGate’sx-goog-api-keyheader. - Request Structure: WisGate supports expanded parameters like
toolsor granulargenerationConfigoptions that may differ from OpenAI’s format. - Response Parsing: Extract base64 image data from nested
inlineData.dataarrays.
Note that full OpenAI SDK compatibility is still evolving; using direct HTTP requests with WisGate’s documented headers and payloads ensures reliable access.
Advanced Configuration — Resolution, Aspect Ratio & Image Search Grounding
Nano Banana 2 supports multiple configurable parameters to fine-tune image outputs:
Resolution Tiers
You can specify imageSize in the generationConfig.imageConfig field as:
0.5Kfor 512px images1K(default) for 1024px2Kfor 2048px4Kfor 4096px
Higher resolutions require more tokens (~1290 per image) but maintain stable ~20 second generation times.
Aspect Ratio
Supported aspect ratio strings include:
- Standard square:
1:1 - Landscape options like
16:9and ultra-wide extremes - Portrait options such as
9:16or taller ratios
Setting these adjusts the final image shape to suit your UI.
Image Search Grounding
To incorporate contextual image search data, add the following within the tools array:
"tools": [ { "google_search": {} } ]
This leads the model to ground imagery on live search results for richer generation.
Multi-Turn Editing & Image-to-Image Features
Nano Banana 2 supports multi-turn editing workflows with image generation:
- Every request must include the entire conversation or interaction history.
- The API is stateless; no server session is preserved.
For image-to-image generation, provide a base64 encoded reference image inside content parts along with new textual edits.
Example payload snippet:
{
"contents": [
{
"parts": [
{ "image": { "mimeType": "image/png", "data": "<base64-image-string>" } },
{ "text": "Apply watercolor style"
}
]
}
],
"generationConfig": {
"responseModalities": ["IMAGE"]
}
}
This lets you refine or restyle images based on existing inputs, useful for iterative creative workflows.
Pricing, Trial Credits & Billing for Nano Banana 2 on WisGate
WisGate charges $0.058 per image generated with Nano Banana 2, which is approximately 14.7% cheaper than Google's official rate at $0.068 per image.
Trial Credits
New users receive trial credits upon signup, enabling initial testing without payment. There is no permanent free tier.
Billing Options
WisGate supports both pay-as-you-go and subscription billing models.
For example, generating 1,000 images on WisGate costs about $58, whereas the official Google price would be $68 for identical usage.
You can find detailed pricing information at https://wisgate.ai/pricing.
Common Integration Errors & Fixes
Here are frequent issues developers face when integrating Nano Banana 2:
- Missing or incorrect auth header: Forgetting
x-goog-api-keyor usingAuthorizationinstead causes auth failures. Fix by including the correct header. - Wrong endpoint URL: Using OpenAI-compatible endpoint without adjusting headers leads to errors.
- Incorrect response modality: Not setting
responseModalitiesto includeIMAGEmeans no images are returned. - Improper multi-turn payload: Omitting conversation or history in multi-turn editing requests results in inconsistent output.
Carefully structure requests and review error messages for clear diagnosis.
Model Switching — Nano Banana 2 and Nano Banana Pro
Nano Banana 2's model ID is gemini-3.1-flash-image-preview. Its sibling, Nano Banana Pro, uses gemini-3-pro-image-preview.
Switching models requires changing only a single line in your API requests:
"model": "gemini-3-pro-image-preview"
Nano Banana Pro is higher performance but priced accordingly.
You can use the same API key for both models.
To explore Nano Banana Pro, visit https://wisgate.ai/models/gemini-3-pro-image-preview.
Integration Checklist
- Create WisGate account at https://wisgate.ai/hall/tokens.
- Generate and securely save your API key.
- Test model in no-code AI Studio at https://wisgate.ai/studio/image.
- Choose desired API endpoint:
- Gemini-native with
x-goog-api-keyheader (recommended). - OpenAI-compatible endpoint with
Authorizationheader (migration).
- Gemini-native with
- Set
responseModalitiesto includeIMAGE. - Specify resolution and aspect ratio as needed.
- For advanced features, include
toolsfor Image Search Grounding. - Handle multi-turn editing by including full chat history in requests.
- Parse base64 image data from API response carefully.
- Monitor your usage and billing via WisGate portal.
Conclusion — Nano Banana 2 on WisGate
Nano Banana 2 on WisGate provides AI developers with a flexible, cost-effective image generation option featuring clear no-code and API access, competitive pricing at $0.058 per image, and consistent performance. By following this guide, you can move from zero to production-ready integration within minutes.
Get started now by obtaining your API key at https://wisgate.ai/hall/tokens and try the sample code provided. For fast iteration, continue testing prompts in the no-code Studio at https://wisgate.ai/studio/image.
With WisGate, you can build faster and spend less, all through a unified API access point to advanced AI models like Nano Banana 2.