Choose an image API
Image Generations
Generate images with an OpenAI-compatible request.
Image Editing
Edit images with an OpenAI-compatible request.
Gemini image generation
Generate or edit images with Gemini format.
Midjourney quick start
Submit and poll Midjourney image tasks.
Flux Generate Image
Generate Flux images through CometAPI.
Bria Generate Image
Use Bria image generation tools.
Generate an image
Use an image-capable model ID from the Models page or the model directory. The examples below call the OpenAI-compatible Image Generations API.These examples use the placeholder
your-image-model-id. Replace it with an available image model ID from the Models page or model directory before you run the request.Response example
A successful response can look like this. Depending on the selected model, each item can contain a base64 image or a result URL:Example model records
This example model catalog response shows the
/api/models envelope and one image model record shape. It is not a complete model list.cURL
Common errors
Invalid model ID
Invalid model ID
Choose an image-capable model from the Models page.
Unsupported size
Unsupported size
Use a size that the selected image endpoint accepts.
Expired result URL
Expired result URL
Download generated assets before provider links expire.
Upload too large
Upload too large
Use image URLs or smaller files instead of large base64 payloads.
Missing image data
Missing image data
Check both
b64_json and url fields because output shape can differ by model.Error codes and retry strategy
400
400
Do not retry until the prompt, size, or image input is fixed.
401
401
Do not retry until the API key is present and valid.
404
404
Check the base URL, path, and model ID before retrying.
413
413
Reduce upload size before retrying.
429
429
Retry with exponential backoff and reduce concurrency.
500 or 503
500 or 503
Retry with backoff for transient provider or service errors.
Pricing and model directory
Models page
Read how CometAPI exposes model IDs in the docs.
Model directory
Browse model availability and capabilities.
Pricing
Check pricing before you call a model.