Netwrck logo Netwrck
Netwrck > Tools > API Documentation > Nano Banana 2

Nano Banana 2 Text to Image API

Generate photorealistic and creative images from text prompts using Nano Banana 2 (Google Gemini 3.1 Flash Image model). Supports multiple resolutions up to 4K, flexible aspect ratios, and optional web search for current context.

Quick Start

Generate your first image in under a minute

Get Your API Key

Sign in to your account to get your API key and see it automatically filled in all code examples.

Don't have an account? Sign up for free

import requests

response = requests.post(
    "https://netwrck.com/api/nano-banana",
    json={
        "api_key": "YOUR_API_KEY",
        "prompt": "An action shot of a black lab swimming in an inground pool",
        "aspect_ratio": "16:9",
        "resolution": "1K"
    }
)

result = response.json()
print(f"Image generated: {result['image_url']}")
print(f"Cost: ${result['cost']}")
fetch('https://netwrck.com/api/nano-banana', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    prompt: 'An action shot of a black lab swimming in an inground pool',
    aspect_ratio: '16:9',
    resolution: '1K'
  })
})
.then(res => res.json())
.then(result => {
  console.log('Image generated:', result.image_url);
  console.log('Cost: $' + result.cost);
})
.catch(error => console.error('Error:', error));
curl -X POST https://netwrck.com/api/nano-banana \
  -H 'Content-Type: application/json' \
  -d '{
    "api_key": "YOUR_API_KEY",
    "prompt": "An action shot of a black lab swimming in an inground pool",
    "aspect_ratio": "16:9",
    "resolution": "1K"
  }'

Interactive API Tester

Status: idle
{}
Responses appear here after you send a request.

Pricing & Credits

0.5K

7 credits

$0.07 per image

1K (default)

9 credits

$0.09 per image

2K

14 credits

$0.14 per image

4K

18 credits

$0.18 per image

Web Search: +2 credits per request when enable_web_search: true. Only successful generations are charged.

API Reference

POST /api/nano-banana

Generate images from text using Gemini 3.1 Flash Image model

Request Format

Send a POST request with a JSON body containing these parameters:

ParameterTypeRequiredDescription
api_key string Required Your API key for authentication.
prompt string Required Text description of the image to generate. Be detailed for best results.
aspect_ratio string Optional Image aspect ratio. Default: "auto" (model decides based on prompt).
Options: auto, 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16
resolution string Optional Output resolution. Default: "1K".
Options: 0.5K (7cr), 1K (9cr), 2K (14cr), 4K (18cr)
num_images integer Optional Number of images to generate. Default: 1. Credits multiply per image.
output_format string Optional Output format. Default: "png". Options: jpeg, png, webp
safety_tolerance string Optional Content moderation level. Default: "4". Range: 1 (strictest) to 6 (least strict).
seed integer Optional Random seed for reproducible results.
enable_web_search boolean Optional Allow the model to use web search for latest information. Adds +2 credits. Default: false.

Response Examples

Success Response (200 OK)

{
  "success": true,
  "image_url": "https://netwrckstatic.netwrck.com/static/uploads/ai/nano-banana-example.png",
  "images": ["https://netwrckstatic.netwrck.com/static/uploads/ai/nano-banana-example.png"],
  "prompt_used": "An action shot of a black lab swimming in an inground pool",
  "resolution_used": "1K",
  "aspect_ratio": "auto",
  "cost": "0.0900",
  "credits_charged": 9
}

Error Responses

401 Unauthorized

{
  "error": "Invalid API key",
  "status": 401
}

402 Payment Required

{
  "error": "Insufficient credits",
  "status": 402
}

Pro Tips

Prompt Writing

  • Be specific about subjects, setting, and lighting
  • Include camera angle and composition details
  • Mention style: "photorealistic", "cinematic", "illustration"
  • Add mood descriptors for atmosphere

Best Practices

  • Use auto aspect ratio and let model decide
  • Start with 1K resolution, upgrade for final renders
  • Enable web search for prompts about current events
  • Save seeds for consistent character or style reproduction

Example Prompts

"A black lab swimming underwater in a suburban pool, split-level shot at the waterline, dog holding a tennis ball, paws visible underwater, photorealistic, golden afternoon light"

"Minimalist product shot of a glass perfume bottle on white marble, macro lens, soft shadows, commercial photography style"

"Aerial view of a misty mountain valley at sunrise, pine forests, winding river, cinematic color grading, 4K quality"

Welcome Back to Netwrck



Don't have an account? Sign up here

Join Netwrck - AI Art & Chat

Create AI art, search the web, generate videos and edit photos. Get started with your free account today!



Already have an account? Login here

Netwrck Unlimited

Voice Chat - Character Creation - Art Generation

30 day Money Back Guarantee.


Art Generator Settings


Resolution
Aesthetic Elf Styles
Anime Anime
Photographic Photographic
Digital Art Digital Art
Comic Book Comic Book
Fantasy Art Fantasy Art
Neon Punk Neon Punk
Knight Knight
Ethereal Ethereal
Low Poly Low Poly
Stunning Stunning
Line Art Line Art
Cinematic Cinematic
Wanderer Wanderer
Beggar Beggar
Seductive Seductive
Warrior Warrior
Steampunk Steampunk
Japanese Japanese
Western Western
Handsome Handsome
Pop art Pop art
Abstract Abstract
Impressionist Impressionist
Fauvist Fauvist
Beauty grace Beauty grace
Evil Evil
God God
Demon Demon
Masculine Masculine
Feminine Feminine
Majestic Majestic
Mage Mage
Princess Princess
King King
Sweet Sweet
Fantasy Fantasy

AI Generated Images


Community Images


New AI

person
This is what your AI will say when someone first chats with them
Help others understand what your AI character is about

AI Settings

Audio Settings
1.5x

Art Generation

When enabled, AI can automatically generate art based on conversations

Prepended to art prompts when Make Art runs.

High Resolution

LTX 2.3 Image to Video

Selected image
Pick any generated image and turn it into a video.
$0.29 · 29 credits
Your latest request will appear here.

Saved Requests

Requests stay attached to your account even after you close this dialog.
No video requests yet.

No AI characters found.

Help Everyone Know You

person

Share Image

Consider our affiliate program to earn!

Copy

Reddit

X

Facebook

LinkedIn

NETW Coin is live!

AI should be owned by everyone.
So we are building a new AI economy together.
Thank you for being on this journey with us!
Read More

Netwrck Android App

Our Android App Is Available Now - Please Check it out!

Add Netwrck Credits

Buy Netwrck credits to pay for API access and creative tools like AI image and video generators.

Current Balance: $0.00
Custom:

AI Characters in room

Search Characters