Image models
GPT Image 2
On this page
GPT Image 2 — fast, high-fidelity AI image generation & editing.
| modelId | gpt-image-2-text-to-image |
| Modality | image |
| Pricing | See this model on the Pricing page for the current per-call price (with your markup). |
Operations
| Operation | Endpoint | Description |
|---|---|---|
| Text to image | POST /api/v1/generate | Base generation from a text prompt. |
| Poll task | GET /api/v1/task/{id}?model=gpt-image-2-text-to-image | Retrieve state and result URLs. |
Input parameters
| Field | Type | Required | Values / example |
|---|---|---|---|
| prompt | textarea | required | Enter your text here... |
| aspect_ratio | select | optional | auto, 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 2:1, 1:2, 3:1, 1:3, 21:9, 9:21, 5:4, 4:5 |
| resolution | select | optional | 1K, 2K, 4K |
Example request
bash
curl -X POST https://you.bot/api/v1/generate \
-H "Authorization: Bearer $YOUBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"modelId":"gpt-image-2-text-to-image","input":{"prompt":"A vintage brass diving helmet overgrown with coral and tiny anemones, resting on pale sand in slanting shafts of turquoise underwater light.","aspect_ratio":"auto","resolution":"1K"}}'