GPT-Image-2
GPT-Image-2 이미지 생성
Generate images with gpt-image-2, supporting text-to-image and reference_images based image generation
POST
- Unified image generation API
- Select the
gpt-image-2model via themodelparameter - Supports text-to-image, single-reference, and multi-reference image generation
- Async task management with task ID based result lookup
Authorizations
string
필수
All endpoints require Bearer Token authenticationGet your API Key from the API Key Management PageAdd to request header:
Body
string
기본값:"gpt-image-2"
필수
Image generation model nameExample:
"gpt-image-2"string
필수
Text prompt for image generationMaximum 32,000 characters for GPT image models
string
기본값:"1:1"
Output image aspect ratioCurrently supported 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:21string
기본값:"1k"
Output resolution tierSupported values:
1k, 2k, 4kSize Reference
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)