Image Generation
Generate high-quality images using DALL-E 3 model based on text prompts. DALL-E 3 is OpenAI’s advanced image generation model capable of understanding complex prompts and generating detailed images.Endpoint
POST /v1/images/generations
Authentication
All requests require a Bearer token in the Authorization header:Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model ID, use dall-e-3 |
| prompt | string | Yes | Text description for image generation, max 4000 characters |
| n | integer | No | Number of images to generate, DALL-E 3 only supports 1 |
| size | string | No | Image size, options: 1024x1024, 1792x1024, 1024x1792, default 1024x1024 |
| quality | string | No | Image quality, options: standard, hd, default standard |
| style | string | No | Image style, options: vivid, natural, default vivid |
| response_format | string | No | Response format, options: url, b64_json, default url |
Request Example
Response Example
Response Fields
| Field | Type | Description |
|---|---|---|
| created | integer | Creation timestamp |
| data | array | List of generated images |
| data[].url | string | Image URL (when response_format is url) |
| data[].b64_json | string | Base64 encoded image (when response_format is b64_json) |
| data[].revised_prompt | string | DALL-E 3’s revised prompt |
Notes
- DALL-E 3 automatically optimizes your prompt to generate better images
- The
revised_promptfield contains the prompt actually used by the model hdquality generates more detailed images but consumes more resourcesvividstyle generates more dramatic images,naturalstyle is more realistic