JUHE API Marketplace

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

10 min read
By Chloe Anderson

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:

SpecificationDetails
Model NameNano Banana 2
Model IDgemini-3.1-flash-image-preview
Context Window256K tokens
Pricing per Image$0.058 (WisGate), $0.068 (Google official)
Generation Time~20 seconds for 0.5K to 4K outputs
Resolution Tiers0.5K = 512px, 1K = 1024px (default), 2K = 2048px, 4K=4096px
Aspect RatioStandard 1:1 plus ultra-wide and portrait extremes
Primary API Endpointhttps://wisgate.ai/v1beta/models/gemini-3.1-flash-image-preview:generateContent
Authentication Headerx-goog-api-key
No-code Studio URLhttps://wisgate.ai/studio/image
API Key Portalhttps://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:

  1. Visit https://wisgate.ai/hall/tokens to register or log in.
  2. After logging in, navigate to the API Key section and generate a new API key for your project.
  3. Copy the generated key and store it securely. Environment variables are recommended for security, for example:
export WISDOM_GATE_KEY="your_api_key_here"
  1. 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.

  1. Open https://wisgate.ai/studio/image.
  2. Select the “Nano Banana 2” model or enter the model ID gemini-3.1-flash-image-preview.
  3. 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.
  1. Adjust optional settings such as resolution or aspect ratio.
  2. 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

python
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

fetch
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: Bearer with WisGate’s x-goog-api-key header.
  • Request Structure: WisGate supports expanded parameters like tools or granular generationConfig options that may differ from OpenAI’s format.
  • Response Parsing: Extract base64 image data from nested inlineData.data arrays.

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.5K for 512px images
  • 1K (default) for 1024px
  • 2K for 2048px
  • 4K for 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:9 and ultra-wide extremes
  • Portrait options such as 9:16 or 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:

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

json
{
  "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-key or using Authorization instead 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 responseModalities to include IMAGE means 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:

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

  1. Create WisGate account at https://wisgate.ai/hall/tokens.
  2. Generate and securely save your API key.
  3. Test model in no-code AI Studio at https://wisgate.ai/studio/image.
  4. Choose desired API endpoint:
    • Gemini-native with x-goog-api-key header (recommended).
    • OpenAI-compatible endpoint with Authorization header (migration).
  5. Set responseModalities to include IMAGE.
  6. Specify resolution and aspect ratio as needed.
  7. For advanced features, include tools for Image Search Grounding.
  8. Handle multi-turn editing by including full chat history in requests.
  9. Parse base64 image data from API response carefully.
  10. 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.

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