Skip to main content
POST
Pricing: See vibetool.ai/pricing for current rates.
Model ID: gpt-image-2
Author: OpenAI
Input modalities: Image, Text
Output modality: Image
GPT Images 2.0 brings an unprecedented level of specificity and fidelity to image creation. This model can take an optional reference image and a text prompt to produce a coherent, high‑resolution image.

API Usage

Send a POST request to https://api.vibetool.ai/v1/images/generations with the model gpt-image-2.
Image generation is asynchronous. The request returns a task_id immediately — it does not return the image inline. Poll Get Image Result until status is completed, then read the URLs from the images array. Passing async_mode: false returns 400; synchronous mode is not supported.

Polling for the result

status is one of pending, processing, completed, failed. Poll every few seconds until it reaches completed or failed. Supply callback_url in the create request if you would rather be notified than poll.

Parameters

Reference images are passed as an array of URLs in image_urls — not as a single image field. Base64 payloads and inpainting masks are not supported.

Authorizations

Authorization
string
header
required

All APIs require Bearer Token authentication. Get your API Key from the dashboard and add to request header: Authorization: Bearer YOUR_API_KEY

Body

application/json
model
enum<string>
default:gpt-image-2
required

Image generation model name. Use gpt-image-2 for this endpoint.

Available options:
gpt-image-2
Example:

"gpt-image-2"

prompt
string
required

Text description of the image to generate, or instructions for editing the input image. Maximum 2000 tokens.

Maximum string length: 2000
Example:

"A beautiful colorful sunset over the ocean"

async_mode
enum<boolean>
default:true
required

Async mode flag. Must be true (fixed value, cannot be changed).

Available options:
true
Example:

true

size
enum<string>

Size of the generated image. Supports two formats: Aspect Ratio (1:1, 2:3, 3:2) or Pixel Format (1024x1024, 1024x1536, 1536x1024).

Available options:
1:1,
2:3,
3:2,
1024x1024,
1024x1536,
1536x1024
Example:

"1024x1024"

quality
enum<string>
default:medium

Quality of the generated image. Options: low (faster), medium (balanced), high (slower).

Available options:
low,
medium,
high
Example:

"high"

n
enum<integer>
default:1

Number of images to generate. Currently only supports 1.

Available options:
1
Example:

1

image_urls
string<uri>[]

Reference image URL list for image-to-image and image editing functions. Maximum 16 images, each under 50MB. Supported formats: .jpeg, .jpg, .png, .webp.

Maximum array length: 16
Example:
callback_url
string<uri>

HTTPS callback address triggered when task is completed, failed, or cancelled. Only HTTPS protocol supported. Maximum 2048 characters.

Maximum string length: 2048
Example:

"https://your-domain.com/webhooks/image-task-completed"

Response

Image generation task created successfully

task_id
string

Unique task identifier for status polling

Example:

"img_202512301327_4d50e7c6"

status
enum<string>

Initial task status

Available options:
pending,
processing,
completed,
failed
Example:

"pending"

message
string | null

Optional status message

Example:

null

created_at
integer

Unix timestamp of task creation

Example:

1767072426