Skip to main content
POST
/
v1
/
images
/
generations
Create images
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"
    }
  ]
}
Use this route to create images from text with OpenAI-compatible request shapes on CometAPI.

Choose a model first

  • Use dall-e-3 when you want a simple URL-based smoke test
  • Use gpt-image-1, gpt-image-1-mini, or gpt-image-1.5 when you want newer GPT image models and can handle base64 responses
  • Use qwen-image when you need that provider specifically, but keep n at 1

Safe first request

  • Start with dall-e-3
  • Keep size at 1024x1024
  • Set response_format: "url" if you want a small JSON response and a temporary download URL
  • Use one prompt and one image before you add batch generation or style tuning

Model-specific response behavior

  • dall-e-2 and dall-e-3 support URL responses and base64 responses
  • gpt-image-1, gpt-image-1-mini, and gpt-image-1.5 are better treated as base64-first routes
  • qwen-image does not support n > 1
During live validation on 2026-03-12, a dall-e-3 request with response_format: "url" returned a normal created timestamp, a revised_prompt, and a temporary image URL.
Generated images must comply with provider usage policies. Do not send illegal, violent, pornographic, or copyright-infringing prompts.

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your CometAPI key.

Body

application/json
model
string
default:dall-e-3
required

The image generation model to use. Choose a current model from the Models page.

prompt
string
required

Text description of the image you want to generate.

Example:

"A paper boat floating on calm water at sunrise."

n
integer
default:1

Number of images to generate. Keep this at 1 for the broadest compatibility.

size
string

Requested output size. Supported values depend on the selected model.

Example:

"1024x1024"

response_format
enum<string>

Requested output encoding for models that support it.

Available options:
url,
b64_json

Response

200 - application/json

Image generation result.

created
integer
required

Unix timestamp for the completed generation.

data
object[]
required