API Overview
Start generating images with GPT Image 2.
GPT Image 2 API overview
Use the API when you want the same image workflow inside your own app, script, or automation.
Endpoints
- Main image endpoint:
POST /v1/images/generations - Compatible endpoint:
POST /v1/chat/completions
Available models
gpt-image-1.5-allgpt-image-2-all
What you can send
- A text prompt
- Output size, such as
1024x1024 - Image count
- An optional reference image for image-to-image flows
Example request
curl https://your-api-host/v1/images/generations -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{
"model": "gpt-image-2-all",
"prompt": "A premium skincare bottle on a warm beige pedestal, studio light, realistic shadows",
"size": "1024x1024",
"n": 1
}'Next step
Start on the web generator first if you want to test prompts quickly, then move to the API when you need a repeatable workflow.