Skip to content

Google - Nano Banana ​

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 generation task

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
modelstringYesThe model name to use for generation. Required field.
- Must be google/nano-banana for this endpoint Default:"google/nano-banana"。 Allowed values:google/nano-banana。 Example:google/nano-banana。
promptstringYesPrompt required by the ModelFold gateway; at most 2000 characters. The prompt for image generation (Max length: 20000 characters) maxLength: 2000. Example:A surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art。
output_formatstringNoOutput format for the images Default:"png"。 Allowed values:png / jpeg。 Example:png。
aspect_ratiostringNoAspect ratio of the output image. Set this field explicitly. Allowed values:1:1 / 9:16 / 16:9 / 3:4 / 4:3 / 3:2 / 2:3 / 5:4 / 4:5 / 21:9 / auto。 Example:1:1。
image_sizestringNoThe aspect ratio of the generated image (this parameter has been replaced by aspect_ratio; please use the latest aspect_ratio parameter). Default:"1:1"。 Allowed values:1:1 / 9:16 / 16:9 / 3:4 / 4:3 / 3:2 / 2:3 / 5:4 / 4:5 / 21:9 / auto。 Example:1:1。
nsfw_checkerbooleanNoDefaults to false. When false, no additional content filtering is applied and results are returned directly by the model.

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": "google/nano-banana",
  "prompt": "A surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art",
  "output_format": "png",
  "image_size": "1:1"
}'
json
{
  "model": "google/nano-banana",
  "prompt": "A surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art",
  "output_format": "png",
  "image_size": "1:1"
}

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.