curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2-vip",
"prompt": "Generate a cinematic widescreen poster of a futuristic neon city at night",
"n": 1,
"size": "16:9",
"resolution": "2k",
"quality": "high",
"response_format": "url"
}'
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2-vip",
"prompt": "Keep the main structure but restyle the image into a cyberpunk scene with stronger lighting and details",
"n": 1,
"size": "9:16",
"resolution": "4k",
"quality": "medium",
"image_urls": [
"https://example.com/source.png",
"https://example.com/source.png"
],
"response_format": "url"
}'
const response = await fetch('https://toapis.com/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gpt-image-2-vip',
prompt: 'Generate a cinematic widescreen poster of a futuristic neon city at night',
n: 1,
size: '16:9',
resolution: '2k',
quality: 'low',
response_format: 'url'
})
});
const task = await response.json();
console.log(task.id, task.status);
{
"id": "task_img_abc123def456",
"object": "generation.task",
"model": "gpt-image-2-vip",
"status": "queued",
"progress": 0,
"created_at": 1703884800,
"metadata": {}
}
GPT-Image-2-VIP
GPT-Image-2-VIP 이미지 생성
Generate images with gpt-image-2-vip. 파라미터 are the same as gpt-image-2, but all standard aspect ratios are supported.
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2-vip",
"prompt": "Generate a cinematic widescreen poster of a futuristic neon city at night",
"n": 1,
"size": "16:9",
"resolution": "2k",
"quality": "high",
"response_format": "url"
}'
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2-vip",
"prompt": "Keep the main structure but restyle the image into a cyberpunk scene with stronger lighting and details",
"n": 1,
"size": "9:16",
"resolution": "4k",
"quality": "medium",
"image_urls": [
"https://example.com/source.png",
"https://example.com/source.png"
],
"response_format": "url"
}'
const response = await fetch('https://toapis.com/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gpt-image-2-vip',
prompt: 'Generate a cinematic widescreen poster of a futuristic neon city at night',
n: 1,
size: '16:9',
resolution: '2k',
quality: 'low',
response_format: 'url'
})
});
const task = await response.json();
console.log(task.id, task.status);
{
"id": "task_img_abc123def456",
"object": "generation.task",
"model": "gpt-image-2-vip",
"status": "queued",
"progress": 0,
"created_at": 1703884800,
"metadata": {}
}
중국 본토 사용자 안내: 중국 본토 사용자는
https://toapis.cn 를 API 엔드포인트(Base URL)로 사용해 주세요. 본 문서의 예시에서 https://toapis.com 을 https://toapis.cn 로 바꿔 주세요.- Unified image generation API
- Select the
gpt-image-2-vipmodel via themodelparameter - 파라미터 are the same as
gpt-image-2 - Supports text-to-image, single-reference, and multi-reference image generation
- Async task management with task ID based result lookup
Important Change: For better performance and cost control, base64 image data is no longer supported in
image_urls or reference_images. Please use the Upload 이미지 API first to upload images and obtain a URL.Authorizations
string
필수
All endpoints require Bearer Token authenticationGet your API Key from the API Key Management PageAdd to request header:
Authorization: Bearer YOUR_API_KEY
Body
string
기본값:"gpt-image-2-vip"
필수
Image generation model nameExample:
"gpt-image-2-vip"string
필수
Text prompt for image generationMaximum 32,000 characters for GPT image models
string
기본값:"1:1"
Output image aspect ratioPreset ratios:
1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, 2:1, 1:2, 21:9, 9:21You may also pass any ratio in width:height format, such as 1:3 or 7:4, subject to the custom-size limits below.You can pass auto to let the upstream provider choose the dimensions, but the final aspect ratio and pixel dimensions are not guaranteed.string
기본값:"1k"
Output resolution tierSupported values:
1k, 2k, 4kCustom Resolutions
In addition to the presets above, pass any ratio inwidth:height format through size. The service calculates pixel dimensions from the selected resolution tier. The resulting dimensions must meet all of these limits:
- Both sides must be multiples of 16 pixels
- The long edge can be at most 3,840 pixels (4K)
- The aspect ratio can be at most 3:1
- Total pixel count must be between 655,360 and 8,294,400
size: "1:3"withresolution: "2k"→1024x3072size: "7:4"withresolution: "1k"→1344x768
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2-vip",
"prompt": "A simple red circle on a white background",
"size": "1:3",
"resolution": "2k",
"quality": "medium",
"n": 1
}'
string
기본값:"medium"
Image quality
low— fast and economical, suitable for drafts/previewsmedium— balanced speed and qualityhigh— maximum detail, suitable for final outputs
string
기본값:"auto"
생성 이미지의 배경 스타일
auto— 모델이 자동 결정 (기본값)transparent— 투명 배경opaque— 불투명 배경
투명 배경은 PNG 출력과 함께 사용하는 것이 좋습니다.
integer
기본값:1
Number of images to generateDefault: 1
string
기본값:"url"
응답 formatThe API returns image URLs, so
url is the recommended valuestring[]
Reference image URLs for image-to-image generation⚠️ URL format only (base64 no longer supported)
- Publicly accessible URLs (
http://orhttps://) - You can use the Upload 이미지 API to upload local files and get URLs
- Supports single-image and multi-image reference
string[]
Backward-compatible reference image fieldToAPIs automatically normalizes it to
reference_images응답
string
Unique task identifier for status queries
string
Object type, always
generation.taskstring
모델 name used
string
Task status
queuedin_progresscompletedfailed
integer
Task progress percentage (0-100)
integer
Task creation timestamp (Unix timestamp)
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2-vip",
"prompt": "Generate a cinematic widescreen poster of a futuristic neon city at night",
"n": 1,
"size": "16:9",
"resolution": "2k",
"quality": "high",
"response_format": "url"
}'
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2-vip",
"prompt": "Keep the main structure but restyle the image into a cyberpunk scene with stronger lighting and details",
"n": 1,
"size": "9:16",
"resolution": "4k",
"quality": "medium",
"image_urls": [
"https://example.com/source.png",
"https://example.com/source.png"
],
"response_format": "url"
}'
const response = await fetch('https://toapis.com/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gpt-image-2-vip',
prompt: 'Generate a cinematic widescreen poster of a futuristic neon city at night',
n: 1,
size: '16:9',
resolution: '2k',
quality: 'low',
response_format: 'url'
})
});
const task = await response.json();
console.log(task.id, task.status);
{
"id": "task_img_abc123def456",
"object": "generation.task",
"model": "gpt-image-2-vip",
"status": "queued",
"progress": 0,
"created_at": 1703884800,
"metadata": {}
}