Skip to Content
Image ModelsNano Banana 2

Nano Banana 2

Overview

Nano Banana 2 is an upgraded text-to-image model offering higher resolution options.

Test API KEY: key_00000000000000000000000000000000

Endpoints

1. Create Task

Request

POST https://api.pixwith.ai/api/task/create

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Api-Key{API_KEY}Yes

Request Parameters

ParameterTypeRequiredDescription
promptstringYesThe input prompt (e.g., “a futuristic city”)
image_urlsarrayConditional[“https://cdn.pixwith.ai/xxx.jpg ”]. Provide 1-4 images if doing image-to-image.
model_idstringYes0-23
optionsobjectYesConfiguration options for the task
options.prompt_optimizationbooleanYesIf true, all prompt words will be automatically translated into English.
options.resolutionstringYesOutput resolution. Valid values: '1K', '2K', '4K'. Default: '1K'.
options.aspect_ratiostringYesAspect ratio of the output. Valid values: '0' (Default), '16:9', '9:16', '3:4', '4:3'.

Example Request

{ "prompt": "a futuristic city", "model_id": "0-23", "options": { "prompt_optimization": true, "resolution": "4K", "aspect_ratio": "16:9" } }

Example Request (Image to Image)

{ "prompt": "make it anime style", "image_urls": ["https://cdn.pixwith.ai/example.jpg"], "model_id": "0-23", "options": { "prompt_optimization": true, "resolution": "4K", "aspect_ratio": "16:9" } }

Response Parameters

ParameterTypeDescription
codeint1=success, 0=error
messagestringSuccess and failure messages
dataobject
data.task_idstring
data.estimated_timeintEstimated time in seconds

Response

{ "code": 1, "message": "success", "data": { "task_id": "d425ab4dc256f0ebaa84862b9cea8a3d", "estimated_time": 40 } }
Last updated on