AI Image 2 API
Integrate GPT Image 2.0 image generation and reference-based editing. This documentation covers authentication, the generate and status endpoints, request limits, and billing.
https://gptimage2-ai.comQuick Start
Complete your first API call in just two steps: submit a generation task, then poll for status.
Submit Task
Send a POST request to the generate endpoint to get a Task ID.
Query Status
Use the Task ID to check progress until you get the image URL.
Authentication
Note: Please keep your API Key secure and do not expose it in client-side code.
Authorization: Bearer {YOUR_API_KEY}/api/generateCreate a new image generation or reference-edit task. This endpoint is asynchronous and returns a task_id plus initial status; call /api/status to retrieve the final images.
Body Parameters
| Parameter Name | Type | Required | Description |
|---|---|---|---|
prompt | string | Conditional | Text prompt describing the image to create (max 20000 characters). Required when images is empty. |
images | string[] | No | Optional array of reference image URLs for editing or recombination instead of pure text-to-image. |
aspect_ratio | string | No | Output aspect ratio. Allowed values: auto, 1:1, 5:4, 9:16, 21:9, 16:9, 4:3, 3:2, 4:5, 3:4, 2:3. |
resolution | string | No | Output resolution: 1K (default), 2K, or 4K. 5:4 and 4:5 only support 1K; 1:1 does not support 4K. |
{
"code": 200,
"message": "success",
"data": {
"task_id": "task_1234567890",
"status": "IN_PROGRESS"
}
}/api/statusQuery the execution status and results of a task.
Query Parameters
| Parameter Name | Required | Description |
|---|---|---|
task_id | Yes | The ID returned when submitting the task. |
{
"code": 200,
"message": "success",
"data": {
"status": "SUCCESS",
"task_id": "xxxxxxxx",
"request": {
"prompt": "A beautiful sunset over mountains",
"aspect_ratio": "16:9"
},
"response": [
"https://cdn.example.com/images/task_xxx_0"
],
"consumed_credits": 10,
"created_at": "2025-12-05 13:05:09",
"error_message": null
}
}Billing
Cost per image
Failed tasks are not charged. Other models on this site use their own credit rates.
Error Handling
401 UnauthorizedInvalid API Key402 Payment RequiredInsufficient balance429 Too Many RequestsRate limit triggered
About GPT Image 2.0
GPT Image 2.0 is the image model that powers AI Image 2. AI Image 2 is an independent service and is not affiliated with, endorsed by, or sponsored by OpenAI.
GPT Image 2.0 — prompt-accurate generation with readable in-image text
GPT Image 2.0 follows detailed instructions closely, renders legible text inside images, and accepts reference photos so you can edit an existing picture instead of starting from nothing.
Built for typography, layouts, and reference edits
The model holds up on posters, infographics, and UI mockups where words must stay readable, and it preserves a subject across style or background changes when reference images are provided.
What it is good at
- Readable in-image text — renders headlines, labels, and short slogans inside posters and infographics.
- Reference-based editing — pass one or more image URLs to restyle or recompose an existing photo while keeping the subject.
- Structured layouts — handles multi-element compositions such as menus, flyers, and storyboards with ordered panels.
- 1K to 4K output — choose 1K, 2K, or 4K; 4K is unavailable at 1:1, and 5:4 / 4:5 only render at 1K.
- Eleven aspect ratios — auto, 1:1, 5:4, 9:16, 21:9, 16:9, 4:3, 3:2, 4:5, 3:4, and 2:3.
- Flat pricing — every image costs 10 credits, charged only when the task succeeds.
How to use
promptprompt – natural-language description; include the exact words you want rendered (max 20000 characters).imagesimages – optional array of reference image URLs; the model edits or recombines them.resolutionresolution – 1K (default), 2K, or 4K; every size costs the same 10 credits.