Skip to main content
POST
生成图片

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
prompt
string
required

图片描述提示词(最大 5000 字符)

Maximum string length: 5000
Example:

"a cute cat sitting on a windowsill"

model
enum<string>
required

图片模型

Available options:
grok-imagine-image,
grok-imagine-image-quality
Example:

"grok-imagine-image"

aspectRatio
enum<string>

图片宽高比

Available options:
2:3,
3:2,
1:1,
9:16,
16:9
images
string[]

参考图片 URL(图生图 / 编辑图片,最多 5 张, 提供后图片尺寸跟随参考图片)

Maximum array length: 5

Response

200 - application/json
taskId
string
required

任务 ID,用于后续查询结果