GPT Image 2
GPT Image 2: 포토리얼 품질, 정확한 텍스트 렌더링, 픽셀 단위 편집
기능
- 텍스트-이미지 생성
- 이미지-이미지 편집 (최대 4장의 참조 이미지)
- 포토리얼 화질과 정확한 타이포그래피
- 단일 이미지 출력 (n=1)
요금제
| Resolution | Credits |
|---|---|
| 1k | 3 (~$0.03) |
| 2k | 4 (~$0.04) |
| 4k | 5 (~$0.06) |
엔드포인트
POST
/api/v1/images/generate매개변수
| Parameter | 타입 | 필수 | 설명 |
|---|---|---|---|
| model | string | 필수 | Must be "gpt-image-2" |
| type | string | 선택 사항 | "text-to-image" or "image-to-image" (default: text-to-image) |
| prompt | string | 필수 | Text description (3–20000 chars) |
| image_urls | string[] | 선택 사항 | Required for image-to-image. Up to 4 reference image URLs |
| input_image | string | 선택 사항 | Deprecated. Alias for image_urls[0] |
| image_size | string | 선택 사항 | Optional aspect ratio: "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "5:4", "4:5", "2:1", "1:2", "21:9", or "9:21". Required for 4k; auto/default is not allowed with 4k. |
| resolution | string | 선택 사항 | Optional output resolution: "1k", "2k", or "4k" (default: "1k") |
| num_images | number | 선택 사항 | Must be 1 (gpt-image-2 always returns a single image) |
요청 예시 (텍스트-투-이미지)
{
"model": "gpt-image-2",
"resolution": "2k",
"prompt": "A hand-drawn illustrated greeting card with the text \"Hello, world!\" in serif letters"
}요청 예시 (이미지-투-이미지)
{
"model": "gpt-image-2",
"type": "image-to-image",
"resolution": "2k",
"prompt": "Place the subject on a beach at golden hour, keep facial features identical",
"image_urls": ["https://tempfile.aiquickdraw.com/workers/nano/image_1772780968156_ygk0zm.png"]
}응답 예시
{
"success": true,
"data": {
"task_id": "task_gpt2_123",
"credits_used": 4,
"remaining_credits": 496,
"model": "gpt-image-2"
}
}코드 예시 (텍스트-투-이미지)
curl -X POST https://gateway.bananapro.site/api/v1/images/generate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"resolution": "2k",
"prompt": "A hand-drawn illustrated greeting card with the text \"Hello, world!\" in serif letters"
}'코드 예시 (이미지-투-이미지)
curl -X POST https://gateway.bananapro.site/api/v1/images/generate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"type": "image-to-image",
"resolution": "2k",
"prompt": "Place the subject on a beach at golden hour, keep facial features identical",
"image_urls": ["https://tempfile.aiquickdraw.com/workers/nano/image_1772780968156_ygk0zm.png"]
}'