Verwenden Sie CometAPI mit OpenAI POST /v1/images/generations, um Bilder aus Text-Prompts zu erstellen, den Stil zu steuern, Größen auszuwählen und base64 oder URLs zurückzugeben.
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, wenn Sie einen einfachen Smoke-Test auf URL-Basis möchtengpt-image-1, gpt-image-1-mini oder gpt-image-1.5, wenn Sie neuere GPT-Bildmodelle möchten und mit base64-Antworten umgehen könnenqwen-image, wenn Sie diesen Provider speziell benötigen, aber belassen Sie n auf 1dall-e-3size auf 1024x1024response_format: "url", wenn Sie eine kleine JSON-Antwort und eine temporäre Download-URL möchtendall-e-2 und dall-e-3 unterstützen URL-Antworten und base64-Antwortengpt-image-1, gpt-image-1-mini und gpt-image-1.5 sollten besser als base64-first-Routen behandelt werdenqwen-image unterstützt kein n > 1dall-e-3-Request mit response_format: "url" einen normalen created-Zeitstempel, einen revised_prompt und eine temporäre Bild-URL zurück.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"
}
]
}