Skip to main content

Nano Banana

nano-banana-1 and nano-banana-2 use PopGo's image-compatible endpoints for text-to-image generation and reference-image editing. They share the OpenAI-style request shape, but their exact capabilities remain model-specific.

Endpoints

POST https://api.popgo.site/v1/images/generations
POST https://api.popgo.site/v1/images/edits
Authorization: Bearer YOUR_API_KEY

Use JSON for generation and multipart form data for editing. Put reference files in image or repeated image[] fields.

Fields

FieldTypeDescription
modelstringRequired: nano-banana-1 or nano-banana-2
promptstringRequired generation or editing instruction
sizestringOptional WIDTHxHEIGHT or supported auto
qualitystringOptional; send only when listed for the model
nintegerOptional result count, default 1
response_formatstringOptional url or b64_json
image / image[]fileEditing references, one or multiple files

Text-to-image

curl https://api.popgo.site/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL",
"prompt": "A clean product catalog photo on a white background",
"size": "1024x1024",
"n": 1
}'

Reference-image editing

curl https://api.popgo.site/v1/images/edits \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "model=YOUR_MODEL" \
-F "image=@reference.png" \
-F "prompt=Keep the pose and clothing, and change the background to a bright studio"

For multiple references, repeat image[] and describe their order in the prompt. Do not copy another model's private fields into this request. If a client only has a URL, download it as a file before sending multipart data.

Results

data[].url contains a result URL when url is selected. data[].b64_json contains Base64 image bytes without a Data URL prefix when b64_json is selected. URLs can expire; Base64 is larger and should be stored according to the client's needs.

Limits and troubleshooting

The live model page is authoritative for resolution, aspect ratio, quality, count, and reference limits. For HTTP 400, start with the model ID, prompt, multipart field name, image type, and image count. n can increase both output count and usage.