GPT Image 2.5
ID:
openai/gpt-image-2.5GPT Image 2.5 image generation API by OpenAI — Flare and Sunburst versions with up to 4K output, 13 aspect ratios, and reference-image editing.
GPT Image 2.5ChatGPT Images 2.5OpenAIImage EditingInpainting
Overview
GPT Image 2.5 image generation API by OpenAI — Flare and Sunburst versions with up to 4K output, 13 aspect ratios, and reference-image editing.
Authentication
All API requests require a valid API key passed via the Authorization header using the Bearer scheme.
Quickstart
Credentials
Set the RUNBASE_API_KEY environment variable.
Shell
export RUNBASE_API_KEY=your-api-keyCreate a run
Shell
curl -s https://runbase.net/api/v1/runs \
-H "Authorization: Bearer $RUNBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-image-2.5",
"input": {
"prompt": "A cinematic product photo of a ceramic lamp"
}
}'Runs
Runs are processed asynchronously. Submit a request, then poll for the result.
Create a run
Shell
curl -s https://runbase.net/api/v1/runs \
-H "Authorization: Bearer $RUNBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-image-2.5",
"input": { "prompt": "A cinematic product photo of a ceramic lamp" }
}'Get run status
Shell
curl -s https://runbase.net/api/v1/runs/RUN_ID \
-H "Authorization: Bearer $RUNBASE_API_KEY"Get result
Poll the status endpoint until status is "succeeded", then read output.urls from the response.
Input Schema
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Required | PromptUp to 20000 characters |
| variant | string | Optional | VersionOptions: flaresunburstDefault: flare |
| aspect_ratio | string | Optional | Aspect ratioOptions: auto1:13:22:316:99:164:33:421:927:1616:279:88:9Default: auto |
| resolution | string | Optional | ResolutionOptions: 1K2K4KDefault: 1K |
| image_urls | string[] | Optional | Reference imagesUp to 16 images |
Output Schema
| Field | Type | Description |
|---|---|---|
| urls | string[] | Generated output URLs |
Errors
The API uses standard HTTP status codes to indicate success or failure.
| Status Code | Description |
|---|---|
| 400 | 無效請求 - 缺少或格式錯誤的參數 |
| 401 | 驗證失敗 - 缺少或無效的 API 金鑰 |
| 402 | 點數不足 |
| 403 | 禁止存取 - IP 不被允許、帳號被封禁或 API 金鑰消費上限已超過 |
| 404 | 找不到執行紀錄 |
| 429 | 超過速率限制 |
| 500 | 內部伺服器錯誤 |

