For coding agents, discover the current recommended image shortlist first with
GET /v1/models?recommended_for=image, then send the selected model explicitly to this endpoint.Request Body
Model to use (e.g.,
dall-e-3, flux-pro, midjourney).Text description of the desired image.
Number of images to generate (1-4, model dependent).
Image size. Options vary by model:
- DALL-E 3:
1024x1024,1792x1024,1024x1792 - Other models:
512x512,1024x1024, etc.
Image quality (
standard or hd). DALL-E 3 only.Response format:
url or b64_json.Style for DALL-E 3:
vivid or natural.A unique identifier for the end-user.
Response
Inline Response
Unix timestamp of creation.
Array of generated images.Each object contains:
url(string): URL of the generated imageb64_json(string): Base64-encoded image (if requested)revised_prompt(string): The prompt used (DALL-E 3)
Async Task Response
Some image models return an async task immediately, and some may behave as either inline or task-based depending on the routed provider path. When the response includesstatus: "pending", treat it as an async task response:
Use the returned
poll_url exactly when it is provided. Treat task_id as the async task identity for follow-up polling.Unix timestamp of creation.
Unique task identifier for polling.
Initial status:
pending.Relative URL to poll for results (for example,
/v1/images/generations/{task_id} or /v1/tasks/{task_id}).Array with placeholder data.
url will be empty until completed.When you receive
status: "pending", use the Get Image Status endpoint to poll for the result.Available Models
| Model | Type | Features |
|---|---|---|
dall-e-3 | Usually inline | Best quality, prompt enhancement |
dall-e-2 | Usually inline | Faster, more affordable |
flux-pro | Often task-based | Photorealistic, high quality |
flux-schnell | Usually inline | Very fast |
midjourney | Often task-based | Artistic style |
ideogram-v3 | Often task-based | Best text rendering |
stable-diffusion-3 | Usually inline | Open source, customizable |
Handling Task-Based Responses
For image models, always check whether the response containsstatus: "pending":