Skip to main content
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

Example Request

Response Shape

Notes

  • response_format can be url or b64_json
  • n and size constraints depend on the model
  • the prompt is moderated before generation

Common mistakes

  • using Images API for workflows that should really be multimodal Responses prompts
  • assuming every model supports the same size or n combinations
  • forgetting to handle b64_json differently from hosted image URLs

Reference