Overview
Generate images from text prompts using DALL-E and other image generation models.
Python Usage
Basic Image Generation
DALL-E 2 (Faster, Lower Cost)
Save Image to File
Async Usage
GPT-Image Models
Opt Out of Auto-Dropping
Parameters
Model-specific parameter handling
The capability wrapper drops parameters a model rejects before calling LiteLLM, so calls succeed without special-casing.
drop_params=True is injected per call — the global litellm.drop_params is left untouched. The same handling applies to aimage_generate, image_edit, and aimage_edit.
Result Object
The ImageResult object contains:
url: Image URL
b64_json: Base64 encoded image (if requested)
revised_prompt: DALL-E 3’s revised prompt
model: Model used
save(path): Method to save image to file