Nano Banana Pro Serverless API

Nano Banana Pro generates high-fidelity, context-aware images with accurate multilingual text and multi-image support.

~60.29s
$0.150 - $0.250 per generation
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/nano-banana-pro"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "Create a multi-panel GTA-style comic page featuring one woman and one man as office coworkers working on a new product launch. Use bold outlines, dramatic GTA loading-screen shading, expressive faces, modern tech office backgrounds.\n\nPanel 1 — Narration:\nThe woman enters the office early, holding a laptop. She looks stressed but determined.\nText: ‘Launch day. Weeks of work… all coming down to this.’\n\nPanel 2 — Dialogue:\nMan appears behind her with a calm, confident smile.\nMan: ‘You’re here early. Ready for the big ship?’\nWoman: ‘Trying to be.’\n\nPanel 3 — Action:\nBoth sit at a desk with screens showing graphs, bugs, and a countdown timer.\nText: ‘One critical bug left… time running out.’\n\nPanel 4 — Dialogue:\nClose-up of the man pointing at the screen.\nMan: ‘Wait—I see it. We can fix this.’\nWoman: ‘Let’s do it.’\n\nPanel 5 — Action:\nBoth typing fast, dramatic GTA-style lighting, code streaming across screens.\nText: ‘Two minds. One mission.’\n\nPanel 6 — Victory:\nThe laptop shows PRODUCT SHIPPED — SUCCESS. Both cheer and laugh in relief.\nWoman: ‘We did it!’\nMan: ‘Told you we’d make it.’\n\nPanel 7 — Narration:\nFinal shot: team walking out of the office at night, city lights behind them.\nText: ‘In tech, wins aren’t solo. They’re shared.’\n\nArt style: GTA loading-screen style, bold color blocks, high contrast shadows, confident comic composition, cinematic frames.",
12    "image_urls": [
13        "https://segmind-inference-inputs.s3.amazonaws.com/ad93498e-3370-432b-8dd7-bc3f4aa1b39a-black-man-image.jpeg",
14        "https://segmind-inference-inputs.s3.amazonaws.com/8bdc63b0-79ed-4369-a4af-e7284f5bde33-image (86).png"
15    ],
16    "aspect_ratio": "9:16",
17    "output_format": "jpg",
18    "output_resolution": "4K",
19    "response_modalities": "TEXT_AND_IMAGE"
20}
21
22response = requests.post(url, headers=headers, json=data)
23
24if response.status_code == 200:
25    result = response.json()
26    print(json.dumps(result, indent=2))
27else:
28    print(f"Error: {response.status_code}")
29    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/nano-banana-pro

Parameters

promptrequired
string

Outline the scene with imaginative language.

aspect_ratiooptional
string

Choose image dimensions. Use '16:9' for widescreen or '1:1' for symmetrical art.

Default: "16:9"
Allowed values :
"1:1""2:3""3:2""4:3""3:4""4:5""5:4""16:9""9:16""21:9"
image_urlsoptional
string[]

Add a reference image or leave blank for original ideas.

output_formatoptional
string

Determines output format

Default: "jpg"
Allowed values :
"jpg""png"
output_resolutionoptional
string

Set the image detail level. Choose '4K' for high detail or '1K' for quicker results.

Default: "4K"
Allowed values :
"1K""2K""4K"
response_modalitiesoptional
string

Control output type. Use IMAGE for image-only output, TEXT_AND_IMAGE for both text and image.

Default: "TEXT_AND_IMAGE"
Allowed values :
"TEXT_AND_IMAGE""IMAGE"

Response Type

Returns: Image

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out