Nano Banana
/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
- 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
Generate concepts, covers, illustrations, and social assets directly from natural language.
promptDeliver one idea into square, landscape, portrait, and other placements.
aspect_ratioChoose PNG, JPEG, JPG, or WebP depending on the project need.
output_formatExplore directions quickly, then move strong prompts to a higher-fidelity model.
promptRequest parameters
model string required Fixed value 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.
output_format enum optional Output image format.
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.
when enum optional Callback trigger timing. Use final for terminal-state notifications.
Example requests
Validate a prompt direction at low friction.
{
"model": "Nano-Banana",
"input": {
"prompt": "A cute 3D cartoon banana on a white background",
"aspect_ratio": "1:1",
"output_format": "png"
}
}For landscape covers or post images.
{
"model": "Nano-Banana",
"input": {
"prompt": "A colorful tropical fruit poster, clean vector-like style",
"aspect_ratio": "16:9",
"output_format": "png"
}
}Getting the result
- The response returns a taskId immediately without waiting for generation to finish.
- In production, prefer waiting for callback.url to receive the terminal notification. For local debugging, poll GET /v1/tasks/:id.
- When status=success, download the generated image from output[].url.
- When status=fail, fix the request based on the returned error instead of retrying the same invalid payload.