Skip to main content
POST
/
xai
/
images
生成图片
curl --request POST \
  --url https://api.mountsea.ai/xai/images \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "a cute cat sitting on a windowsill",
  "model": "grok-imagine-image",
  "aspectRatio": "2:3",
  "images": [
    "<string>"
  ]
}
'
{
  "taskId": "<string>"
}

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

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

Maximum string length: 1000
Example:

"a cute cat sitting on a windowsill"

model
enum<string>
required

图片模型

Available options:
grok-imagine-image
Example:

"grok-imagine-image"

aspectRatio
enum<string>

图片宽高比

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

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

Maximum array length: 1

Response

taskId
string
required

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