Skip to content
English

Nano Banana

POST /v1/tasks

All models are called through the Unified Async API POST /v1/tasks endpoint; only the input fields differ (see input parameters below).

Model summary

Model name Nano-Banana
Type Image generation (text-to-image)
Endpoint POST /v1/tasks
Pricing See HiAPI Pricing

Nano Banana is fast and prompt-tolerant, suited to quick creative exploration, social images, and batch ideation.

Production guidance

Production guidance
  • For production, pass callback.url at the top level of the request body so HiAPI can notify your service when the task reaches a terminal state.
  • GET /v1/tasks/:id is better for local debugging, low-volume jobs, or fallback reconciliation if a callback is missed.
  • Use callback.when=final. Both success and fail are terminal states, so your service should deduplicate by taskId.

Best suited for

Fast text-to-image

Generate concepts, covers, illustrations, and social assets directly from natural language.

prompt
Format adaptation

Deliver one idea into square, landscape, portrait, and other placements.

aspect_ratio
Output handoff

Choose PNG, JPEG, JPG, or WebP depending on the project need.

output_format
Batch ideation

Explore directions quickly, then move strong prompts to a higher-fidelity model.

prompt

Request parameters

model string required

Fixed value Nano-Banana.

example Nano-Banana
input object required

Business parameters. Nano Banana is currently documented as text-to-image.

prompt string required

Image generation prompt, up to 5000 characters.

aspect_ratio enum optional

Generated image aspect ratio.

default auto enum: auto1:116:99:163:44:33:22:35:44:521:9
output_format enum optional

Output image format.

default png enum: pngjpeg
callback object optional

Optional callback configuration. In production, pass callback.url so HiAPI can notify your service when the task reaches a terminal state.

url string required

HTTPS URL that receives terminal task notifications.

example https://your-domain.com/hiapi/callback
when enum optional

Callback trigger timing. Use final for terminal-state notifications.

default final enum: final

Example requests

Fast concept image

Validate a prompt direction at low friction.

Request body
{
  "model": "Nano-Banana",
  "input": {
    "prompt": "A cute 3D cartoon banana on a white background",
    "aspect_ratio": "1:1",
    "output_format": "png"
  }
}
Social landscape

For landscape covers or post images.

Request body
{
  "model": "Nano-Banana",
  "input": {
    "prompt": "A colorful tropical fruit poster, clean vector-like style",
    "aspect_ratio": "16:9",
    "output_format": "png"
  }
}

Getting the result

  1. The response returns a taskId immediately without waiting for generation to finish.
  2. In production, prefer waiting for callback.url to receive the terminal notification. For local debugging, poll GET /v1/tasks/:id.
  3. When status=success, download the generated image from output[].url.
  4. When status=fail, fix the request based on the returned error instead of retrying the same invalid payload.

Next steps