OpenAI Image Generation API — GPT-Image-2 Reference
Overview of image generation APIs on APIMaster.ai. Use the OpenAI-compatible images endpoint with GPT-Image-2 for text-to-image, image editing, and async generation tasks at up to 70% off.
Image generation overview
Image APIs live under https://apimaster.ai/v1. Documented models:
| Model | Description | Doc |
|---|---|---|
gpt-image-2 |
Unified model; auto-routes by params (mask, quality, n>1) | GPT-Image-2 |
gemini-3.1-flash-image-preview |
Google Gemini text/image-to-image, up to 4K | Gemini 3.1 Flash Image |
Conventions
- Auth:
Authorization: Bearer YOUR_API_KEY(get key) - Submit:
POST https://apimaster.ai/v1/images/generations→task_id - Poll:
GET https://apimaster.ai/v1/tasks/{task_id}(wait 10–20s before first poll, then every 3–5s)
Quick example
curl -s "https://apimaster.ai/v1/images/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "An orange cat watching sunset, watercolor",
"size": "16:9",
"resolution": "2k"
}'