GPT-Image-2.6 · 이미지-이미지
curl --request POST \
--url https://api.gravitex.ai/v1/images/edits \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.gravitex.ai/v1/images/edits"
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'}
};
fetch('https://api.gravitex.ai/v1/images/edits', 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.gravitex.ai/v1/images/edits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gravitex.ai/v1/images/edits"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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.gravitex.ai/v1/images/edits")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gravitex.ai/v1/images/edits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
response = http.request(request)
puts response.read_bodyimage-2.6
GPT-Image-2.6 · 이미지-이미지
GPT-Image-2.6 Flare / Sunburst · POST /v1/images/edits
POST
/
v1
/
images
/
edits
GPT-Image-2.6 · 이미지-이미지
curl --request POST \
--url https://api.gravitex.ai/v1/images/edits \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.gravitex.ai/v1/images/edits"
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'}
};
fetch('https://api.gravitex.ai/v1/images/edits', 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.gravitex.ai/v1/images/edits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gravitex.ai/v1/images/edits"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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.gravitex.ai/v1/images/edits")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gravitex.ai/v1/images/edits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
response = http.request(request)
puts response.read_body소개
GPT-Image-2.6 Flare와 Sunburst는 참조 이미지와 텍스트 지시를 바탕으로 이미지를 편집합니다. 이 페이지는 색상 변경, 배경 교체, 스타일 전환, 부분 리터치 및 다중 참조 합성을 위한POST /v1/images/edits를 설명합니다.
참조 이미지를 제공하고 prompt에 변경할 부분과 유지할 부분을 명확히 작성하세요. 영역 지정에는 mask 또는 투명 markup 오버레이 중 하나를 사용하며 동시에 전달할 수 없습니다. 정적 참조 이미지로 GIF도 생성할 수 있습니다. 요청은 JSON 이미지 참조 또는 multipart 파일 업로드를 지원합니다.
빠른 편집 반복에는 Flare, 세부 표현과 레이아웃 및 편집 정확도가 중요할 때는 Sunburst가 적합합니다. quality로 렌더링을, 별개의 complexity로 계획 수준을 조절하세요. 국소 수정은 낮은 complexity부터 시도하고 주변 내용이 의도대로 유지되는지 확인하세요.
모델 선택
| 모델 ID | 권장 용도 |
|---|---|
gpt-image-2.6-flare | 빠른 반복 작업과 대화형 생성 |
gpt-image-2.6-sunburst | 세부 묘사, 복잡한 레이아웃 및 정밀 편집 |
인증
string
필수
Bearer $GRAVITEX_API_KEY
string
필수
application/json / multipart/form-data
요청 매개변수
| 매개변수 | 유형 | 설명 |
|---|---|---|
model | string | 필수: gpt-image-2.6-flare 또는 gpt-image-2.6-sunburst |
prompt | string | 필수 생성 설명 또는 편집 지시, 최대 32,000자 |
quality | string | auto / low / medium / high / xhigh / max; 기본 auto |
complexity | string | low / medium / high; 기본 high. quality와 별개인 렌더링 전 계획 수준 |
size | string | auto 또는 WxH, 너비와 높이는 16의 배수. 모델 크기와 픽셀 제한 적용 |
n | integer | 1–10; 기본 1 |
background | string | auto / opaque / transparent; 투명 래스터 출력은 png 또는 webp |
output_format | string | png / jpeg / webp / gif |
output_compression | integer | jpeg/webp만 0–100; GIF 미지원 |
moderation | string | auto / low; 기본 auto |
safety_identifier | string | 안정적인 해시 사용자 식별자, 최대 128자; user 대체 |
stream | boolean | 기본 false. true이면 단일 JSON 대신 SSE 이벤트를 읽습니다. GIF 미지원 |
partial_images | integer | 래스터 스트리밍 전용, 0–3, 기본 0. 요청한 미리보기 수보다 적게 반환될 수 있습니다. GIF 미지원 |
images / image[] | array / file | JSON 필수: images: [{"image_url": "HTTPS URL 또는 base64 data URI"}]로 하나 이상의 참조 이미지 전달. multipart는 image[] 파일 사용 |
markup | object / file | 첫 번째 참조 이미지용 투명 PNG 오버레이. mask와 동시 사용 불가 |
mask | object / file | 첫 번째 참조 이미지와 크기가 같고 alpha 채널이 있는 PNG 마스크. 완전히 투명한 영역이 편집 대상입니다. 첫 이미지에만 적용되며 markup 및 GIF와 함께 사용 불가 |
frame_count | integer | GIF 전용: 2–16, 기본 9 |
frame_duration_ms | integer | GIF 전용: 기본 200; 가이드 권장 20–2000ms, 10ms 단위 반올림 |
images / markup / mask
JSON은images: [{"image_url": "https://..."}] 또는 base64 data URI를 사용합니다. multipart는 image[]로 파일을 업로드합니다. 플랫폼 연동 설명에 따르면 JSON 편집은 multipart로 변환되며 OpenAI file_id 참조는 지원하지 않습니다.
첫 번째 입력 이미지의 방향 보정 후 크기와 일치하는 투명 PNG 마크업 레이어를 사용합니다. 투명 픽셀을 포함해야 합니다. JSON은 markup.image_url, multipart는 markup 파일을 사용합니다. mask와 함께 사용할 수 없습니다.
편집 영역은 mask 또는 markup 중 하나로 지정합니다. JSON은 image_url, multipart는 파일을 사용합니다.
요청 예시
예시는 터미널 환경 변수 GRAVITEX_API_KEY에서 플랫폼 토큰을 읽습니다. 업로드 시 curl -F가 Content-Type과 boundary를 자동 생성하므로 multipart/form-data 헤더를 직접 고정하지 마세요.JSON 예시는 OpenAI 공식 주방 사진을 사용하고 마크업 예시는 크기가 일치하는 공식 투명 오버레이를 사용합니다. JSON 본문을 바로 복사할 수 있습니다. multipart 예시는 먼저 같은 이미지를 다운로드합니다. 게이트웨이는 file_id를 지원하지 않으며 테스트에서는 HTTP 500(convert_request_failed)을 반환했습니다.
JSON
curl https://api.gravitex.ai/v1/images/edits \
-H "Authorization: Bearer $GRAVITEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6-flare",
"prompt": "Change the vase to blue. Keep everything else unchanged.",
"quality": "medium",
"complexity": "low",
"size": "1024x1024",
"images": [
{
"image_url": "https://developers.openai.com/images/platform/guides/image-prompting/kitchen.webp"
}
]
}'
multipart/form-data
curl --fail --location "https://developers.openai.com/images/platform/guides/image-prompting/kitchen.webp" -o kitchen.webp
curl https://api.gravitex.ai/v1/images/edits \
-H "Authorization: Bearer $GRAVITEX_API_KEY" \
-F "model=gpt-image-2.6-flare" \
-F "prompt=Change the vase to blue. Keep everything else unchanged." \
-F "image[]=@kitchen.webp" \
-F "complexity=low"
마크업 편집
curl https://api.gravitex.ai/v1/images/edits \
-H "Authorization: Bearer $GRAVITEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6-flare",
"prompt": "Change the vase to blue. Keep everything else unchanged.",
"quality": "medium",
"complexity": "low",
"size": "1024x1024",
"images": [
{
"image_url": "https://developers.openai.com/images/platform/guides/image-prompting/kitchen.webp"
}
],
"markup": {
"image_url": "https://developers.openai.com/images/platform/guides/image-prompting/markup-vase-overlay-gpt-image-2-6.png"
}
}'
GIF 애니메이션
curl https://api.gravitex.ai/v1/images/edits \
-H "Authorization: Bearer $GRAVITEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6-flare",
"prompt": "Animate the kitchen curtains gently moving in a breeze. Keep the camera still and make a seamless loop.",
"output_format": "gif",
"frame_count": 9,
"frame_duration_ms": 200,
"size": "auto",
"images": [
{
"image_url": "https://developers.openai.com/images/platform/guides/image-prompting/kitchen.webp"
}
]
}'
마스크 부분 편집
curl https://api.gravitex.ai/v1/images/edits \
-H "Authorization: Bearer $GRAVITEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6-flare",
"prompt": "Add a pink flamingo float in the masked pool area. Keep the rest of the room unchanged.",
"images": [
{
"image_url": "https://cdn.openai.com/API/docs/images/sunlit_lounge.png"
}
],
"mask": {
"image_url": "https://cdn.openai.com/API/docs/images/mask.png"
},
"quality": "medium"
}'
스트리밍
curl --no-buffer https://api.gravitex.ai/v1/images/edits \
-H "Authorization: Bearer $GRAVITEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6-flare",
"prompt": "Change the vase to blue. Keep everything else unchanged.",
"quality": "medium",
"size": "1024x1024",
"stream": true,
"partial_images": 1,
"images": [
{
"image_url": "https://developers.openai.com/images/platform/guides/image-prompting/kitchen.webp"
}
]
}'
제한 및 참고 사항
GIF size는 프레임별 크기입니다. 프레임 수, n 및 모델 픽셀 예산을 함께 고려하며 auto를 우선 사용하세요. 공식 Images API JSON 편집은 PNG, JPEG, WebP 참조 1–16장, 각 50MB 미만을 허용합니다. mask는 첫 참조와 크기가 같은 alpha 채널 PNG입니다. 투명 영역은 편집을 유도하지만 픽셀 단위 경계를 보장하지는 않습니다. 게이트웨이가 검증하지 않아도 상위 서비스 제한은 적용됩니다. 편집 엔드포인트는 SVG 출력을 제공하지 않습니다. SVG는 생성 엔드포인트를 사용하세요. GIF는 미리보기 접근 권한이 필요합니다. mask, stream, partial_images, 사용자 지정 output_compression은 지원하지 않습니다. 프레임 수, 크기와 n은 요청 픽셀 예산을 공유하므로 초과 시 줄이거나 size=auto를 사용하세요. complexity는 별도 수수료가 없지만 지연과 결과에 영향을 줄 수 있습니다. 낮은 complexity가 고정 응답 시간이나 이미지별 비용을 보장하지는 않습니다.응답 예시
다음은 비스트리밍 응답 구조 예시입니다. 이미지 데이터와 토큰 수는 실제 생성 결과가 아닙니다. b64_json을 디코딩하여 해당 형식으로 저장하고 Base64 텍스트를 이미지 파일로 직접 저장하지 마세요.{
"created": 1794268800,
"data": [
{
"b64_json": "<BASE64_IMAGE_DATA>"
}
],
"usage": {
"input_tokens": 100,
"output_tokens": 824,
"total_tokens": 924
}
}
응답 및 과금
비스트리밍 예시는 b64_json으로 이미지를 반환합니다. response_format=url로 이미지 링크를 기대하지 마세요. 같은 토큰 단가가 이미지당 같은 비용을 뜻하지 않으므로 실제 usage를 확인하세요. data[].b64_json을 디코딩하여 선택한 형식으로 저장합니다. usage는 토큰 사용량입니다. 아래는 OpenAI 표준 가격이며 GravitexAI 요금은 콘솔 기준입니다.| 유형 | USD / 1M tokens |
|---|---|
| 텍스트 입력 | $5.00 |
| 캐시 텍스트 입력 | $1.25 |
| 이미지 입력 | $8.00 |
| 캐시 이미지 입력 | $2.00 |
| 이미지 출력 | $30.00 |
