Skip to main content

Endpoint

Creates an image based on a text prompt.

Request

Headers

string
required
Must be application/json
string
required
The AI provider to use (e.g., openai, stability-ai)
string
required
Your API key for the specified provider

Body Parameters

string
required
A text description of the desired image(s). Maximum length varies by model.
string
The model to use for image generation (e.g., dall-e-3, dall-e-2)
integer
default:1
Number of images to generate (1-10 for DALL-E 2, only 1 for DALL-E 3)
string
Size of the generated images
  • DALL-E 3: 1024x1024, 1024x1792, 1792x1024
  • DALL-E 2: 256x256, 512x512, 1024x1024
string
default:"standard"
Quality of the image: standard or hd (DALL-E 3 only)
string
default:"vivid"
Style of the generated images: vivid or natural (DALL-E 3 only)
string
default:"url"
Format of the response: url or b64_json
string
Unique identifier for the end-user

Response

integer
Unix timestamp of when the image was created
array
Array of generated images
string
URL of the generated image (when response_format is url)
string
Base64-encoded image data (when response_format is b64_json)
string
The prompt that was used to generate the image (DALL-E 3 may revise prompts)

Examples

Basic Image Generation

Response

Python SDK

JavaScript SDK

Generate Multiple Images (DALL-E 2)

Download and Save Image

Base64 Response Format

HD Quality with Natural Style

Landscape Orientation

Portrait Orientation

Prompt Engineering Tips

  1. Be Specific: Include details about subject, style, lighting, and composition
  2. Mention Style: Specify artistic styles (e.g., “oil painting”, “3D render”, “photograph”)
  3. Describe Details: Include colors, textures, and atmosphere
  4. Set the Scene: Describe the environment and context

Example Prompts

Rate Limits

Rate limits vary by provider and tier:
  • DALL-E 3: Typically 5-50 images per minute depending on tier
  • DALL-E 2: Higher throughput, up to 50 images per minute

Content Policy

All generated images must comply with provider content policies. Requests that violate policies will be rejected.