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-2.5-flash-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
  }
}

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-2.5-flash-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 March 15, 2026