Використовуйте CometAPI з OpenAI POST /v1/images/generations, щоб створювати зображення з текстових Prompt, керувати стилем, вибирати розміри та повертати base64 або URL.
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, якщо вам потрібен простий smoke test на основі URLgpt-image-1, gpt-image-1-mini або gpt-image-1.5, якщо вам потрібні новіші GPT-моделі для зображень і ви можете працювати з base64-відповідямиqwen-image, якщо вам потрібен саме цей провайдер, але залишайте n рівним 1dall-e-3size значенням 1024x1024response_format: "url", якщо вам потрібна невелика JSON-відповідь і тимчасовий URL для завантаженняdall-e-2 і dall-e-3 підтримують відповіді у форматі URL і base64gpt-image-1, gpt-image-1-mini і gpt-image-1.5 краще розглядати як маршрути з пріоритетом base64qwen-image не підтримує n > 1dall-e-3 з response_format: "url" повернув звичайну часову мітку created, revised_prompt і тимчасовий 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"
}
]
}