跳转到主要内容
创建图片生成
curl --request POST \
  --url https://xxx.wengaocloud.com/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-image-2",
  "prompt": "一张极简风格的云端工作站插画"
}
'
{
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>"
    }
  ]
}

授权

Authorization
string
header
默认值:sk-your-api-key
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
model
string
必填
prompt
string
必填
n
integer
默认值:1
必填范围: x >= 1
size
string
示例:

"1024x1024"

response_format
enum<string>
可用选项:
url,
b64_json

响应

图片生成响应。

created
integer
data
object[]