GPT-Image-2.5 공식 채널 이미지 생성
curl --request POST \
--url https://api.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://api.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://api.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://api.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://api.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://api.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://api.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
GPT-Image-2.5 공식 채널 이미지 생성
Sunburst 및 Flare 비동기 이미지 작업, R2 결과 저장, 공식 요금의 80% 토큰 과금
POST
/
v1
/
images
/
generations
GPT-Image-2.5 공식 채널 이미지 생성
curl --request POST \
--url https://api.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://api.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://api.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://api.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://api.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://api.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://api.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_bodyAzure 공식 채널을 통해 두 GPT-Image-2.5 모델을 호출합니다. 요청을 제출하면 비동기 작업 ID가 즉시 반환됩니다. 백그라운드에서 이미지를 생성하고 결과를 R2에 저장한 후 제공합니다.
표에 있는 전체 모델 이름을 사용하세요.
제출 응답의
제출 응답 상태는
제출 시 할당량을 먼저 예약하고 성공 후 업스트림의 실제 텍스트 및 이미지 토큰 사용량에 따라 차액을 정산합니다. 다섯 품질 단계에 같은 단가가 적용되며 품질별 고정 장당 가격은 없습니다. 제출 전에 충분한 계정 잔액과 API Key 할당량이 필요합니다.
USD 단위 요금 공식:
예를 들어 캐시되지 않은 텍스트 입력 17 tokens와 이미지 출력 196 tokens의 요금은
| 모델 | model |
|---|---|
| Sunburst Official | gpt-image-2.5-sunburst-official |
| Flare Official | gpt-image-2.5-flare-official |
gpt-image-2.5-official은 시리즈 이름이며 요청의 model 값으로 사용할 수 없습니다.
중국 본토에서는 https://api.toapis.com을 https://api.toapis.cn으로 바꾸세요. 콘솔에서 API Key를 만들고 TOAPIS_API_KEY 환경 변수에 설정하세요.
제출 및 조회
Flare 이미지 한 장을 제출합니다. Sunburst를 호출하려면 model 값을 바꾸세요:curl --fail-with-body --request POST \
--url https://api.toapis.com/v1/images/generations \
--header "Authorization: Bearer $TOAPIS_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2.5-flare-official",
"prompt": "A small blue circle on a plain white background",
"quality": "low",
"size": "1024x1024",
"n": 1
}'
{
"id": "tsk_img_example",
"object": "generation.task",
"model": "gpt-image-2.5-flare-official",
"status": "pending",
"progress": 0,
"created_at": 1789099098,
"metadata": {}
}
id를 저장하고 아래 TASK_ID를 해당 값으로 바꾸세요:
curl --fail-with-body \
--url https://api.toapis.com/v1/images/generations/TASK_ID \
--header "Authorization: Bearer $TOAPIS_API_KEY"
pending입니다. 조회 시 queued 또는 in_progress를 거쳐 completed 또는 failed가 됩니다. completed이면 result.data[].url에서 R2 이미지 URL을 가져오고, failed이면 error를 확인하세요. 몇 초 간격으로 같은 작업 ID를 조회하세요. 고품질 생성은 몇 분 걸릴 수 있으므로 중복 제출하지 말고 조회를 계속하세요. 전체 필드는 이미지 작업 상태 API를 참고하세요.
요청 매개변수
string
필수
ToAPIs API Key를
Bearer YOUR_API_KEY 형식으로 사용합니다. Azure 자격 증명은 필요하지 않습니다.string
필수
gpt-image-2.5-sunburst-official / gpt-image-2.5-flare-official.string
필수
생성할 이미지를 설명합니다. 참조 이미지를 사용할 때는 유지하거나 변경할 내용을 설명하세요.
string
기본값:"high"
low, medium, high, xhigh, max를 지원합니다. 품질과 크기는 실제 토큰 사용량과 처리 시간에 영향을 줍니다.string
기본값:"1024x1024"
1024x1024, 1536x1024, 1024x1536 같은 픽셀 크기를 사용하세요. 사용자 지정 크기는 업스트림 검증을 통과해야 합니다. 이 예제에는 별도의 resolution 필드가 필요하지 않습니다.string
선택 사항입니다. 투명 배경을 요청하려면
transparent를 지정하세요. 생략하면 업스트림 기본값을 사용합니다. 기본 PNG 출력은 투명도를 유지할 수 있습니다.integer
기본값:1
현재 공식 채널은 요청당 이미지 한 장을 생성합니다.
1을 사용하세요.참조 이미지 URL
이미지 기반 생성에는 같은 JSON 생성 요청에image_urls를 추가하세요. URL은 서버에서 접근할 수 있어야 합니다. 이미지 업로드 API로 URL을 얻을 수 있습니다. 참조 이미지에는 이미지 입력 토큰 요금이 발생합니다. 제출과 조회는 같은 비동기 흐름을 사용합니다.
curl --fail-with-body --request POST \
--url https://api.toapis.com/v1/images/generations \
--header "Authorization: Bearer $TOAPIS_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2.5-sunburst-official",
"prompt": "Keep the subject and replace the background with a snowy forest",
"image_urls": ["https://example.com/reference.png"],
"quality": "high",
"size": "1024x1024",
"n": 1
}'
토큰 요금
2026-09-11에 확인한 표준 요금입니다. 두 공식 모델 모두 공식 토큰 요금의 80%, 즉 20% 할인된 가격으로 과금됩니다:| 유형 | USD / 1,000,000 tokens |
|---|---|
| 텍스트 입력 | 4.00 |
| 캐시된 텍스트 입력 | 1.00 |
| 이미지 입력 | 6.40 |
| 캐시된 이미지 입력 | 1.60 |
| 이미지 출력 | 24.00 |
USD = (
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
(17 * 4 + 196 * 24) / 1,000,000 = $0.004772입니다. 이미지 한 장당 고정 가격이 아닙니다.
계정별 가격이나 할인도 적용됩니다. 최종 요금은 사용 로그에서 확인하세요. 최신 가격은 가격 페이지와 계정 설정을 따릅니다.
관련 모델
일반 버전과 VIP 버전은 각각의 전체 모델 이름을 사용합니다. 이 공식 채널에는-official 접미사를 사용하세요.