ChatGPT Images 2.5 API
ChatGPT Images 2.5 Client 모델의 전체 API 참조 문서입니다.
모델 종류
이 API는 두 가지 모델을 지원합니다.
한눈에 비교
지원하는 가로세로 비율
16:9, 9:16, 1:1, 3:2, 2:3, 3:4, 4:3, 5:4, 4:5, 21:9
ChatGPT Images 2.5 Client(텍스트로 이미지 생성)
엔드포인트 {#}
POST /api/v1/image/task
인증
Authorization: Bearer YOUR_API_KEY
요청 매개변수
필수
참고: 너비와 높이의 비율은 다음 중 하나여야 합니다: 16:9, 9:16, 1:1, 3:2, 2:3, 3:4, 4:3, 5:4, 4:5, 21:9
요청 예제
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'chatgpt-images-2.5-client',
prompt: 'A minimalist product shot of a ceramic mug on marble, soft studio light',
width: 1,
height: 1,
resolution: '1k'
})
});
const { data } = await response.json();
const taskId = data.task_id;
const pollResponse = await fetch(
`https://api.flaq.ai/api/v1/image/${taskId}`,
{
headers: { Authorization: 'Bearer YOUR_API_KEY' }
}
);
const result = await pollResponse.json();
console.log(result.data.task_result.images[0].url);
ChatGPT Images 2.5 Edit Client(이미지 편집)
엔드포인트
POST /api/v1/image/task
요청 매개변수
필수
참고: 너비와 높이의 비율은 다음 중 하나여야 합니다: 16:9, 9:16, 1:1, 3:2, 2:3, 3:4, 4:3, 5:4, 4:5, 21:9
단일 이미지 편집 예제
{
model_name: 'chatgpt-images-2.5-edit-client',
prompt: 'Replace the background with a clean studio scene and brighten the product lighting',
image_url_list: ['https://example.com/product-photo.jpg'],
width: 16,
height: 9,
resolution: '1k'
}
여러 이미지 합성 예제
{
model_name: 'chatgpt-images-2.5-edit-client',
prompt: 'Blend these reference images into a polished campaign composition while keeping the main subject identity consistent',
image_url_list: [
'https://example.com/image1.jpg',
'https://example.com/image2.jpg',
'https://example.com/image3.jpg'
],
width: 16,
height: 9,
resolution: '1k'
}
응답 형식
최초 응답
두 ChatGPT Images 2.5 모델 모두 폴링에 사용할 task_id를 반환합니다.
{
"code": 0,
"data": {
"task_id": "{task_id}",
"task_status": "submitted",
"response_url": "https://api.flaq.ai/api/v1/image/{task_id}"
},
"message": "success"
}
폴링 응답
GET /api/v1/image/{task_id}를 폴링하여 상태를 확인합니다.
{
"code": 0,
"data": {
"task_id": "{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"response_url": "https://api.flaq.ai/api/v1/image/{task_id}",
"task_result": {
"credit": 0.0997,
"images": [
{
"url": "https://example.com/generated-image.jpeg"
}
]
}
},
"message": "success"
}
상태 값
submitted: 작업 접수 완료
processing: 이미지 생성 또는 편집 진행 중
succeed: 작업이 성공적으로 완료됨
failed: 작업 실패
처리 시간
일반적인 처리 시간은 15~60초이며, 프롬프트의 복잡성과 편집 요청의 이미지 수에 따라 달라집니다.
권장 사항
- 구도를 명확하게 설명하세요: 프롬프트에 피사체, 프레이밍, 조명, 원하는 스타일을 명확히 설명할 때 ChatGPT Images 2.5에서 가장 좋은 결과를 얻을 수 있습니다.
- 사용 목적에 맞는 가로세로 비율을 설정하세요: 소셜 게시물, 배너, 제품 페이지 또는 편집 레이아웃에 맞춰 비율을 미리 설정하세요.
- 편집에는 선명한 원본 이미지를 사용하세요: 선명하고 조명이 좋은 입력 이미지는 피사체의 정체성 유지와 부분 편집 품질 향상에 도움이 됩니다.
- 여러 이미지 요청에는 효과적인 참조 이미지만 사용하세요: 편집 요청에는 꼭 필요한 이미지만 제공하여 시각적 지시가 서로 충돌하지 않도록 하세요.