Skip to content

Google - Nano Banana 2 Lite ​

Endpoint ​

POST /images/generations

Full URL: https://modelfold.ai/v1/images/generations

Authentication: every request must include the Authorization: Bearer <API_KEY> header.

Send model parameters directly in the JSON body. Do not wrap them in input. This request waits for generation to finish and returns data[].url; supported media models also offer async jobs, polling and callbacks. Replace example media URLs with your own publicly accessible files. See API gateway for billing and errors.

Input parameters for the image generation task.

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
modelstringYesThe model name used for generation. This field is required. This endpoint must use the nano-banana-2-lite model. Default:"nano-banana-2-lite"。 Allowed values:nano-banana-2-lite。 Example:nano-banana-2-lite。
image_urlsarray&lt;string&gt;NoInput image URL array. Optional parameter. Set to an empty array or omit it for pure text-to-image generation. Supports up to 10 images.
- Please provide uploaded file URLs, not raw file content
- Accepted types: image/jpeg, image/png, image/webp
- Max size: 30.0MB Default:[]。 maxItems: 10.
promptstringYesPrompt required by the ModelFold gateway; at most 2000 characters. Text prompt used to generate the image. Required. Maximum length: 20000 characters. maxLength: 2000. Example:Generate a pig on the grass, cinematic light。
aspect_ratiostringYesRequired. Aspect ratio of the output image. Use "auto" to let the model decide. Allowed values:1:1 / 1:4 / 1:8 / 2:3 / 3:2 / 3:4 / 4:1 / 4:3 / 4:5 / 5:4 / 8:1 / 9:16 / 16:9 / 21:9 / auto。 Example:auto。

Request Example ​

bash
curl -X POST "https://modelfold.ai/v1/images/generations" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "nano-banana-2-lite",
  "prompt": "Generate a pig on the grass, cinematic light",
  "aspect_ratio": "auto",
  "image_urls": [
    "https://example.com/reference.png"
  ]
}'
json
{
  "model": "nano-banana-2-lite",
  "prompt": "Generate a pig on the grass, cinematic light",
  "aspect_ratio": "auto",
  "image_urls": [
    "https://example.com/reference.png"
  ]
}

Response ​

200 — Generation completed. usage contains actual billing details; result URLs are illustrative. ​

json
{
  "ok": true,
  "created": 1792134000,
  "data": [
    {
      "url": "https://modelfold.ai/uploads/outputs/result.png"
    }
  ],
  "usage": {}
}

ModelFold — one API for all the best AI models.