GPT-Image-2.5 VIP Image Generation and Editing
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"quality": "<string>",
"size": "<string>",
"background": "<string>",
"n": 123
}
'import requests
url = "https://toapis.com/v1/images/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"quality": "<string>",
"size": "<string>",
"background": "<string>",
"n": 123
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
quality: '<string>',
size: '<string>',
background: '<string>',
n: 123
})
};
fetch('https://toapis.com/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://toapis.com/v1/images/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'prompt' => '<string>',
'quality' => '<string>',
'size' => '<string>',
'background' => '<string>',
'n' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://toapis.com/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"quality\": \"<string>\",\n \"size\": \"<string>\",\n \"background\": \"<string>\",\n \"n\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://toapis.com/v1/images/generations")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"quality\": \"<string>\",\n \"size\": \"<string>\",\n \"background\": \"<string>\",\n \"n\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"quality\": \"<string>\",\n \"size\": \"<string>\",\n \"background\": \"<string>\",\n \"n\": 123\n}"
response = http.request(request)
puts response.read_bodyGPT-Image-2.5 VIP
GPT-Image-2.5 VIP Image Generation and Editing
Async task guide for gpt-image-2.5-flare-vip and gpt-image-2.5-sunburst-vip, with five quality levels, pixel dimensions, transparent backgrounds, and postpaid billing by actual token usage
POST
/
v1
/
images
/
generations
GPT-Image-2.5 VIP Image Generation and Editing
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"quality": "<string>",
"size": "<string>",
"background": "<string>",
"n": 123
}
'import requests
url = "https://toapis.com/v1/images/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"quality": "<string>",
"size": "<string>",
"background": "<string>",
"n": 123
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
quality: '<string>',
size: '<string>',
background: '<string>',
n: 123
})
};
fetch('https://toapis.com/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://toapis.com/v1/images/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'prompt' => '<string>',
'quality' => '<string>',
'size' => '<string>',
'background' => '<string>',
'n' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://toapis.com/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"quality\": \"<string>\",\n \"size\": \"<string>\",\n \"background\": \"<string>\",\n \"n\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://toapis.com/v1/images/generations")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"quality\": \"<string>\",\n \"size\": \"<string>\",\n \"background\": \"<string>\",\n \"n\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"quality\": \"<string>\",\n \"size\": \"<string>\",\n \"background\": \"<string>\",\n \"n\": 123\n}"
response = http.request(request)
puts response.read_bodyThe VIP tier creates an image task through
Create an API Key in the ToAPIs console.
Example submit response:
Save the returned
A task moves through
The task is queried by task ID as usual; read the image URL from
Let curl set the multipart Content-Type and boundary automatically. Poll the status endpoint with the returned task ID and read the edited image URL from
All five quality levels share these token unit prices. VIP has no fixed per-image price tied to quality; the task is settled by actual usage after it completes. Submitting a task pre-authorizes an amount, and the final charge is settled from the actual text and image tokens after completion, with any difference refunded or charged. You still need sufficient account balance and API Key quota before calling.
Cost formula, in USD:
For example, a
One measured reference image edit contained 21 text input tokens, 1024 image input tokens, and 196 image output tokens. The formula gives 0.0113416,whichischargedas0.011342 after rounding to the smallest platform quota unit. These are examples for specific requests and do not represent a fixed cost per image at the same quality.
Account-specific pricing or discounts may differ; check the model pricing page and your account configuration for the latest prices. You can verify the final charge in the usage logs.
POST /v1/images/generations and returns a task ID. After the task finishes, retrieve the image URL through the status endpoint. Like the standard tier, the VIP tier runs as an async task; the differences are the model names, the size format, and the billing model.
| Model | model in the request |
|---|---|
| Flare VIP | gpt-image-2.5-flare-vip |
| Sunburst VIP | gpt-image-2.5-sunburst-vip |
gpt-image-2.5-vip is the series name used in this document. Always pass the full model name from the table.
The standard tier also runs as an async task, but it is priced by resolution and uses ratio values for
size; see the separate GPT-Image-2.5 documentation. The VIP tier uses pixel dimensions and settles by actual token usage.Note for users in mainland China: Please use
https://toapis.cn as the API endpoint (Base URL). Replace https://toapis.com with https://toapis.cn in the examples in this document.Quick Start
Set your API Key as theTOAPIS_API_KEY environment variable, then submit the task:
curl --fail-with-body --request POST \
--url https://toapis.com/v1/images/generations \
--header "Authorization: Bearer $TOAPIS_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2.5-flare-vip",
"prompt": "Children's picture book style, a veterinarian listening to a baby otter's heartbeat with a stethoscope",
"quality": "low",
"size": "1024x1024",
"n": 1
}'
{
"id": "tsk_img_example",
"object": "generation.task",
"model": "gpt-image-2.5-flare-vip",
"status": "pending",
"progress": 0,
"created_at": 1788951900,
"metadata": {}
}
id, replace TASK_ID below with that value, and query the result:
curl --fail-with-body \
--url https://toapis.com/v1/images/generations/TASK_ID \
--header "Authorization: Bearer $TOAPIS_API_KEY"
pending, queued, and in_progress, and finally reaches completed or failed. On completed, read the image URL from result.data; on failed, read error. Poll every few seconds. The full set of fields is documented in Image Task Status.
A successful submit only means the task was created. Wait until completed before downloading the image, and keep polling the same task ID while you wait. High-quality requests take longer, so keep polling instead of resubmitting.
Generation Request Parameters
string
required
Authenticate with
Bearer YOUR_TOAPIS_API_KEY.string
required
gpt-image-2.5-flare-vip or gpt-image-2.5-sunburst-vip.string
required
Description of the image. When editing, describe what to keep and what to change.
string
default:"high"
Five levels are supported:
low, medium, high, xhigh, and max. The default is high. Use lowercase values.Quality affects the generation result and the actual output tokens. Images with the same quality can still cost different amounts depending on dimensions and content.string
default:"1024x1024"
Output pixel dimensions in
widthxheight format, for example 1024x1024, 1536x1024, 1024x1536, 1280x1024.Custom pixel dimensions allowed by the upstream provider are supported, not only the examples above. The valid size range is enforced by the endpoint validation. VIP examples do not use ratio values such as 1:1, and no separate resolution is required.string
Optional background setting. Set
"transparent" to generate an image with a transparent background. Omit this field for normal image generation.Works with both text-to-image requests and reference image editing.integer
default:1
Use
1 per request to generate one image.Transparent Background
Add"background": "transparent" to the generation request to get an image with a transparent background. Omit the field for normal generation.
curl --fail-with-body --request POST \
--url https://toapis.com/v1/images/generations \
--header "Authorization: Bearer $TOAPIS_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2.5-flare-vip",
"prompt": "A red circular sticker on a transparent background",
"quality": "low",
"size": "1024x1024",
"background": "transparent",
"n": 1
}'
result.data.
Reference Image Editing
Editing usesPOST /v1/images/edits with a multipart/form-data request. Put the local image in the image file field and pass model, prompt, quality, size, and n alongside it. Editing is also an async task: the submit returns a task ID, and you query the result the same way as generation.
The example below uses Sunburst VIP to add a yellow scarf to the baby otter in otter.png:
curl --fail-with-body --request POST \
--url https://toapis.com/v1/images/edits \
--header "Authorization: Bearer $TOAPIS_API_KEY" \
--form 'model=gpt-image-2.5-sunburst-vip' \
--form 'prompt=Keep the baby otter and the veterinarian from the original image, and add a yellow scarf to the baby otter' \
--form 'image=@otter.png;type=image/png' \
--form 'quality=low' \
--form 'size=1024x1024' \
--form 'n=1'
result.data.
Flare VIP supports the same editing approach; change the model to gpt-image-2.5-flare-vip. Reference image input incurs image input token costs.
Token Pricing
The prices below are standard prices verified on 2026-09-09. Both VIP models are the same and are billed at 20% off the official token unit prices:| Type | USD per million tokens |
|---|---|
| Text input | 4.00 |
| Cached text input | 1.00 |
| Image input | 6.40 |
| Cached image input | 1.60 |
| Image output | 24.00 |
cost = (
uncached text input tokens * 4
+ cached text input tokens * 1
+ uncached image input tokens * 6.4
+ cached image input tokens * 1.6
+ image output tokens * 24
) / 1,000,000
low quality 1024x1024 text-to-image request with 27 text input tokens and 196 image output tokens costs:
(27 * 4 + 196 * 24) / 1,000,000 = $0.004812
Switching from the Standard Tier
- Change the full model name to the matching
-vipmodel name. - Change
sizefrom a ratio to pixel dimensions, and omitresolution. - For both text-to-image and reference image editing, poll the result by task ID and read the image URL from
result.data. - For reference image editing, switch to
/v1/images/editsand upload the image file. - Estimate cost from actual tokens.