Skip to main content
Generate images with OpenAI’s image models β€” DALL-E 2, DALL-E 3, and GPT-Image.

Generate

GPT-Image

gpt-image-1 always returns the image as base64.

With Options

Response Format

Default is url. Set b64_json to receive the image inline as base64.
The default response_format="url" is not sent to OpenAI, so models that reject the parameter, such as gpt-image-1, work without extra configuration.

Models