Get API Key Get API
Docs

Nano banana2 Image Generation

- Supports text-to-image and image-to-image, up to 4K resolution output

  • Up to 14 reference images for style/character consistency
  • Supports extreme aspect ratios (1:4, 4:1, 1:8, 8:1)
  • Integrated Google Search enhancement for more realistic image generation
Info

Model name compatibility note: This endpoint also accepts the alias nano-banana-2-ext, which is equivalent to gemini-3.1-flash-image-preview. The two are interchangeable and produce identical results.

Request example

# model can be "gemini-3.1-flash-image-preview", or the compatible alias "nano-banana-2-ext"
curl --request POST \
  --url https://api.openveer.com/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gemini-3.1-flash-image-preview",
    "prompt": "Cyberpunk cityscape at night with neon lights",
    "size": "16:9",
    "resolution": "2K",
    "n": 1
  }'

Response example

{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
    }
  ]
}

Authorizations

Authorization string

All API endpoints require Bearer Token authentication

Get your API Key:

Visit the API Key Management Page to get your API Key

Add it to the request header:

Authorization: Bearer YOUR_API_KEY

Body

model string

Image generation model name

Supported models:

  • gemini-3.1-flash-image-preview - Standard version (compatible alias nano-banana-2-ext)
  • gemini-3.1-flash-image-preview-official - Official version (compatible alias nano-banana-2)

Example: "gemini-3.1-flash-image-preview" or "gemini-3.1-flash-image-preview-official"

Note



For backward compatibility, the aliases nano-banana-2-ext (for gemini-3.1-flash-image-preview) and nano-banana-2 (for gemini-3.1-flash-image-preview-official) remain usable.

nsfw_check boolean

Whether to run content moderation before submitting the image task.

  • true: use omni-moderation-latest to review prompts and input images
  • false or omitted: do not send a moderation request, adding no moderation cost or latency (default)
prompt string

Text description for image generation

size string

Image aspect ratio

Supported ratios:

  • auto - Automatically choose the aspect ratio
  • 1:1 - Square, avatars, social media
  • 3:2 / 2:3 - Standard photos
  • 4:3 / 3:4 - Traditional display ratio
  • 16:9 / 9:16 - Widescreen / vertical video covers
  • 5:4 / 4:5 - Instagram images
  • 21:9 - Ultra-wide banner
  • 1:4 / 4:1 - Long poster / banner
  • 1:8 / 8:1 - Extreme long images / banner ads

Warning



For text-to-image, when size is auto, the default is 1:1 or 16:9; for image-to-image, the aspect ratio follows the upstream response. We recommend specifying an aspect ratio.

resolution string

Output image resolution

Supported values:

  • 0.5K - \~512px, low-resolution preview
  • 1K - \~1024px, standard resolution (default)
  • 2K - \~2048px, high resolution
  • 4K - \~4096px, ultra-high resolution

Note: Different resolutions have different pricing. 4K costs more than 1K.

n integer

Number of images to generate

Range: 1

Default: 1

⚠️ Note: Must enter a plain number (e.g., 1), do not use quotes or it will cause an error

official_fallback boolean

Whether to use the official channel fallback

  • false: Do not use (default)
  • true: Use official channel

Warning



When using the official channel (gemini-3.1-flash-image-preview-official), this parameter cannot be used.

image_urls array

Reference image URL list for image-to-image generation

Two formats are supported:

1. Full image URL

  • Publicly accessible image URL (http\:// or https\://)
  • Example: https://example.com/image.jpg

2. Base64 encoded format

  • Must use the full Data URI format
  • Format: data:image/{format};base64,{base64data}
  • Supported image formats: jpeg, png, webp
  • Example: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABg...
  • ⚠️ Note: Must include the data:image/jpeg;base64, prefix

Limitations:

  • Maximum 14 reference images (recommended: up to 10 object refs + 4 character refs)
  • Single image size: not exceeding 10MB
  • Supported formats: jpeg, png, webp
google_search boolean

Enable Google text search enhancement

  • true: The model will search web text information to assist image generation, suitable for scenarios requiring real-world information
  • false: Disabled (default)
google_image_search boolean

Enable Google image search enhancement

  • true: In addition to text search, will also search for reference images to assist generation, suitable for scenarios requiring visual references
  • false: Disabled (default)

Note: Must be used together with google_search: true

Response

code integer

Response status code

data array
Response data array
status string

Task status

  * submitted - Submitted
task_id string

Unique task identifier

This documentation is built and hosted on Mintlify, a developer documentation platform.