POST /v1/images/generations creates images from a prompt.
Use this endpoint when your workflow is primarily about generating images, not running a broader multimodal conversation.
Common fields
| Field | Common use |
|---|---|
model | image generation model |
prompt | image description or instruction |
size | output dimensions |
response_format | url or b64_json |
n | number of images, when supported by the model |
Example Request
Response Shape
Notes
response_formatcan beurlorb64_jsonnandsizeconstraints depend on the model- the prompt is moderated before generation
Common mistakes
- using
Images APIfor workflows that should really be multimodal Responses prompts - assuming every model supports the same
sizeorncombinations - forgetting to handle
b64_jsondifferently from hosted image URLs