Skip to content

Grok Imagine 图像生成 ​

OmniRouters X.AI 图片协议参考 for the grok-imagine-image model.

接口 ​

POST /v1/images/generations

最小请求示例 ​

bash
curl https://omnirouters.com/v1/images/generations \
  -H "Authorization: Bearer $OMNIROUTERS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{\n  "model": "grok-imagine-image",\n  "prompt": "A cinematic flower in a glasshouse",\n  "size": "1024x1024",\n  "quality": "high",\n  "n": 1\n}'

此接口根据文本提示词生成图片。

请求体 ​

FieldType必填Description
modelstring必填固定使用 grok-imagine-image。
promptstring必填图片提示词。
sizestring否输出尺寸,例如 1024x1024。
qualitystring否图片质量:low、medium 或 high。
ninteger否生成数量。

The response may return Base64 data in data[].b64_json or a hosted URL in data[].url, depending on the model.

返回参数 ​

json
{
  "created": 1782875947,
  "data": [
    { "url": "https://example.com/image.png" }
  ]
}

说明 ​

Model-specific validation and output availability depend on the selected model and current OmniRouters routing configuration. For shared routing guidance, see Omni-Image API.