Criar edição de imagem
POST
https://api.openai.com/v1/images/edits
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.openai.com/v1/images/edits' \
--header 'Authorization: Bearer ' \
--form 'image=@"cmMtdXBsb2FkLTE2ODc4MzMzNDc3NTEtMjA=/31225951_59371037e9_small.png"' \
--form 'prompt="A cute baby sea otter wearing a beret."' \
--form 'n="2"' \
--form 'size="1024x1024"' \
--form 'response_format="url"' \
--form 'user=""'
Response Response Example
{
"created": 1589478378,
"data": [
{
"url": "https://..."
},
{
"url": "https://..."
}
]
}
Request
Header Params
Authorization
string
optional
Example:
Bearer {{YOUR_API_KEY}}
Body Params multipart/form-data
image
file
required
Example:
cmMtdXBsb2FkLTE2ODc4MzMzNDc3NTEtMjA=/31225951_59371037e9_small.png
mask
file
optional
image
deve ser editada. Deve ser um arquivo PNG válido, com menos de 4 MB e ter as mesmas dimensões da image
.Example:
[]
prompt
string
required
Example:
A cute baby sea otter wearing a beret.
n
string
optional
Example:
2
size
string
optional
256x256
, 512x512
ou 1024x1024
.Example:
1024x1024
response_format
string
optional
url
ou b64_json
.Example:
url
user
string
optional
Responses
Modified at 2024-12-23 06:20:38