生成图片
XAI (Grok)
grok image generation
根据文本提示词生成图片,可选传入参考图片实现图生图/编辑。 返回 taskId,使用 /xai/tasks 查询结果
POST
生成图片
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
图片描述提示词(最大 5000 字符)
Maximum string length:
5000Example:
"a cute cat sitting on a windowsill"
图片模型
Available options:
grok-imagine-image Example:
"grok-imagine-image"
图片宽高比
Available options:
2:3, 3:2, 1:1, 9:16, 16:9 参考图片 URL(图生图 / 编辑图片,最多 5 张, 提供后图片尺寸跟随参考图片)
Maximum array length:
5Response
200 - application/json
任务 ID,用于后续查询结果