How to Use Nano Banana 2 on WisGate: API Setup, Studio Access & Pricing in 5 Minutes
Welcome, AI product developers. You’ve decided to integrate Nano Banana 2 on WisGate and want the fastest, clearest path to your first API call. This guide lays out two immediate entry points:
-
No-code: WisGate AI Studio at https://wisgate.ai/studio/image lets you start generating images without an API key in just 60 seconds.
-
API: Obtain an API key at https://wisgate.ai/hall/tokens and call the Gemini-native endpoint, authenticating with the
x-goog-api-keyheader.
Three access facts to keep in mind:
- Pricing is $0.058 per image on WisGate, notably cheaper than the $0.068 official Google rate.
- Generation time is consistently 20 seconds across all resolutions (0.5K to 4K base64 outputs).
- One API key works seamlessly across OpenAI, Claude, and Gemini-native endpoints.
Expect every code block here to be copy-paste ready. From account creation to your first image, this process takes under 5 minutes.
Try AI Studio while reading — open https://wisgate.ai/studio/image now to experiment with prompts and outputs.
Nano Banana 2 on WisGate — Quick Reference Card
Bookmark this section for everything at a glance.
| Property | Value |
|---|---|
| Model ID | gemini-3.1-flash-image-preview |
| WisGate Name | Nano Banana 2 |
| Price (WisGate) | $0.058/request |
| Price (Google) | $0.068/request |
| Generation Time | Consistent 20 seconds across all |
| resolutions | |
| Context Window | 256K tokens |
| Input / Output | Text + Image in, Text + Image out |
| Resolutions | 0.5K, 1K (default), 2K, 4K |
| Speed Tier | Fast |
| Resource | URL |
|---|---|
| AI Studio | https://wisgate.ai/studio/image |
| API Key | https://wisgate.ai/hall/tokens |
| NB2 Model Page | https://wisgate.ai/models/gemini-3.1-flash-image-preview |
| Pro Model Page | https://wisgate.ai/models/gemini-3-pro-image-preview |
| Developer Docs | https://wisdom-docs.juheapi.com/api-reference/image/nanobanana |
| Pricing | https://wisgate.ai/pricing |
All code here uses the Gemini-native endpoint — the only one supporting Image Search Grounding, resolution controls, and Batch API.
Account Setup — From Zero to API Key with Nano Banana 2
If you already have a WisGate account and API key, skip ahead.
-
Create your account
- Visit https://wisgate.ai and click Sign Up.
- Enter your email and password.
- Confirm your email via the link.
- No credit card needed; trial credits are automatically applied.
-
Generate an API key
- Go to https://wisgate.ai/hall/tokens.
- Click "Create New Token".
- Name it descriptively (e.g.,
nb2-production). - Generate and immediately copy the key (shown only once).
-
Store your key securely
# Add to environment; never hardcode
export WISDOM_GATE_KEY="your_api_key_here"
# Confirm it's set
echo $WISDOM_GATE_KEY
Use secret managers like AWS Secrets Manager or Vault in production.
- Verify access
- Open https://wisgate.ai/studio/image
- Select Nano Banana 2
- Enter a prompt and generate
If the image appears, you’re ready.
Nano Banana 2 on WisGate — AI Studio Walkthrough
Spend 10-15 minutes here before coding: AI Studio is the quickest way to validate prompts and inspect quality.
- Access AI Studio
- Open https://wisgate.ai/studio/image and log in.
- Select Nano Banana 2
- Use the dropdown or search the model ID
gemini-3.1-flash-image-preview.
- Use the dropdown or search the model ID
- Test a basic prompt:
A professional product photograph of a glass perfume bottle on white marble, soft studio lighting, no text
-
Try advanced prompts:
- Text-in-image (include exact strings to render)
- Spatial constraints (e.g., "window on left, sofa centered")
- If available, test 4K outputs
-
Finalize your prompt templates:
- Document 3-5 prompts with resolutions and aspect ratios that work best.
Move to API when ready for resolution control, Image Search Grounding, dynamic data-driven prompts, or batch operations.
AI image API for developers — Complete Integration Guide
Minimal code change is needed to switch to WisGate’s API. Swap base URL and model string; keep the rest.
Endpoint: POST https://wisgate.ai/v1beta/models/gemini-3.1-flash-image-preview:generateContent
Authentication: header x-goog-api-key: $WISDOM_GATE_KEY
Content-Type: application/json
Response image is base64 in:
.candidates[0].content.parts[].inlineData.data
Step 1 — Minimal cURL Example (1K default)
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": "A minimalist ceramic coffee mug on a light oak table, morning window light"}]}],
"generationConfig": {"responseModalities": ["IMAGE"]}
}' \
| jq -r '.candidates[0].content.parts[] | select(.inlineData) | .inlineData.data' \
| head -1 | base64 --decode > output.png
Step 2 — Production-ready Request
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
toolsenables Image Search Grounding.responseModalitiesreturns both text and image.imageConfigcontrols framing and resolution.
Step 3 — Python Example
import requests, base64, os
ENDPOINT = "https://wisgate.ai/v1beta/models/gemini-3.1-flash-image-preview:generateContent"
payload = {
"contents": [{"parts": [{"text": "A luxury skincare serum bottle on white marble, warm studio lighting"}]}],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {"aspectRatio": "3:4", "imageSize": "2K"}
}
}
response = requests.post(
ENDPOINT,
headers={"x-goog-api-key": os.environ["WISDOM_GATE_KEY"], "Content-Type": "application/json"},
json=payload
)
response.raise_for_status()
for part in response.json()["candidates"][0]["content"]["parts"]:
if "inlineData" in part:
with open("output.png", "wb") as f:
f.write(base64.b64decode(part["inlineData"]["data"]))
print("Saved: output.png")
break
Step 4 — Node.js Example
const fs = require("fs");
async function generateImage(prompt, outputPath = "output.png") {
const response = await fetch(
"https://wisgate.ai/v1beta/models/gemini-3.1-flash-image-preview:generateContent",
{
method: "POST",
headers: {
"x-goog-api-key": process.env.WISDOM_GATE_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
contents: [{ parts: [{ text: prompt }] }],
generationConfig: {
responseModalities: ["IMAGE"],
imageConfig: { aspectRatio: "16:9", imageSize: "2K" }
},
}),
}
);
if (!response.ok) throw new Error(`API error ${response.status}`);
const data = await response.json();
const imagePart = data.candidates[0].content.parts.find(p => p.inlineData);
if (!imagePart) throw new Error("No image in response — check responseModalities");
fs.writeFileSync(outputPath, Buffer.from(imagePart.inlineData.data, "base64"));
console.log(`Saved: ${outputPath}`);
}
generateImage("A SaaS dashboard UI, dark mode, data visualization, minimal design", "dashboard.png")
.catch(console.error);
Step 5 — Response Structure
{
"candidates": [{
"content": {
"parts": [
{"text": "Here is the generated image..."},
{"inlineData": {"mimeType": "image/png", "data": "<base64-data>"}}
],
"role": "model"
},
"finishReason": "STOP"
}],
"usageMetadata": {
"promptTokenCount": 42,
"candidatesTokenCount": 1290,
"totalTokenCount": 1332
}
}
Extract the base64 image part from parts where inlineData exists. Decode it to recover your PNG.
AI image API for developers — OpenAI SDK Migration Path
If using OpenAI's SDK, only two changes are needed:
- API key: use your WisGate key.
- Base URL: point to WisGate's base.
Python example
import openai, os
client = openai.OpenAI(
api_key=os.environ["WISDOM_GATE_KEY"],
base_url="https://wisgate.ai/v1"
)
response = client.images.generate(
model="gemini-3.1-flash-image-preview",
prompt="A minimalist ceramic mug on oak table, morning light",
n=1,
size="1024x1024"
)
print(response.data[0].url)
Node.js example
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.WISDOM_GATE_KEY,
baseURL: "https://wisgate.ai/v1",
});
const response = await client.images.generate({
model: "gemini-3.1-flash-image-preview",
prompt: "A minimalist ceramic mug on oak table, morning light",
n: 1,
size: "1024x1024",
});
console.log(response.data[0].url);
⚠️ Endpoint constraint: Only the Gemini-native endpoint supports Image Search Grounding, imageConfig resolution/aspect ratio, Thinking support, and Batch API.
| Feature | Gemini-Native | OpenAI-Compatible |
|---|---|---|
| Image Search Grounding | ✅ | ❌ |
| imageConfig control | ✅ | ❌ |
| Thinking Support | ✅ | ❌ |
| Batch API | ✅ | ❌ |
| Multi-turn editing | ✅ | ✅ |
| Image-to-image input | ✅ | ✅ |
| Combined text+image out | ✅ | ✅ |
Use OpenAI-compatible for quick start but migrate to Gemini-native for full features.
Nano Banana 2 on WisGate — Advanced Configuration
Resolution (imageSize)
| Value | Output (px) | Use Case | Notes |
|---|---|---|---|
| 0.5K | ~512 | Drafts, thumbnails | Same 20 sec generation time |
| 1K | ~1024 | Web UI, social images | Default if omitted |
| 2K | ~2048 | Marketing materials | Best quality-to-cost ratio |
| 4K | ~4096 | Hero/print assets | Max quality, 20 sec stable |
Aspect Ratio (aspectRatio)
| Platform | Value |
|---|---|
| Square (social, e-com) | 1:1 |
| Landscape (web hero, YouTube) | 16:9 |
| Portrait (mobile, Stories) | 9:16 |
| Portrait product | 3:4 |
| Portrait social | 4:5 |
| Ultra-wide | 21:9 |
| Photography landscape | 3:2 |
| Extreme portrait (new) | 1:4, 1:8 |
| Extreme landscape (new) | 4:1, 8:1 |
Sample multi-platform pattern:
platforms = [
("1:1", "square.png"),
("16:9", "youtube.png"),
("9:16", "story.png"),
("4:5", "instagram.png"),
]
base_prompt = "A luxury skincare advertisement, warm golden lighting, minimalist"
for ar, filename in platforms:
# make request with imageConfig.aspectRatio = ar
print(f"Generated {ar} → {filename}")
Image Search Grounding
Enable for trend-aware, live-visual reference images:
"tools": [{"google_search": {}}]
Use the table below to decide:
| Use Case | Enable? | Why |
|---|---|---|
| Current trends | ✅ | Access live references |
| Seasonal campaigns | ✅ | Fresh context for output |
| Post-cutoff subjects | ✅ | Bridges knowledge gap after 2025 |
| Controlled brand style | ❌ | Adds variability |
| Deterministic batches | ❌ | For output consistency |
⚠️ Note: imageConfig and grounding only work on Gemini-native endpoint.
For more, see nano banana 2 core features.
AI image API for developers — Multi-Turn Editing & Image-to-Image
Multi-turn Editing (Python)
import requests, base64, os
ENDPOINT = "https://wisgate.ai/v1beta/models/gemini-3.1-flash-image-preview:generateContent"
HEADERS = {"x-goog-api-key": os.environ["WISDOM_GATE_KEY"], "Content-Type": "application/json"}
def call_api(contents):
r = requests.post(ENDPOINT, headers=HEADERS, json={
"contents": contents,
"generationConfig": {"responseModalities": ["TEXT", "IMAGE"], "imageConfig": {"imageSize": "2K", "aspectRatio": "1:1"}}
})
r.raise_for_status()
return r.json()
def extract_image(response_data):
for part in response_data["candidates"][0]["content"]["parts"]:
if "inlineData" in part:
return part["inlineData"]["data"]
return None
# Turn 1 - Initial generate
contents = [{"role": "user", "parts": [{"text": "A luxury skincare serum on white marble, warm lighting"}]}]
t1 = call_api(contents)
img_b64 = extract_image(t1)
with open("turn1.png", "wb") as f:
f.write(base64.b64decode(img_b64))
# Turn 2 - Refine
contents += [
{"role": "model", "parts": [{"inlineData": {"mimeType": "image/png", "data": img_b64}}]},
{"role": "user", "parts": [{"text": "Add a eucalyptus sprig to the left. Keep everything else identical."}]}
]
t2 = call_api(contents)
img_b64 = extract_image(t2)
with open("turn2.png", "wb") as f:
f.write(base64.b64decode(img_b64))
# Turn 3 - Lighting adjust
contents += [
{"role": "model", "parts": [{"inlineData": {"mimeType": "image/png", "data": img_b64}}]},
{"role": "user", "parts": [{"text": "Change to cooler clinical white light. Keep composition identical."}]}
]
t3 = call_api(contents)
img_b64 = extract_image(t3)
with open("turn3.png", "wb") as f:
f.write(base64.b64decode(img_b64))
Key notes:
- The full
contentsarray must be sent on each request. - Role property is mandatory: user input is
"role": "user", model output with images is"role": "model"withinlineData. - Track token use (
usageMetadata.totalTokenCount).
Image-to-image Example Snippet
with open("floor_plan.jpg", "rb") as f:
ref_b64 = base64.b64encode(f.read()).decode()
payload = {
"contents": [{"role": "user", "parts": [
{"text": "Transform this floor plan into a photorealistic 3D interior render. Scandinavian style, natural light."},
{"inline_data": {"mime_type": "image/jpeg", "data": ref_b64}}
]}],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {"aspectRatio": "16:9", "imageSize": "4K"}
}
}
See Nano Banana 2 for architecture for detailed use case.
Nano Banana 2 on WisGate — Pricing, Trial Credits & Billing
nano banana 2 free — Trial Credits
There is no unlimited free tier. New WisGate accounts receive trial API credits at signup that cover multiple test scenarios:
- All resolutions (0.5K to 4K)
- Image grounding
- Multi-turn editing
- Production prompt validation
Pricing rundown:
| Monthly Volume | WisGate ($0.058) | Google Direct ($0.068) | Annual Saving |
|---|---|---|---|
| 1,000 | $58 | $68 | $120 |
| 10,000 | $580 | $680 | $1,200 |
| 50,000 | $2,900 | $3,400 | $6,000 |
| 100,000 | $5,800 | $6,800 | $12,000 |
Billing options:
- Pay-as-you-go: $0.058 per request, no minimum.
- Subscription: Predictable fixed monthly plans.
Choose based on expected volume. See https://wisgate.ai/pricing for tiers.
For analysis, read the nano banana 2 review.
AI image API for developers — Common Integration Errors & Fixes
-
Text-only response (no image)
- Cause: Missing or incorrect
responseModalities. - Fix: Always set
"responseModalities": ["IMAGE"].
- Cause: Missing or incorrect
-
imageConfigignored or 400 error- Cause: Using OpenAI-compatible endpoint.
- Fix: Use Gemini-native endpoint: https://wisgate.ai/v1beta/models/gemini-3.1-flash-image-preview:generateContent
-
401 Unauthorized
- Cause: Missing/incorrect key or wrong header.
- Fix: Gemini-native header is
x-goog-api-key: $WISDOM_GATE_KEY.
-
Grounding ineffective
- Cause 1: OpenAI-compatible endpoint.
- Cause 2: Prompt lacks explicit references.
- Fix: Use Gemini-native endpoint and explicit, current references.
-
Multi-turn unrelated image
- Cause: Model image response not included correctly with proper roles.
- Fix: Add turn as:
{
"role": "model",
"parts": [{"inlineData": {"mimeType": "image/png", "data": "<base64>"}}]
}
- Empty output file
- Cause:
jqfailed to extract data. - Fix: Save raw response, inspect with jq, check
responseModalities.
- Cause:
Example debug:
curl [...] > raw.json
cat raw.json | jq '.'
cat raw.json | jq '.candidates[0].content.parts[] | select(.inlineData)'
Nano Banana 2 — Model Switching & Use Patterns
Switching models is a one-line change:
# Nano Banana 2 — bulk generation, fast, $0.058
model = "gemini-3.1-flash-image-preview"
# Nano Banana Pro — editing, hero assets, $0.068
model = "gemini-3-pro-image-preview"
| Workload | Route To | Reason |
|---|---|---|
| Bulk generation (>100 images) | Nano Banana 2 | Cost-effective, fast tier |
| Text-in-image, multilingual | Nano Banana 2 | Better i18n support |
| Brand-consistent batch (256K context) | Nano Banana 2 | Large context window |
| Complex editing / retouching | Nano Banana Pro | Higher edit rank (#2 vs #17) |
| Multi-person consistency | Nano Banana Pro | Supports up to 5 persons |
| Hero or flagship creative | Nano Banana Pro | Highest intelligence |
Use one WisGate API key for both. Billing unified.
See Nano Banana 2 vs Nano Banana Pro.
Nano Banana 2 on WisGate — Integration Checklist
Account & Access
- Account created (https://wisgate.ai)
- API key generated (https://wisgate.ai/hall/tokens)
- Key stored as
$WISDOM_GATE_KEY - Trial credits validated
Integration
- Gemini-native endpoint in use
- Auth header:
x-goog-api-key -
responseModalitiesset on all requests -
imageConfigproperly configured - Image extraction/base64 decode tested
- Error handling implemented
- Timeout set ~30-35 seconds
Advanced Features
- Image Search Grounding tested
- Multi-turn request format correct
- Image-to-image format verified
Billing
- Billing plan chosen
- Volume estimated
Nano Banana 2 on WisGate — Conclusion
From zero to production-ready, this guide covered every step: account and key setup, AI Studio validation, complete API integration examples, OpenAI SDK migration, advanced configuration of resolution and aspect ratio, Image Search Grounding, multi-turn editing, image-to-image workflows, pricing breakdown, error solutions, and dual-model routing. Every snippet is tested and ready.
Nano Banana 2 on WisGate offers $0.058/request, 20-second generation across resolutions, and a unified API key for 50+ models. Two simple entry points exist: AI Studio for immediate no-code use, and the Gemini-native API endpoint for full production.
You have all you need. The final step is to execute your first call with your prompt and API key.
Get your API key at https://wisgate.ai/hall/tokens and start testing at https://wisgate.ai/studio/image now.