Use o CometAPI com OpenAI POST /v1/images/generations para criar imagens a partir de prompts de texto, controlar o estilo, escolher tamanhos e retornar base64 ou URLs.
curl --request POST \
--url https://api.cometapi.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "dall-e-3",
"prompt": "A paper boat floating on calm water at sunrise."
}
'{
"created": 1773311889,
"data": [
{
"revised_prompt": "A paper boat floating on calm water at sunrise, with soft golden light reflecting off the water's surface.",
"url": "https://filesystem.site/cdn/20260312/1d6826050921c07a13ff173310c640.webp"
}
]
}dall-e-3 quando quiser um teste simples baseado em URLgpt-image-1, gpt-image-1-mini ou gpt-image-1.5 quando quiser modelos de imagem GPT mais novos e puder lidar com respostas em base64qwen-image quando precisar especificamente desse provedor, mas mantenha n em 1dall-e-3size em 1024x1024response_format: "url" se quiser uma resposta JSON pequena e uma URL temporária para downloaddall-e-2 e dall-e-3 oferecem suporte a respostas por URL e respostas em base64gpt-image-1, gpt-image-1-mini e gpt-image-1.5 são melhor tratados como rotas baseadas primeiro em base64qwen-image não oferece suporte a n > 1dall-e-3 com response_format: "url" retornou um timestamp created normal, um revised_prompt e uma URL temporária da imagem.Bearer token authentication. Use your CometAPI key.
The image generation model to use. Choose a current model from the Models page.
Text description of the image you want to generate.
"A paper boat floating on calm water at sunrise."
Number of images to generate. Keep this at 1 for the broadest compatibility.
Requested output size. Supported values depend on the selected model.
"1024x1024"
Requested output encoding for models that support it.
url, b64_json curl --request POST \
--url https://api.cometapi.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "dall-e-3",
"prompt": "A paper boat floating on calm water at sunrise."
}
'{
"created": 1773311889,
"data": [
{
"revised_prompt": "A paper boat floating on calm water at sunrise, with soft golden light reflecting off the water's surface.",
"url": "https://filesystem.site/cdn/20260312/1d6826050921c07a13ff173310c640.webp"
}
]
}