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",
  "sync_return": "true",
  "hook_url": "<string>"
}
'
{
  "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.

由于 Nano Banana 生图是同步响应,生成时间较长,建议使用 https://api.ttapi.org 网关

可用模型

模型别名
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

请前往 TTAPI 控制台 获取 API 密钥。

Body

application/json
prompt
string
required

生成图像或修改图像描述词

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

模型版本

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[]

参考图像列表,支持多图,图像url和base64

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

图片比例, 仅支持 gemini-3 及以上版本模型使用
1:4、4:1、1:8、8:1 仅 gemini-3.1-flash-image-preview 模型可用

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

图片分辨率,注意此处为大写的“K”

Available options:
1K,
2K,
4K

是否启用谷歌网页搜索

  • false:禁用
  • true:启用

是否启用谷歌图片搜索

  • false:禁用
  • true:启用
thinking_level
enum<string>

思考等级
gemini-3.1-flash-image-preview 模型可用

Available options:
Minimal,
High
sync_return
boolean
default:true

是否同步。 true-同步返回图像结果,接口等待耗时较长; false-立马返回 jobId ,通过回调或查询获取图像结果。

hook_url
string

回调通知地址

Response

请求成功

status
string
required
Example:

"SUCCESS"

message
string
required
Example:

"success"

data
object
required

任务结果

Last modified on March 23, 2026