빠른 시작
Sign in, open API Keys in your account, create a key, and store the one-time secret.
Call /api/v1/models for model capabilities, then /api/v1/credits for your balance.
Call /api/v1/images/generations. For long-running calls, set async to true and poll the returned poll_url.
엔드포인트
/api/v1/modelsNo사용 가능한 이미지 모델, 지원되는 비율, 품질 및 크레딧 비용을 나열합니다.
/api/v1/creditsBearerAPI 키를 소유한 사용자의 크레딧 잔액을 읽습니다.
/api/v1/images/generationsBearerGenerate images from a prompt, or set async=true to queue a background task.
/api/v1/generations/:generationIdBearer해당 세대에 대해 저장된 생성 로그와 이미지를 가져옵니다.
인증
모델 목록을 제외한 모든 v1 엔드포인트에는 Authorization 헤더에 API 키가 필요합니다. 원시 키는 생성 시 한 번 표시됩니다. 서버는 해시만 저장합니다.
Authorization: Bearer gih_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx모델
모델 엔드포인트는 모델 ID, 공급자, 지원되는 종횡비, 지원되는 품질, 참조 이미지 제한 및 이미지당 크레딧을 반환합니다.
curl https://www.gptimagehub.com/api/v1/modelsGPT IMAGE 2
gpt-image-2요청 필드
| 필드 | 가치 | 메모 |
|---|---|---|
model | gpt-image-2 | 이 모델 ID로 설정되어야 합니다. |
size | 1024x1024 | OpenAI-compatible output size, for example auto or 1024x1024 |
quality | high | 사용 가능한 품질: auto, low, medium, high |
n | 1 | 이미지 수(1~4) |
reference_image | @./reference.png | multipart/form-data에만 해당됩니다. 개수는 모델 한도를 초과할 수 없습니다. |
JSON 전화
curl https://www.gptimagehub.com/api/v1/images/generations \
-H "Authorization: Bearer gih_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A cinematic product photo with premium studio lighting",
"size": "1024x1024",
"quality": "high",
"n": 1
}'참조 이미지 호출
curl https://www.gptimagehub.com/api/v1/images/generations \
-H "Authorization: Bearer gih_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-F "model=gpt-image-2" \
-F "prompt=Use the reference image and render it as a premium studio product shot" \
-F "size=1024x1024" \
-F "quality=high" \
-F "n=1" \
-F "reference_image=@./reference.png"크레딧
크레딧 엔드포인트는 API 키를 소유한 사용자에 대한 잔액, 계정 유형 및 향후 크레딧 만료를 반환합니다.
curl https://www.gptimagehub.com/api/v1/credits \
-H "Authorization: Bearer gih_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"이미지 생성
The image generation endpoint waits for completion by default. Set async to true to receive a generation id immediately and poll /api/v1/generations/:generationId for the result. Credits are charged before provider generation and refunded automatically when the provider fails or returns fewer images than requested.
JSON 요청
curl https://www.gptimagehub.com/api/v1/images/generations \
-H "Authorization: Bearer gih_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A cinematic product photo of a transparent perfume bottle on black marble",
"size": "1024x1024",
"quality": "high",
"n": 1
}'Async task
curl https://www.gptimagehub.com/api/v1/images/generations \
-H "Authorization: Bearer gih_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A cinematic product photo with premium studio lighting",
"size": "1024x1024",
"quality": "high",
"n": 1,
"async": true
}'{
"object": "image_generation",
"id": "clx_generation_log_id",
"status": "queued",
"model": "gpt-image-2",
"aspect_ratio": "1:1",
"quality": "1K",
"created_at": "2026-04-30T08:00:00.000Z",
"images": [],
"usage": {
"credits": 0,
"credits_requested": 8
},
"poll_url": "https://www.gptimagehub.com/api/v1/generations/clx_generation_log_id"
}참조 이미지 요청
curl https://www.gptimagehub.com/api/v1/images/generations \
-H "Authorization: Bearer gih_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-F "model=gpt-image-2" \
-F "prompt=Use the reference image and render it as a premium studio product shot" \
-F "size=1024x1024" \
-F "quality=high" \
-F "n=1" \
-F "reference_image=@./reference.png"응답
{
"object": "image_generation",
"id": "clx_generation_log_id",
"status": "succeeded",
"model": "gpt-image-2",
"aspect_ratio": "1:1",
"quality": "1K",
"images": [
{
"id": "clx_image_id",
"object": "image",
"url": "https://cdn.example.com/generations/user/image.png",
"created_at": "2026-04-30T08:00:00.000Z"
}
],
"usage": {
"credits": 8
},
"balance": {
"credits": 112,
"account_type": "PRO",
"next_expiration": null
}
}생성 검색
생성 엔드포인트에서 반환된 ID를 사용하여 저장된 로그 및 이미지 URLs를 검색합니다. API 키는 동일한 사용자가 소유한 세대만 읽을 수 있습니다.
curl https://www.gptimagehub.com/api/v1/generations/clx_generation_log_id \
-H "Authorization: Bearer gih_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"오류
{
"error": {
"message": "Invalid request body",
"code": "invalid_request"
}
}| HTTP | code | 설명 |
|---|---|---|
| 400 | invalid_request | 요청 본문 또는 매개변수가 잘못되었습니다. |
| 401 | missingApiKey | Authorization 헤더가 누락되었습니다. |
| 401 | invalidApiKey | API 키가 존재하지 않거나 취소되었습니다. |
| 401 | expiredApiKey | API 키가 만료되었습니다. |
| 402 | insufficientCredits | 계정에 충분한 크레딧이 없습니다. |
| 404 | notFound | 요청한 리소스를 찾을 수 없습니다. |
| 500 | generationFailed | 이미지 생성에 실패했습니다. |
한도
- Synchronous generation can run for up to 800 seconds on production.
- n must be between 1 and 4.
- Reference images support PNG, JPG, JPEG, and WebP. Each file can be up to 50MB.
- The maximum reference image count is defined by each model's reference_image_limit.
- Async mode returns 202 with poll_url. Webhooks and a separate API rate limit are not included yet.