Use CometAPI with OpenAI POST /v1/images/generations to create images from text prompts, control style, choose sizes, and return base64 or 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 when you want a simple URL-based smoke testgpt-image-1, gpt-image-1-mini, or gpt-image-1.5 when you want newer GPT image models and can handle base64 responsesqwen-image when you need that provider specifically, but keep n at 1dall-e-3size at 1024x1024response_format: "url" if you want a small JSON response and a temporary download URLdall-e-2 and dall-e-3 support URL responses and base64 responsesgpt-image-1, gpt-image-1-mini, and gpt-image-1.5 are better treated as base64-first routesqwen-image does not support n > 1dall-e-3 request with response_format: "url" returned a normal created timestamp, a revised_prompt, and a temporary image URL.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"
}
]
}