Skip to main content
POST
/
v3
/
nano-banana-2-t2i
Nano Banana 2 Text-to-Image
curl --request POST \
  --url https://api.highwayapi.ai/v3/nano-banana-2-t2i \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "prompt": "<string>",
  "size": "<string>",
  "quality": "<string>",
  "response_format": "<string>"
}
'
{
  "images": [
    "<string>"
  ]
}
Generate images from text prompts using the Nano Banana 2 model, with support for configuring the image aspect ratio and quality level.

Request Headers

Content-Type
string
required
Enum value: application/json
Authorization
string
required
Bearer authentication format: Bearer {{API Key}}.

Request Body

prompt
string
required
The text prompt used to generate the image. Supports Chinese and English. Recommended length is no more than 1000 characters.
size
string
default:"1x1"
The aspect ratio of the output image. The system will automatically map it to the corresponding pixel dimensions.Available values: 1x1, 2x3, 3x2, 3x4, 4x3, 4x5, 5x4, 9x16, 16x9, 21x9
quality
string
default:"1k"
The image generation quality level. Higher quality can produce clearer and more detailed images.Available values: 1k, 2k, 4k
response_format
string
default:"url"
The return format for the generated image.Available values: url, b64_json

Response Information

images
string[]
required
An array of generated images. Elements are image URLs (when response_format is url) or Base64-encoded strings (when response_format is b64_json).