JUHE API Marketplace

How to Use Nano Banana 2 on WisGate: API Setup, Studio Access & Pricing in 5 Minutes

13 min read
By Chloe Anderson

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:

  1. No-code: WisGate AI Studio at https://wisgate.ai/studio/image lets you start generating images without an API key in just 60 seconds.

  2. API: Obtain an API key at https://wisgate.ai/hall/tokens and call the Gemini-native endpoint, authenticating with the x-goog-api-key header.

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.

PropertyValue
Model IDgemini-3.1-flash-image-preview
WisGate NameNano Banana 2
Price (WisGate)$0.058/request
Price (Google)$0.068/request
Generation TimeConsistent 20 seconds across all
resolutions
Context Window256K tokens
Input / OutputText + Image in, Text + Image out
Resolutions0.5K, 1K (default), 2K, 4K
Speed TierFast

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.

  1. 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.
  2. 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).
  3. Store your key securely

curl
# 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.

  1. Verify access

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.

  1. Access AI Studio
  2. Select Nano Banana 2
    • Use the dropdown or search the model ID gemini-3.1-flash-image-preview.
  3. Test a basic prompt:
A professional product photograph of a glass perfume bottle on white marble, soft studio lighting, no text
  1. 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
  2. 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
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
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
  • tools enables Image Search Grounding.
  • responseModalities returns both text and image.
  • imageConfig controls framing and resolution.

Step 3 — Python Example

python
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

fetch
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

json
{
  "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

python
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

fetch
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.

FeatureGemini-NativeOpenAI-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)

ValueOutput (px)Use CaseNotes
0.5K~512Drafts, thumbnailsSame 20 sec generation time
1K~1024Web UI, social imagesDefault if omitted
2K~2048Marketing materialsBest quality-to-cost ratio
4K~4096Hero/print assetsMax quality, 20 sec stable

Aspect Ratio (aspectRatio)

PlatformValue
Square (social, e-com)1:1
Landscape (web hero, YouTube)16:9
Portrait (mobile, Stories)9:16
Portrait product3:4
Portrait social4:5
Ultra-wide21:9
Photography landscape3:2
Extreme portrait (new)1:4, 1:8
Extreme landscape (new)4:1, 8:1

Sample multi-platform pattern:

python
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:

json
"tools": [{"google_search": {}}]

Use the table below to decide:

Use CaseEnable?Why
Current trendsAccess live references
Seasonal campaignsFresh context for output
Post-cutoff subjectsBridges knowledge gap after 2025
Controlled brand styleAdds variability
Deterministic batchesFor 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)

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 contents array must be sent on each request.
  • Role property is mandatory: user input is "role": "user", model output with images is "role": "model" with inlineData.
  • Track token use (usageMetadata.totalTokenCount).

Image-to-image Example Snippet

python
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 VolumeWisGate ($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

  1. Text-only response (no image)

    • Cause: Missing or incorrect responseModalities.
    • Fix: Always set "responseModalities": ["IMAGE"].
  2. imageConfig ignored or 400 error

  3. 401 Unauthorized

    • Cause: Missing/incorrect key or wrong header.
    • Fix: Gemini-native header is x-goog-api-key: $WISDOM_GATE_KEY.
  4. Grounding ineffective

    • Cause 1: OpenAI-compatible endpoint.
    • Cause 2: Prompt lacks explicit references.
    • Fix: Use Gemini-native endpoint and explicit, current references.
  5. Multi-turn unrelated image

    • Cause: Model image response not included correctly with proper roles.
    • Fix: Add turn as:
json
{
  "role": "model",
  "parts": [{"inlineData": {"mimeType": "image/png", "data": "<base64>"}}]
}
  1. Empty output file
    • Cause: jq failed to extract data.
    • Fix: Save raw response, inspect with jq, check responseModalities.

Example debug:

curl
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:

python
# 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"
WorkloadRoute ToReason
Bulk generation (>100 images)Nano Banana 2Cost-effective, fast tier
Text-in-image, multilingualNano Banana 2Better i18n support
Brand-consistent batch (256K context)Nano Banana 2Large context window
Complex editing / retouchingNano Banana ProHigher edit rank (#2 vs #17)
Multi-person consistencyNano Banana ProSupports up to 5 persons
Hero or flagship creativeNano Banana ProHighest 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

Integration

  • Gemini-native endpoint in use
  • Auth header: x-goog-api-key
  • responseModalities set on all requests
  • imageConfig properly 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.

How to Use Nano Banana 2 on WisGate: API Setup, Studio Access & Pricing in 5 Minutes | JuheAPI