跳转到主要内容
POST
/
api
/
openapi
/
submit
curl --request POST \
  --url https://aireiter.com/api/openapi/submit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt_image_2_official",
    "params": {
      "prompt": "星空下的古老城堡",
      "aspect_ratio": "16:9",
      "resolution": "2K",
      "quality": "high"
    },
    "out_task_id": "my_task_123456"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KPTXXXXXXXXXXXXXXX"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.aireiter.com/llms.txt

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

Authorizations

Authorization
string
必填
所有接口均需要使用 Bearer Token 进行认证获取 API Key:访问 API Key 管理页面 获取您的 API Key使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY

Body

model
string
默认值:"gpt_image_2_official"
必填
图像生成模型名称固定填写 gpt_image_2_official(OpenAI 官方 gpt-image-2 模型)
params
object
必填
模型参数对象
out_task_id
string
必填
发起方任务ID用户自定义的任务标识,必填

尺寸 × 分辨率映射表

aspect_ratio × resolution → OpenAI 实际像素(13 比例 × 3 档位):
aspect_ratio1K2K4K
1:11024×10242048×2048❌ 超像素上限
3:21536×10242048×1360❌ 超像素上限
2:31024×15361360×2048❌ 超像素上限
4:31024×7682048×1536❌ 超像素上限
3:4768×10241536×2048❌ 超像素上限
5:41280×10242560×2048❌ 超像素上限
4:51024×12802048×2560❌ 超像素上限
16:91536×8642048×11523840×2160
9:16864×15361152×20482160×3840
2:12048×10242688×13443840×1920
1:21024×20481344×26881920×3840
21:92016×8642688×11523840×1648
9:21864×20161152×26881648×3840
3:2 / 2:3 @ 2K 实际是 2048×1360(近似比例,误差 < 0.5%);4K 仅支持 6 个比例(总像素超 OpenAI 上限的组合不可用)。

Response

code
integer
响应状态码
data
array
返回数据数组

查询任务结果

提交成功后返回 task_id,通过 GET /v1/tasks/{task_id} 轮询任务状态,详见 任务查询接口

轮询建议

  • 首次查询延迟:提交后等待 10~20 秒再开始查询
  • 查询间隔:建议 3~5 秒一次
  • 超时参考high + 2K/4K 组合耗时可达 130 秒,客户端超时建议 ≥ 180 秒
curl --request POST \
  --url https://aireiter.com/api/openapi/submit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt_image_2_official",
    "params": {
      "prompt": "星空下的古老城堡",
      "aspect_ratio": "16:9",
      "resolution": "2K",
      "quality": "high"
    },
    "out_task_id": "my_task_123456"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KPTXXXXXXXXXXXXXXX"
    }
  ]
}