主题
创建 Image
POST
https://az.gptplus5.com/v1/images/generations
请求参数
Header 参数
| 参数名 | 类型 | 必需 | 说明 | 示例 |
|---|---|---|---|---|
Authorization | string | 可选 | Bearer {{YOUR_API_KEY}} |
Body 参数 (application/json)
| 参数名 | 类型 | 必需 | 说明 |
|---|---|---|---|
model | string | 必需 | 用于生成图像的模型。 |
prompt | string | 必需 | 所需图像的文本描述。最大长度为 1000 个字符。 |
size | string | 可选 | 生成图像的尺寸: 960x960、720x1280、1280x720、1168x784、784x1168 |
请求示例
json
{
"model": "grok-3-image",
"prompt": "a cat",
"size": "960x960"
}cURL 示例
bash
curl --location --request POST 'https://az.gptplus5.com/v1/images/generations' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "grok-3-image",
"prompt": "a cat",
"size": "960x960"
}'返回响应
🟢200成功
响应示例
json
{
"created": 1773127037,
"data": [
{
"url": "https://pub-85624410c6c44bdb802187ae2bd8afff.r2.dev/grok/8903fc79-152b-4b80-b384-d74ae6775b07.jpg"
}
],
"usage": {
"generated_images": 1,
"output_tokens": 16384,
"total_tokens": 16384
}
}