Skip to main content
POST
/
openai
/
gpt
/
generations
cURL
curl --request POST \
  --url https://api.ttapi.io/openai/gpt/generations \
  --header 'Content-Type: application/json' \
  --header 'TT-API-KEY: <api-key>' \
  --data '
{
  "prompt": "<string>",
  "model": "gpt-image-2",
  "referImages": [
    "https://cdn.ttapi.io/xxx1.png",
    "https://cdn.ttapi.io/xxx2.png"
  ],
  "aspect_ratio": "1:1",
  "size": "1024x1024",
  "hookUrl": "<string>"
}
'
{
  "status": "SUCCESS",
  "message": "success",
  "data": {
    "job_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  }
}

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.

Authorizations

TT-API-KEY
string
header
required

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

Body

application/json
prompt
string
required

生成图片文字提示,因为目前为逆向模型,建议文案提示存在关键字:** “画一张xxx”, “生成一张”,'draw a xxx', ** 具体语言不限制,openai本身就支持多语言模型,中文支持也非常友好。

model
enum<string>
default:gpt-image-2

支持模型

Available options:
gpt-4o-image,
gpt-image-1,
gpt-image-1.5,
gpt-image-2,
gpt-image-2-plus
referImages
string[]

垫图数组

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

图像宽高比,参数支持模型:gpt-image-2

Available options:
1:1,
3:4,
4:3,
16:9,
9:16
Example:

"1:1"

size
string

图像尺寸(width × height),参数支持模型:gpt-image-2-plus

需满足以下限制:

宽高必须为 16 的倍数 最长边 ≤ 3840 宽高比 ≤ 3:1 总像素:655,360 ~ 8,294,400

不符合规则时,系统会自动修正到合法范围

Example:

"1024x1024"

hookUrl
string

回调通知地址,任务完成或失败将通过请地址进行通知,通知数据结构 [blocked]与fetch结构一致。如果未设置,则需要请求fetch接口 [blocked]进行查询

Response

请求成功

status
string
required
Example:

"SUCCESS"

message
string
required
Example:

"success"

data
object
required
Example:
{
"job_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
Last modified on April 22, 2026