Skip to main content
POST
/
gemini
/
image
/
generate
cURL
curl --request POST \
  --url https://api.ttapi.org/gemini/image/generate \
  --header 'Content-Type: application/json' \
  --header 'TT-API-KEY: <api-key>' \
  --data '
{
  "prompt": "<string>",
  "model": "gemini-3-pro-image-preview",
  "refer_images": [
    "https://cdn.ttapi.io/xxx1.png",
    "https://cdn.ttapi.io/xxx2.png"
  ],
  "aspect_ratio": "1:1",
  "image_size": "1K",
  "google_search": "false",
  "image_search": "false",
  "thinking_level": "Minimal"
}
'
{
  "status": "SUCCESS",
  "message": "success",
  "data": {
    "prompt": "a cute cat",
    "refer_images": null,
    "image_url": "https://cdn.ttapi.io/other/2025-09-10/8b46aa28-4433-455f-bf5c-f5ccea48baf2.png",
    "quota": 2
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.ttapi.io/llms.txt

Use this file to discover all available pages before exploring further.

Use this endpoint when you want the main Nano Banana API image generation workflow for Nano Banana, Nano Banana 2, or Nano Banana Pro. For the full family overview and model comparison, see the Nano Banana API overview and the Nano Banana Models Guide.
Since Nano Banana image generation is a synchronous response and takes a relatively long time, it is recommended to use the https://api.ttapi.org gateway.

Available Models

ModelAlias
gemini-2.5-flash-imageNano Banana
gemini-2.5-flash-image-previewNano Banana
gemini-3-pro-image-previewNano Banana Pro
gemini-3.1-flash-image-previewNano Banana 2

Authorizations

TT-API-KEY
string
header
required

You can obtain your API key from the TTAPI Dashboard.

Body

application/json
prompt
string
required

Image description for generation or modification

model
enum<string>
default:gemini-3-pro-image-preview
required

Model version

Available options:
gemini-2.5-flash-image-preview,
gemini-2.5-flash-image,
gemini-3-pro-image-preview,
gemini-3.1-flash-image-preview
refer_images
string[]

List of reference images

Example:
[
"https://cdn.ttapi.io/xxx1.png",
"https://cdn.ttapi.io/xxx2.png"
]
aspect_ratio
enum<string>
default:1:1

Image aspect ratio, only supported by gemini-3 and above

Available options:
1:1,
2:3,
3:2,
3:4,
4:3,
4:5,
5:4,
9:16,
16:9,
21:9,
1:4,
4:1,
1:8,
8:1
image_size
enum<string>
default:1K

Image resolution. Note: Use uppercase 'K'

Available options:
1K,
2K,
4K

Whether to enable Google web search

Whether to enable Google image search

thinking_level
enum<string>

Thinking level

Available options:
Minimal,
High

Response

Request successful

status
string
required
Example:

"SUCCESS"

message
string
required
Example:

"success"

data
object
required

Task result

Last modified on April 14, 2026