Skip to content

Google - Nano Banana Pro ​

This page is generated from the upstream official OpenAPI documentation. Endpoints, parameters and examples match the official docs; brand and API domain are replaced with ModelFold.

Endpoint ​

POST /jobs/createTask

Full URL: https://ai.modelfold.online/v1/jobs/createTask

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

Image generation using Google's Pro Image to Image model

Query Task Status ​

After submitting a task, use the unified query endpoint to check progress and retrieve results:

  • Get Task Details — Learn how to query task status and retrieve generation results

TIP

For production use, we recommend using the callBackUrl parameter to receive automatic notifications when generation completes, rather than polling the status endpoint.

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
modelstringYesThe model name to use for generation. Required field.
- Must be nano-banana-pro for this endpoint Default:"nano-banana-pro"。 Allowed values:nano-banana-pro。 示例:nano-banana-pro。
callBackUrlstringNoThe URL to receive generation task completion updates. Optional but recommended for production use.
- System will POST task status and results to this URL when generation completes
- Callback includes generated content URLs and task information
- Your callback endpoint should accept POST requests with JSON payload containing results
- Alternatively, use the Get Task Details endpoint to poll task status
- To ensure callback security, see Webhook Verification Guide for signature verification implementation 示例:https://your-domain.com/api/callback。
inputobjectNoInput parameters for the generation task
  input.promptstringYesA text description of the image you want to generate (Max length: 20000 characters) 示例:Comic poster: cool banana hero in shades leaps from sci-fi pad. Six panels: 1) 4K mountain landscape, 2) banana holds page of long multilingual text with auto translation, 3) Gemini 3 hologram for search/knowledge/reasoning, 4) camera UI sliders for angle focus color, 5) frame trio 1:1-9:16, 6) consistent banana poses. Footer shows Google icons. Tagline: Nano Banana Pro now on ModelFold AI.。
  input.image_inputarray&lt;string&gt;NoInput images to transform or use as reference (supports up to 8 images) (File URL after upload, not file content; Accepted types: image/jpeg, image/png, image/webp; Max size: 30.0MB)
  input.aspect_ratiostringNoAspect ratio of the generated image Default:"1:1"。 Allowed values:1:1 / 2:3 / 3:2 / 3:4 / 4:3 / 4:5 / 5:4 / 9:16 / 16:9 / 21:9 / auto。 示例:1:1。
  input.resolutionstringNoResolution of the generated image Default:"1K"。 Allowed values:1K / 2K / 4K。 示例:1K。
  input.output_formatstringNoOutput image format: png or jpg. Set this field explicitly. Allowed values:png / jpg。 示例:png。

Request Example ​

bash
curl -X POST "https://ai.modelfold.online/v1/jobs/createTask" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "nano-banana-pro",
  "callBackUrl": "https://your-domain.com/api/callback",
  "input": {
    "prompt": "Comic poster: cool banana hero in shades leaps from sci-fi pad. Six panels: 1) 4K mountain landscape, 2) banana holds page of long multilingual text with auto translation, 3) Gemini 3 hologram for search/knowledge/reasoning, 4) camera UI sliders for angle focus color, 5) frame trio 1:1-9:16, 6) consistent banana poses. Footer shows Google icons. Tagline: Nano Banana Pro now on ModelFold AI.",
    "image_input": [],
    "aspect_ratio": "1:1",
    "resolution": "1K",
    "output_format": "png"
  }
}'
json
{
  "model": "nano-banana-pro",
  "callBackUrl": "https://your-domain.com/api/callback",
  "input": {
    "prompt": "Comic poster: cool banana hero in shades leaps from sci-fi pad. Six panels: 1) 4K mountain landscape, 2) banana holds page of long multilingual text with auto translation, 3) Gemini 3 hologram for search/knowledge/reasoning, 4) camera UI sliders for angle focus color, 5) frame trio 1:1-9:16, 6) consistent banana poses. Footer shows Google icons. Tagline: Nano Banana Pro now on ModelFold AI.",
    "image_input": [],
    "aspect_ratio": "1:1",
    "resolution": "1K",
    "output_format": "png"
  }
}

Response ​

200 — Request successful ​

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_nano-banana-pro_1765178625768"
  }
}

500 — Server error. ​

参数类型必填说明
codeinteger是Response status code
- 200: Success - Request has been processed successfully
- 401: Unauthorized - Authentication credentials are missing or invalid
- 402: Insufficient Credits - Account does not have enough credits to perform the operation
- 404: Not Found - The requested resource or endpoint does not exist
- 408: Timeout - No result has been returned for over 10 minutes.
- 422: Validation Error - The request parameters failed validation checks
- 429: Rate Limited - Request limit has been exceeded for this resource
- 455: Service Unavailable - System is currently undergoing maintenance
- 500: Server Error - An unexpected error occurred while processing the request
- 501: Generation Failed - Content generation task failed
- 505: Feature Disabled - The requested feature is currently disabled
msgstring是Response message, error description when failed
dataobject是—
json
{
  "code": 500,
  "msg": "Server Error - An unexpected error occurred while processing the request",
  "data": null
}

Callback ​

onImageGenerated ​

Callback URL: {$request.body#/callBackUrl} (the callBackUrl in the request body).

Sent when the task succeeds or fails.

Callback body parameters

参数类型必填说明
codeinteger否200: success. 501: failure; see data.failCode and data.failMsg. Allowed values:200 / 501。 示例:200。
msgstring否Status message 示例:Playground task completed successfully.。
dataobject否—
  data.completeTimeinteger否Task completion time, represented as a Unix timestamp in milliseconds 示例:1786428982000。
  data.costTimeinteger否Processing time in seconds. Present on both success and failure callbacks. 示例:29。
  data.createTimeinteger否Task creation time, represented as a Unix timestamp in milliseconds 示例:1786428952000。
  data.creditsConsumednumber否Credits consumed by the task; 0 for failed tasks. 示例:8。
  data.modelstring否Image generation model used for the task 示例:nano-banana-pro。
  data.paramstring否Parameters submitted when creating the task, in JSON string format 示例:{"input":"{\"image_input\":[],\"aspect_ratio\":\"1:1\",\"output_format\":\"png\",\"prompt\":\"Comic poster: A cool banana hero wearing sunglasses leaps from a sci-fi platform. The poster contains six panels: 1) a mountain landscape in 4K resolution, 2) the banana holding a page containing extensive multilingual text with automatic translation support, 3) a Gemini 3 holographic interface featuring search, knowledge Q&amp;A, and logical reasoning capabilities, 4) camera UI adjustment sliders for angle, focal length, and color, 5) three aspect ratio demonstrations ranging from 1:1 to 9:16, and 6) consistent action poses for the banana. Display the Google icon at the bottom of the poster with the slogan: Nano Banana Pro is now available on ModelFold AI.\",\"resolution\":\"1K\"}","callBackUrl": "https://your-domain.com/api/callback","model":"nano-banana-pro"}。
  data.resultJsonstring否Image generation result in JSON string format. resultUrls contains the list of generated image URLs. Present only when state is success. 示例:{"resultUrls":["https://tempfile.aiquickdraw.com/workers/images/image_b700b7f77f13b79cd2ee5bf1d39a104f.png"]}。
  data.statestring否Task status Allowed values:success / fail。 示例:success。
  data.taskIdstring否Task ID 示例:5659c84dcf183f0805e9cfdf746af2cf。
  data.updateTimeinteger否Use completeTime as the completion time; updateTime may equal createTime. 示例:1786428982000。
  data.failCodestring否Failure code, a numeric string such as "400" or "500". Present only when state is fail. 示例:500。
  data.failMsgstring否Failure reason. Present only when state is fail. 示例:&lt;error detail&gt;。

Success

json
{
  "code": 200,
  "msg": "Playground task completed successfully.",
  "data": {
    "taskId": "5659c84dcf183f0805e9cfdf746af2cf",
    "model": "nano-banana-pro",
    "state": "success",
    "param": "{\"input\":\"{\\\"image_input\\\":[],\\\"aspect_ratio\\\":\\\"1:1\\\",\\\"output_format\\\":\\\"png\\\",\\\"prompt\\\":\\\"Comic poster: A cool banana hero wearing sunglasses leaps from a sci-fi platform. The poster contains six panels: 1) a mountain landscape in 4K resolution, 2) the banana holding a page containing extensive multilingual text with automatic translation support, 3) a Gemini 3 holographic interface featuring search, knowledge Q&A, and logical reasoning capabilities, 4) camera UI adjustment sliders for angle, focal length, and color, 5) three aspect ratio demonstrations ranging from 1:1 to 9:16, and 6) consistent action poses for the banana. Display the Google icon at the bottom of the poster with the slogan: Nano Banana Pro is now available on ModelFold AI.\\\",\\\"resolution\\\":\\\"1K\\\"}\",\"callBackUrl\": \"https://your-domain.com/api/callback\",\"model\":\"nano-banana-pro\"}",
    "resultJson": "{\"resultUrls\":[\"https://tempfile.aiquickdraw.com/workers/images/image_b700b7f77f13b79cd2ee5bf1d39a104f.png\"]}",
    "completeTime": 1786428982000,
    "createTime": 1786428952000,
    "costTime": 29,
    "creditsConsumed": 8,
    "updateTime": 1786428982000
  }
}

Failure

json
{
  "code": 501,
  "msg": "Playground task failed.",
  "data": {
    "taskId": "5659c84dcf183f0805e9cfdf746af2cf",
    "model": "nano-banana-pro",
    "state": "fail",
    "param": "{\"input\":\"{\\\"image_input\\\":[],\\\"aspect_ratio\\\":\\\"1:1\\\",\\\"output_format\\\":\\\"png\\\",\\\"prompt\\\":\\\"Comic poster: A cool banana hero wearing sunglasses leaps from a sci-fi platform. The poster contains six panels: 1) a mountain landscape in 4K resolution, 2) the banana holding a page containing extensive multilingual text with automatic translation support, 3) a Gemini 3 holographic interface featuring search, knowledge Q&A, and logical reasoning capabilities, 4) camera UI adjustment sliders for angle, focal length, and color, 5) three aspect ratio demonstrations ranging from 1:1 to 9:16, and 6) consistent action poses for the banana. Display the Google icon at the bottom of the poster with the slogan: Nano Banana Pro is now available on ModelFold AI.\\\",\\\"resolution\\\":\\\"1K\\\"}\",\"callBackUrl\": \"https://your-domain.com/api/callback\",\"model\":\"nano-banana-pro\"}",
    "failCode": "500",
    "failMsg": "<error detail>",
    "completeTime": 1786428982000,
    "createTime": 1786428952000,
    "costTime": 29,
    "creditsConsumed": 0,
    "updateTime": 1786428982000
  }
}

ModelFold — one API for all the best AI models.