画像を作成します
POST
https://api.openai.com/v1/images/generations
Request
Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.Example:
Authorization: Bearer ********************
Header Params
Authorization
string
optional
Example:
Bearer {{YOUR_API_KEY}}
Body Params application/json
prompt
string
required
model
string
optional
n
integer
optional
quality
string
optional
hd
创建具有更精细细节和更高一致性的图像。此参数仅支持dall-e-3
.response_format
string
optional
style
string
optional
256x256
、512x512
或1024x1024
for之一dall-e-2
。对于模型来说,必须是1024x1024
、1792x1024
、 或之一。1024x1792``dall-e-3
user
string
optional
vivid
之一natural
。生动使模型倾向于生成超真实和戏剧性的图像。自然使模型生成更自然、不太真实的图像。此参数仅支持dall-e-3
.size
string
optional
Example
{
"model": "dall-e-3",
"prompt": "A cute baby sea otter",
"n": 1,
"size": "1024x1024"
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.openai.com/v1/images/generations' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "dall-e-3",
"prompt": "A cute baby sea otter",
"n": 1,
"size": "1024x1024"
}'
Responses
🟢200Create image
application/json
Body
created
integer
required
data
array [object {1}]
required
url
string
required
Example
{
"created": 1589478378,
"data": [
{
"url": "https://..."
},
{
"url": "https://..."
}
]
}
Modified at 2024-12-17 03:33:29