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
Synchronous Response (DALL-E, Flux Schnell, etc.)
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)
Asynchronous Response (Midjourney, Flux Pro, Ideogram, etc.)
Some models require longer processing time and return an async response:Unix timestamp of creation.
Unique task identifier for polling.
Initial status:
pending.Relative URL to poll for results (e.g.,
/v1/images/generations/{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 | Sync | Best quality, prompt enhancement |
dall-e-2 | Sync | Faster, more affordable |
flux-pro | Async | Photorealistic, high quality |
flux-schnell | Sync | Very fast |
midjourney | Async | Artistic style |
ideogram-v3 | Async | Best text rendering |
stable-diffusion-3 | Sync | Open source, customizable |
Handling Async Responses
For async models, check if the response containsstatus: "pending":