Skip to content
中文

POST /v1/images/generations

Method: POSTEndpoint: /v1/images/generations

This section contains endpoint-specific behavior, parameters, or usage notes for this API.

This section contains endpoint-specific behavior, parameters, or usage notes for this API. This section contains endpoint-specific behavior, parameters, or usage notes for this API. This section contains endpoint-specific behavior, parameters, or usage notes for this API.

This section contains endpoint-specific behavior, parameters, or usage notes for this API. This section contains endpoint-specific behavior, parameters, or usage notes for this API.

Request Parameters

Query Parameters

text
async
string
  // provider-specific example normalized for English documentation
Required
Example:
true
webhook
string
Optional
Example:
https://www.baidu.com/notify

Header Parameters

text
Content-Type
string
Required
Example:
application/json
Authorization
string
Optional
Default Value:
Bearer {{YOUR_API_KEY}}

Body Parameters application/json

text
prompt
string
Required
model
string
Required
Example
{
"size"
:
"1024x1024"
,
"prompt"
:
"cat"
,
"model"
:
"sora_image"
,
"n"
:
1
}

Example Request

Shell

bash
curl --location --request POST '/v1/images/generations?async=true&webhook=https://www.baidu.com/notify' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "size": "1024x1024",
    "prompt": "cat",
    "model": "sora_image",
    "n": 1
}'

Response

🟢 200 Success

Content Type: application/json

Response Schema

text
code
string
Required
message
string
Required
data
string
task id
Required

Example

json
{
    "task_id": "3dad96708a77485e97ac7ef652796d7b"
}