Create image
POST
https://api.openai.com/v1/images/generations
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 '{
"prompt": "A colorful sunset over the mountains",
"n": 2,
"size": "1024x1024"
}'
Response Response Example
{
"created": 1589478378,
"data": [
{
"url": "https://..."
},
{
"url": "https://..."
}
]
}
Request
Header Params
Authorization
stringΒ
optional
Example:
Bearer {{YOUR_API_KEY}}
Body Params application/json
Responses
Modified atΒ 2023-07-27 02:58:35