Używaj CometAPI z OpenAI POST /v1/images/generations do tworzenia obrazów z promptów tekstowych, kontrolowania stylu, wybierania rozmiarów i zwracania base64 lub 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, jeśli chcesz prosty smoke test oparty na URLgpt-image-1, gpt-image-1-mini lub gpt-image-1.5, jeśli chcesz korzystać z nowszych modeli obrazowych GPT i możesz obsługiwać odpowiedzi base64qwen-image, jeśli potrzebujesz konkretnie tego dostawcy, ale ustaw n na 1dall-e-3size na 1024x1024response_format: "url", jeśli chcesz małą odpowiedź JSON i tymczasowy URL do pobraniadall-e-2 i dall-e-3 obsługują odpowiedzi URL oraz odpowiedzi base64gpt-image-1, gpt-image-1-mini i gpt-image-1.5 najlepiej traktować jako ścieżki base64-firstqwen-image nie obsługuje n > 1dall-e-3 z response_format: "url" zwróciło standardowy znacznik czasu created, revised_prompt oraz tymczasowy URL obrazu.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"
}
]
}