图片

生成 Grok 图片

使用长宽比、分辨率和返回格式等参数生成 Grok 图片。

POST/v1/images/generations

请求参数

参数类型 / 位置说明
model必填stringbody

Grok 图片模型 ID。

prompt必填stringbody

图片提示词。

aspect_ratio可选stringbody

目标长宽比。

n可选integerbody

生成图片数量。

resolution可选stringbody

输出分辨率。

1k2k
response_format可选stringbody

图片返回格式。

urlb64_json

请求示例

cURL
curl --request POST \
  --url 'https://api.juhenextvip.com/v1/images/generations' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "grok-imagine-image",
  "prompt": "A quiet futuristic train station at blue hour",
  "aspect_ratio": "16:9",
  "resolution": "2k",
  "response_format": "url"
}'

响应示例

JSON
{
  "created": 1785859200,
  "data": [
    { "url": "https://example.com/grok-image.png" }
  ]
}