Nano Banana Pro

Generate or transform images with Nano Banana Pro in fast or pro mode through async media tasks.

Nano Banana Pro supports text-to-image and image-to-image tasks with up to 14 reference images, with fast and pro modes.

Model information

ItemValue
Model IDnano-banana-pro
EndpointPOST /v1/router/task/create
Task typesTxt2Img, Img2Img
OperationCreate an asynchronous task, then poll for its result

Async task workflow

  1. Prepare input media. Image-to-image inputs must be publicly reachable direct HTTPS URLs. Pass up to 14 jpeg/png/webp images, each no more than 30 MB. Local files, Base64 / Data URLs, and existing remote URLs can be converted to a public fileUrl with HopsAPI file uploads. Do not pass asset://, s3://, file://, or private-network URLs directly.
  2. Create the task. Send the model-specific task, model, mode, and input fields documented below to POST /v1/router/task/create. The response guarantees a platform task_id in tsk_* format; other success fields come from the current upstream and are not a fixed contract. Optional callback_url receives a signed webhook when the task finishes. See Media task callbacks. That URL is not forwarded upstream.
  3. Poll or cancel. Save task_id and call GET /v1/router/tasks/{task_id} every 3–5 seconds. To stop a queued or processing task, send {"task_id":"tsk_..."} to POST /v1/router/task/stop. An API key can only query or cancel tasks owned by the same buyer.
  4. Read the result. Continue polling until the task reaches a terminal status:
StatusMeaning
0Queued — submitted and awaiting scheduling
1Processing — the model is generating
2Completed — output URLs are usually in results[].urls; cost is your price in credits
3Failed — the reserved amount is released and no charge is settled
4Cancelled — the reserved amount is released and no charge is settled

Failure responses are intentionally neutral and do not expose upstream details. Use the request id in Provider error (request id: aitk-...) to correlate server logs; do not depend on error_message, fail_reason, or message for provider diagnostics. The fixed price shown below is locked at task creation and temporarily reserved from the available balance before upstream submission. It is settled only after successful completion. Failure or cancellation releases the reserved amount without a charge, and the upstream provider's actual cost does not determine the buyer price.

Result URLs expire in about 24 hours. Download and store the output promptly.

Use model="nano-banana-pro" for Txt2Img and Img2Img. Top-level mode accepts fast or pro, defaults to pro, and is passed upstream unchanged.

Request parameters

ParameterTypeRequiredDescription
taskstringYesTxt2Img for generation or Img2Img for transformation
modelstringYesSet to nano-banana-pro
modestringNofast or pro; defaults to pro
input.promptstringYesImage generation or editing prompt
input.imagesstring[]Image-to-image1–14 public HTTPS image URLs
input.aspect_ratiostringYesChoose from the list below; auto is not supported
input.resolutionstringYesfast: 1K / 2K / 4K; pro: 2K / 4K
input.output_formatstringNojpg or png
callback_urlstringNoOptional public HTTPS webhook. See Media task callbacks.

Supported aspect_ratio values:

1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9

Fast mode accepts 1K, 2K, or 4K; pro accepts 2K or 4K. output_format accepts jpg or png. Image-to-image images accepts up to 14 public HTTPS URLs.

Fixed prices

Official prices are in credits per task; your charge is the table price × your configured coefficient.

ModeTask1K2K4K
fastTxt2Img / Img2Img559
proTxt2ImgNot supported1424
proImg2ImgNot supported1626

Request examples

# Text-to-image
curl https://hopsapi.com/v1/router/task/create \
  -H "Authorization: Bearer sk-YOUR_KEY" -H "content-type: application/json" \
  -d '{"task":"Txt2Img","model":"nano-banana-pro","mode":"fast",
       "input":{"prompt":"cinematic mountain landscape at sunrise","aspect_ratio":"16:9","resolution":"4K","output_format":"jpg"}}'
# Image-to-image (transform / reference)
curl https://hopsapi.com/v1/router/task/create \
  -H "Authorization: Bearer sk-YOUR_KEY" -H "content-type: application/json" \
  -d '{"task":"Img2Img","model":"nano-banana-pro","mode":"fast",
       "input":{"prompt":"convert to cinematic concept art","images":["https://input.png"],"aspect_ratio":"3:4","resolution":"2K","output_format":"png"}}'

Create response

Current upstream success response example:

{
  "code": 200,
  "message": "task created",
  "task_id": "tsk_01H..."
}

The gateway preserves other upstream success fields but only guarantees rewriting task_id to the platform tsk_* ID. Store task_id and poll it as described above. Successful output URLs are usually in results[].urls.

On this page

On this page