Images API when your workflow is primarily about image generation or image editing rather than a broader conversational interaction.
When To Use It
- generating images from prompts
- editing an existing image with prompt instructions
- building image-only tools or automation jobs
Endpoint Families
POST /v1/images/generationscreates new images from a promptPOST /v1/images/editsedits one or more uploaded images with a prompt and optional mask
response_format.
Quick Example
Usage Tracking
The Images API includes ausage object in its response, which you can use to track token consumption. Depending on the model, it typically reports output_tokens or total_tokens corresponding to the generated images.
Example Usage Shape