GPT-Image-2.6 공식 채널 이미지 생성
curl --request POST \
--url https://api.toapis.com/v1/images/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"size": "<string>",
"resolution": "<string>",
"quality": "<string>",
"n": 123,
"output_format": "<string>",
"output_compression": 123,
"background": "<string>",
"moderation": "<string>",
"complexity": "<string>"
}
'import requests
url = "https://api.toapis.com/v1/images/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"size": "<string>",
"resolution": "<string>",
"quality": "<string>",
"n": 123,
"output_format": "<string>",
"output_compression": 123,
"background": "<string>",
"moderation": "<string>",
"complexity": "<string>"
}
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>',
size: '<string>',
resolution: '<string>',
quality: '<string>',
n: 123,
output_format: '<string>',
output_compression: 123,
background: '<string>',
moderation: '<string>',
complexity: '<string>'
})
};
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>',
'size' => '<string>',
'resolution' => '<string>',
'quality' => '<string>',
'n' => 123,
'output_format' => '<string>',
'output_compression' => 123,
'background' => '<string>',
'moderation' => '<string>',
'complexity' => '<string>'
]),
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 \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"quality\": \"<string>\",\n \"n\": 123,\n \"output_format\": \"<string>\",\n \"output_compression\": 123,\n \"background\": \"<string>\",\n \"moderation\": \"<string>\",\n \"complexity\": \"<string>\"\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 \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"quality\": \"<string>\",\n \"n\": 123,\n \"output_format\": \"<string>\",\n \"output_compression\": 123,\n \"background\": \"<string>\",\n \"moderation\": \"<string>\",\n \"complexity\": \"<string>\"\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 \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"quality\": \"<string>\",\n \"n\": 123,\n \"output_format\": \"<string>\",\n \"output_compression\": 123,\n \"background\": \"<string>\",\n \"moderation\": \"<string>\",\n \"complexity\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyGPT-Image-2.6
GPT-Image-2.6 공식 채널 이미지 생성
Sunburst 및 Flare 공식 채널 비동기 이미지 작업, 마크업 편집, GIF 및 SVG 출력, R2 저장 및 토큰 과금
POST
/
v1
/
images
/
generations
GPT-Image-2.6 공식 채널 이미지 생성
curl --request POST \
--url https://api.toapis.com/v1/images/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"size": "<string>",
"resolution": "<string>",
"quality": "<string>",
"n": 123,
"output_format": "<string>",
"output_compression": 123,
"background": "<string>",
"moderation": "<string>",
"complexity": "<string>"
}
'import requests
url = "https://api.toapis.com/v1/images/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"size": "<string>",
"resolution": "<string>",
"quality": "<string>",
"n": 123,
"output_format": "<string>",
"output_compression": 123,
"background": "<string>",
"moderation": "<string>",
"complexity": "<string>"
}
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>',
size: '<string>',
resolution: '<string>',
quality: '<string>',
n: 123,
output_format: '<string>',
output_compression: 123,
background: '<string>',
moderation: '<string>',
complexity: '<string>'
})
};
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>',
'size' => '<string>',
'resolution' => '<string>',
'quality' => '<string>',
'n' => 123,
'output_format' => '<string>',
'output_compression' => 123,
'background' => '<string>',
'moderation' => '<string>',
'complexity' => '<string>'
]),
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 \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"quality\": \"<string>\",\n \"n\": 123,\n \"output_format\": \"<string>\",\n \"output_compression\": 123,\n \"background\": \"<string>\",\n \"moderation\": \"<string>\",\n \"complexity\": \"<string>\"\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 \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"quality\": \"<string>\",\n \"n\": 123,\n \"output_format\": \"<string>\",\n \"output_compression\": 123,\n \"background\": \"<string>\",\n \"moderation\": \"<string>\",\n \"complexity\": \"<string>\"\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 \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"quality\": \"<string>\",\n \"n\": 123,\n \"output_format\": \"<string>\",\n \"output_compression\": 123,\n \"background\": \"<string>\",\n \"moderation\": \"<string>\",\n \"complexity\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body공식 채널을 통해 두 개의 GPT-Image-2.6 모델을 호출할 수 있습니다. 요청을 제출하면 비동기 작업 ID가 즉시 반환됩니다. 백그라운드에서 이미지를 생성하고 결과를 R2에 저장한 후 제공합니다.
호출 시 표의 전체 모델명을 사용해야 합니다.
제출 응답의
제출 응답은
GIF는 전체 애니메이션의 출력 토큰으로 과금됩니다. SVG 출력은 이미지 토큰 외에
| 모델 | model |
|---|---|
| Sunburst Official | gpt-image-2.6-sunburst-official |
| Flare Official | gpt-image-2.6-flare-official |
gpt-image-2.6-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.6-flare-official",
"prompt": "A small blue circle on a plain white background",
"size": "1:1",
"resolution": "1k",
"quality": "medium",
"n": 1
}'
{
"id": "tsk_img_example",
"object": "generation.task",
"model": "gpt-image-2.6-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
필수
Bearer YOUR_API_KEY 형식의 ToAPIs API Key를 사용합니다.string
필수
gpt-image-2.6-sunburst-official / gpt-image-2.6-flare-official.string
필수
이미지 설명. 참조 이미지나 마크업 이미지를 사용할 때는 유지할 부분과 변경할 부분을 설명하세요.
string
기본값:"auto"
비율 이름 (
1:1, 3:2, 2:3, 16:9, 9:16 등) 또는 픽셀 크기 (1024x1024, 1536x1024 등). GIF 출력 시 size 의미는 GIF 섹션을 참조하세요. 픽셀 크기는 양쪽이 16의 배수이고 16 이상이어야 하며, 각 변은 3840 이하, 긴 변은 짧은 변의 3배 이내여야 합니다. 2560x1440을 넘는 크기는 실험적입니다.string
해상도 단계
1k / 2k / 4k. 명시하면 size에서 추론된 단계보다 우선합니다. 단계는 실제 토큰 사용량과 소요 시간에 영향을 줍니다.string
기본값:"medium"
auto, low, medium, high, xhigh, max 6단계. auto는 요청마다 모델이 품질 단계를 자동 선택합니다. 품질은 실제 토큰 사용량과 소요 시간에 영향을 줍니다.integer
기본값:1
요청당 1~4장을 생성합니다.
output_format이 svg이면 1만 지정할 수 있습니다.string
출력 형식
png / jpeg / webp / gif / svg. 생략하면 업스트림 기본값을 사용합니다. gif와 svg의 추가 파라미터와 제약은 아래 각 섹션을 참조하세요.integer
0-100의 압축률.
jpeg와 webp 출력에만 적용됩니다.string
transparent / opaque / auto. 명시적 투명은 png / webp 출력에만 적용되며, svg는 기본적으로 투명합니다.string
콘텐츠 모더레이션 수준
auto / low.string
생성 복잡도
low / medium / high. 생략하면 high입니다. 별도 과금은 없습니다.참조 이미지와 마스크
이미지에서 이미지를 생성하려면 같은 JSON 요청에image_urls를 추가하세요. 최대 16장이며 URL은 서버에서 접근 가능해야 합니다. 먼저 이미지 업로드 API로 URL을 얻을 수 있습니다. 참조 이미지는 이미지 입력 토큰으로 과금됩니다.
mask_url은 PNG 알파 마스크 이미지를 가리키며, 크기는 첫 번째 참조 이미지와 같아야 하고 image_urls와 함께 사용해야 합니다.
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.6-sunburst-official",
"prompt": "Keep the subject and replace the masked area with a snowy forest",
"image_urls": ["https://example.com/reference.png"],
"mask_url": "https://example.com/mask.png",
"quality": "high",
"size": "1024x1024",
"n": 1
}'
마크업 편집
markup_url은 주석이 달린 참조 이미지를 가리킵니다 (또는 markup으로 인라인 주석 객체를 전달). image_urls로 원본 이미지를 지정하면 모델이 주석의 의미에 따라 편집합니다. markup_url과 mask_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.6-sunburst-official",
"prompt": "Follow the markup annotations to adjust the layout",
"image_urls": ["https://example.com/reference.png"],
"markup_url": "https://example.com/markup.png",
"quality": "high",
"n": 1
}'
GIF 출력
output_format에 gif를 지정하면 애니메이션을 생성합니다. frame_count로 프레임 수 (2-16), frame_duration_ms로 프레임당 길이를 지정합니다. GIF는 텍스트-이미지 생성만 지원하며 image_urls, mask_url, markup_url, markup, output_compression과 함께 사용할 수 없습니다. size는 512x512 같은 정확한 픽셀 크기를 전달하거나 생략해 업스트림 기본 프레임 크기를 사용하세요. 1:1 같은 비율 값은 GIF에서 거부됩니다.
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.6-flare-official",
"prompt": "A paper airplane looping across a blue sky, flat illustration",
"output_format": "gif",
"frame_count": 8,
"frame_duration_ms": 200,
"size": "512x512",
"n": 1
}'
SVG 출력
output_format에 svg를 지정하면 벡터 이미지를 생성합니다. svg 객체와 그 안의 svg.model도 함께 제공해야 합니다. SVG는 텍스트-이미지 생성만 지원하고 n은 1만 가능하며 image_urls, mask_url, markup_url, markup, output_compression과 함께 사용할 수 없습니다. SVG 생성은 svg.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.6-flare-official",
"prompt": "A minimalist mountain logo, flat vector style",
"output_format": "svg",
"svg": { "model": "gpt-5" },
"n": 1
}'
토큰 가격
두 official 모델은 토큰 항목별로 과금됩니다. 텍스트 입력, 캐시된 텍스트 입력, 이미지 입력, 캐시된 이미지 입력, 이미지 출력이 각각 별도 요금입니다. 제출 시 쿼터가 먼저 차감되고, 성공 후 실제 토큰 사용량에 따라 환불 또는 추가 과금됩니다. USD 단위 비용 공식:USD = (
uncached_text_input_tokens * text_input_price
+ cached_text_input_tokens * cached_text_input_price
+ uncached_image_input_tokens * image_input_price
+ cached_image_input_tokens * cached_image_input_price
+ image_output_tokens * image_output_price
) / 1,000,000
svg.model로 지정한 텍스트 모델의 입출력 토큰 요금이 발생합니다.
계정 전용 가격이나 할인은 계속 적용됩니다. 최종 청구 금액은 사용 로그에서 확인할 수 있으며, 최신 가격은 가격 페이지와 계정 설정을 따릅니다.
관련 모델
GPT-Image-2.5 공식 채널, 일반판, VIP 판은 각각 고유한 전체 모델명을 사용합니다. 이 공식 채널을 호출할 때는-official 접미사를 사용하세요.