curl https://api.vibetool.ai/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A serene mountain lake at sunset, with pine trees reflected in the water.",
"n": 1,
"size": "1024x1024"
}'
import requests
url = "https://api.vibetool.ai/v1/images/generations"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"model": "gpt-image-2",
"prompt": "A serene mountain lake at sunset, with pine trees reflected in the water.",
"n": 1,
"size": "1024x1024"
}
response = requests.post(url, json=payload, headers=headers, timeout=30)
print(response.json())
const response = await fetch("https://api.vibetool.ai/v1/images/generations", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "gpt-image-2",
prompt: "A serene mountain lake at sunset, with pine trees reflected in the water.",
n: 1,
size: "1024x1024"
})
});
const data = await response.json();
console.log(data);
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"time"
)
func main() {
url := "https://api.vibetool.ai/v1/images/generations"
payload := map[string]interface{}{
"model": "gpt-image-2",
"prompt": "A serene mountain lake at sunset, with pine trees reflected in the water.",
"n": 1,
"size": "1024x1024",
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}
{
"task_id": "img_202608111530_a1b2c3d4",
"status": "pending",
"message": "Task created",
"created_at": 1715001234
}
GPT Image 2
Generate high‑fidelity images with GPT Images 2.0 by OpenAI. Input text and images; receive detailed, custom visuals.
curl https://api.vibetool.ai/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A serene mountain lake at sunset, with pine trees reflected in the water.",
"n": 1,
"size": "1024x1024"
}'
import requests
url = "https://api.vibetool.ai/v1/images/generations"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"model": "gpt-image-2",
"prompt": "A serene mountain lake at sunset, with pine trees reflected in the water.",
"n": 1,
"size": "1024x1024"
}
response = requests.post(url, json=payload, headers=headers, timeout=30)
print(response.json())
const response = await fetch("https://api.vibetool.ai/v1/images/generations", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "gpt-image-2",
prompt: "A serene mountain lake at sunset, with pine trees reflected in the water.",
n: 1,
size: "1024x1024"
})
});
const data = await response.json();
console.log(data);
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"time"
)
func main() {
url := "https://api.vibetool.ai/v1/images/generations"
payload := map[string]interface{}{
"model": "gpt-image-2",
"prompt": "A serene mountain lake at sunset, with pine trees reflected in the water.",
"n": 1,
"size": "1024x1024",
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}
{
"task_id": "img_202608111530_a1b2c3d4",
"status": "pending",
"message": "Task created",
"created_at": 1715001234
}
gpt-image-2Author: OpenAI
Input modalities: Image, Text
Output modality: Image
API Usage
Send aPOST request to https://api.vibetool.ai/v1/images/generations with the model gpt-image-2.
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.curl https://api.vibetool.ai/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A serene mountain lake at sunset, with pine trees reflected in the water.",
"n": 1,
"size": "1024x1024"
}'
import requests
url = "https://api.vibetool.ai/v1/images/generations"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"model": "gpt-image-2",
"prompt": "A serene mountain lake at sunset, with pine trees reflected in the water.",
"n": 1,
"size": "1024x1024"
}
response = requests.post(url, json=payload, headers=headers, timeout=30)
print(response.json())
const response = await fetch("https://api.vibetool.ai/v1/images/generations", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "gpt-image-2",
prompt: "A serene mountain lake at sunset, with pine trees reflected in the water.",
n: 1,
size: "1024x1024"
})
});
const data = await response.json();
console.log(data);
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"time"
)
func main() {
url := "https://api.vibetool.ai/v1/images/generations"
payload := map[string]interface{}{
"model": "gpt-image-2",
"prompt": "A serene mountain lake at sunset, with pine trees reflected in the water.",
"n": 1,
"size": "1024x1024",
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}
{
"task_id": "img_202608111530_a1b2c3d4",
"status": "pending",
"message": "Task created",
"created_at": 1715001234
}
Polling for the result
curl https://api.vibetool.ai/v1/images/status/img_202608111530_a1b2c3d4 \
-H "Authorization: Bearer YOUR_API_KEY"
{
"task_id": "img_202608111530_a1b2c3d4",
"status": "completed",
"progress": 100,
"images": [
{ "url": "https://files.vibetool.ai/outputs/img_202608111530_a1b2c3d4.png" }
]
}
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
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Must be "gpt-image-2". |
prompt | string | Yes | A text description of the desired image. |
n | integer | No | Number of images to generate, 1–10 (default 1). |
size | string | No | Output size, e.g. "1024x1024" (default). |
quality | string | No | Output quality tier. Affects pricing — see vibetool.ai/pricing. |
image_urls | array of strings | No | Reference image URLs for image-to-image / editing. Up to 10. |
callback_url | string | No | HTTPS URL called when the task completes, so you can skip polling. |
options | object | No | Extra passthrough parameters (e.g. negative_prompt, seed). |
image_urls — not as a single
image field. Base64 payloads and inpainting masks are not supported.Authorizations
All APIs require Bearer Token authentication. Get your API Key from the dashboard and add to request header: Authorization: Bearer YOUR_API_KEY
Body
Image generation model name. Use gpt-image-2 for this endpoint.
gpt-image-2 "gpt-image-2"
Text description of the image to generate, or instructions for editing the input image. Maximum 2000 tokens.
2000"A beautiful colorful sunset over the ocean"
Async mode flag. Must be true (fixed value, cannot be changed).
true true
Size of the generated image. Supports two formats: Aspect Ratio (1:1, 2:3, 3:2) or Pixel Format (1024x1024, 1024x1536, 1536x1024).
1:1, 2:3, 3:2, 1024x1024, 1024x1536, 1536x1024 "1024x1024"
Quality of the generated image. Options: low (faster), medium (balanced), high (slower).
low, medium, high "high"
Number of images to generate. Currently only supports 1.
1 1
Reference image URL list for image-to-image and image editing functions. Maximum 16 images, each under 50MB. Supported formats: .jpeg, .jpg, .png, .webp.
16["https://example.com/reference-image.png"]
HTTPS callback address triggered when task is completed, failed, or cancelled. Only HTTPS protocol supported. Maximum 2048 characters.
2048"https://your-domain.com/webhooks/image-task-completed"
Response
Image generation task created successfully
Unique task identifier for status polling
"img_202512301327_4d50e7c6"
Initial task status
pending, processing, completed, failed "pending"
Optional status message
null
Unix timestamp of task creation
1767072426
Was this page helpful?