Usa CometAPI con OpenAI POST /v1/images/generations para crear imágenes a partir de prompts de texto, controlar el estilo, elegir tamaños y devolver base64 o 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 cuando quieras una prueba básica simple basada en URLgpt-image-1, gpt-image-1-mini o gpt-image-1.5 cuando quieras modelos de imagen GPT más recientes y puedas manejar respuestas en base64qwen-image cuando necesites específicamente ese proveedor, pero mantén n en 1dall-e-3size en 1024x1024response_format: "url" si quieres una respuesta JSON pequeña y una URL de descarga temporaldall-e-2 y dall-e-3 admiten respuestas por URL y respuestas en base64gpt-image-1, gpt-image-1-mini y gpt-image-1.5 se tratan mejor como rutas orientadas primero a base64qwen-image no admite n > 1dall-e-3 con response_format: "url" devolvió una marca de tiempo created normal, un revised_prompt y una URL temporal de imagen.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"
}
]
}