GPT-Image-2.5 VIP 이미지 생성과 편집
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 이미지 생성과 편집
gpt-image-2.5-flare-vip 와 gpt-image-2.5-sunburst-vip 비동기 이미지 작업 연동 가이드로, 5단계 품질, 픽셀 크기, 투명 배경과 실제 token 기준 후불 과금을 다룹니다
POST
/
v1
/
images
/
generations
GPT-Image-2.5 VIP 이미지 생성과 편집
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_bodyVIP 버전은
API Key 는 콘솔 에서 생성할 수 있습니다.
제출 응답 예시:
반환된
작업은
완료 후에는 평소처럼 작업 ID로 조회하고
curl 이 multipart 의 Content-Type 과 boundary 를 자동으로 설정하도록 하세요. 응답의 작업 ID로 조회 API를 폴링하고
5단계 quality 는 위 token 단가를 공유합니다. VIP 에는 quality 별 고정 장당 가격이 없으며 작업이 완료된 뒤 실제 사용량으로 정산됩니다. 작업을 제출하면 먼저 금액이 선차감되고, 완료 후 실제 텍스트와 이미지 token 으로 정산하며 차액은 환불되거나 추가 청구됩니다. 호출 전에도 충분한 계정 잔액과 API Key 한도가 필요합니다.
비용 공식은 USD 기준입니다:
예를 들어
한 번의 참조 이미지 편집 실측에는 텍스트 입력 token 21개, 이미지 입력 token 1024개, 이미지 출력 token 196개가 포함되었습니다. 공식 금액은 0.0113416이며플랫폼한도의최소단위로반올림한뒤실제차감은0.011342 입니다. 이는 특정 요청의 예시이며 같은 품질에서 장당 고정 비용을 의미하지 않습니다.
계정별 전용 가격이나 할인은 다를 수 있으며 최신 가격은 모델 가격 페이지 와 계정 실제 설정을 기준으로 하세요. 최종 차감 내역은 사용 로그에서 확인할 수 있습니다.
POST /v1/images/generations 로 이미지 작업을 생성하고 작업 ID를 반환합니다. 작업이 완료되면 조회 API로 이미지 URL을 가져옵니다. VIP 버전과 일반 버전의 공통점은 둘 다 비동기 작업을 사용한다는 것이며, 차이는 모델명, size 형식과 과금 방식입니다.
| 모델 | 요청의 model |
|---|---|
| Flare VIP | gpt-image-2.5-flare-vip |
| Sunburst VIP | gpt-image-2.5-sunburst-vip |
gpt-image-2.5-vip 는 문서상의 시리즈 이름입니다. 호출할 때는 표의 전체 모델명을 사용하세요.
일반 버전도 비동기 작업을 사용하지만 해상도 기준으로 과금하고 비율 형식의 size 를 사용합니다. 별도의 GPT-Image-2.5 문서 를 확인하세요. VIP 버전은 픽셀 크기를 사용하고 실제 token 기준으로 정산합니다.
중국 본토 사용자 안내: 중국 본토 사용자는
https://toapis.cn 를 API 엔드포인트(Base URL)로 사용해 주세요. 본 문서의 예시에서 https://toapis.com 을 https://toapis.cn 로 바꿔 주세요.빠른 시작
자신의 API Key 를 환경 변수TOAPIS_API_KEY 로 설정한 뒤 작업을 제출하세요:
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 를 저장하고 아래의 TASK_ID 를 해당 값으로 바꾼 뒤 조회하세요:
curl --fail-with-body \
--url https://toapis.com/v1/images/generations/TASK_ID \
--header "Authorization: Bearer $TOAPIS_API_KEY"
pending, queued, in_progress 를 거쳐 최종적으로 completed 또는 failed 가 됩니다. completed 이면 result.data 에서 이미지 URL을 읽고, failed 이면 error 를 읽습니다. 몇 초마다 한 번씩 조회하는 것을 권장합니다. 전체 필드는 이미지 작업 상태 조회 를 참고하세요.
제출 성공은 작업이 생성되었음을 의미합니다. completed 가 된 뒤에 이미지를 다운로드하고, 대기하는 동안에는 같은 작업 ID를 계속 조회하세요. 고품질 요청은 시간이 더 오래 걸리므로 폴링을 계속하고 작업을 중복 제출하지 마세요.
생성 요청 파라미터
string
필수
Bearer YOUR_TOAPIS_API_KEY 로 인증합니다.string
필수
gpt-image-2.5-flare-vip 또는 gpt-image-2.5-sunburst-vip.string
필수
이미지 설명입니다. 편집할 때는 유지할 내용과 수정할 내용을 설명하세요.
string
기본값:"high"
low, medium, high, xhigh, max 5단계를 지원하며 기본값은 high 입니다. 소문자 값을 사용하세요.quality 는 생성 품질과 실제 출력 token 에 영향을 줍니다. 같은 quality 라도 이미지 크기와 내용에 따라 비용이 달라질 수 있습니다.string
기본값:"1024x1024"
출력 픽셀 크기로
가로x세로 형식을 사용합니다. 예: 1024x1024, 1536x1024, 1024x1536, 1280x1024.위 예시에 한정되지 않고 업스트림이 허용하는 사용자 지정 픽셀 크기를 지원합니다. 유효한 크기 범위는 API 검증을 기준으로 합니다. VIP 예시는 1:1 같은 비율 값을 사용하지 않고 resolution 을 추가로 전달할 필요도 없습니다.string
선택적 배경 매개변수입니다.
"transparent"를 지정하면 투명 배경 이미지를 생성합니다. 생략하면 일반 이미지를 생성합니다.텍스트 기반 생성과 참조 이미지 편집 모두에 사용할 수 있습니다.integer
기본값:1
요청당
1 을 사용해 이미지 한 장을 생성합니다.투명 배경
생성 요청에"background": "transparent"를 추가하면 투명 배경 이미지를 받을 수 있습니다. 생략하면 일반 생성이 됩니다.
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": "투명 배경의 빨간 원형 스티커",
"quality": "low",
"size": "1024x1024",
"background": "transparent",
"n": 1
}'
result.data에서 이미지 URL을 읽습니다.
참조 이미지 편집
편집은POST /v1/images/edits 를 사용하며 요청은 multipart/form-data 입니다. 로컬 이미지를 image 파일 필드에 넣고 model, prompt, quality, size, n 을 함께 전달하세요. 편집도 비동기 작업이므로 제출 후 작업 ID를 반환하며, 조회 방식은 생성과 같습니다.
아래 예시는 Sunburst VIP 로 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 에서 편집된 이미지 URL을 읽으세요.
Flare VIP 도 같은 편집 방식을 지원하며 model 을 gpt-image-2.5-flare-vip 로 바꾸면 됩니다. 참조 이미지 입력은 이미지 입력 token 비용을 발생시킵니다.
token 가격
아래는 2026-09-09 기준으로 확인한 표준 가격이며 두 VIP 모델이 동일하고 공식 token 단가의 80% 로 청구됩니다:| 유형 | USD/백만 token |
|---|---|
| 텍스트 입력 | 4.00 |
| 캐시된 텍스트 입력 | 1.00 |
| 이미지 입력 | 6.40 |
| 캐시된 이미지 입력 | 1.60 |
| 이미지 출력 | 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 품질의 1024x1024 텍스트-이미지 생성이 텍스트 입력 token 27개와 이미지 출력 token 196개를 포함할 때 비용은 다음과 같습니다:
(27 * 4 + 196 * 24) / 1,000,000 = $0.004812
일반 버전에서 전환
- 전체 모델명을 해당
-vip모델명으로 바꿉니다. - size 를 비율에서 픽셀 크기로 바꾸고 resolution 을 생략합니다.
- 텍스트-이미지 생성과 참조 이미지 편집 모두 작업 ID로 결과를 폴링하고
result.data에서 이미지 URL을 읽습니다. - 참조 이미지 편집은
/v1/images/edits로 이미지 파일을 업로드하도록 변경합니다. - 실제 token 으로 비용을 예측합니다.