curl --request POST \
--url https://api.openai.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "A cute baby sea otter",
"model": "dall-e-3",
"n": 1,
"quality": "standard",
"response_format": "url",
"size": "1024x1024",
"style": "vivid",
"user": "user-1234"
}'
{
"created": 123,
"data": [
{
"b64_json": "<string>",
"url": "<string>",
"revised_prompt": "<string>"
}
]
}
Creates an image given a prompt.
curl --request POST \
--url https://api.openai.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "A cute baby sea otter",
"model": "dall-e-3",
"n": 1,
"quality": "standard",
"response_format": "url",
"size": "1024x1024",
"style": "vivid",
"user": "user-1234"
}'
{
"created": 123,
"data": [
{
"b64_json": "<string>",
"url": "<string>",
"revised_prompt": "<string>"
}
]
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
OK
The response is of type object
.
Was this page helpful?