model parameter so you can route requests to different image providers without changing your client code.
Authentication
Include your API key in every request:- Generate
- Edit
- Variations
Generate an image from a prompt
POST /v1/images/generations accepts a text prompt and returns one or more image URLs. Use the n parameter to request multiple images and size to control resolution.curl
Key parameters
| Parameter | Type | Description |
|---|---|---|
model | string | The image model to use, e.g. openai/dall-e-3. |
prompt | string | Text description of the image to generate. |
n | integer | Number of images to return (1–10, model-dependent). |
size | string | Image dimensions, e.g. 256x256, 512x512, 1024x1024. |
response_format | string | url (default) or b64_json. |
Example response
url field contains a temporary link to the generated image. Download and store it if you need it beyond the expiry window.