GPT Image Hub API Dokümanlar
Görüntü oluşturma, model listeleme, kredi bakiyesi ve oluşturma arama uç noktalarını çağırmak için Bearer API tuşlarını kullanın.
https://www.gptimagehub.comKimlik doğrulama başlığıAuthorization: Bearer gih_live_...Hızlı başlangıç
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.
Uç noktalar
/api/v1/modelsNoMevcut görsel modellerini, desteklenen oranları, kaliteleri ve kredi maliyetini listeleyin.
/api/v1/creditsBearerAPI anahtarına sahip olan kullanıcının kredi bakiyesini okuyun.
/api/v1/images/generationsBearerGenerate images from a prompt, or set async=true to queue a background task.
/api/v1/generations/:generationIdBearerBir nesil günlüğünü ve o nesil için kaydedilen görüntüleri getirin.
Kimlik doğrulama
Model listesi dışındaki tüm v1 uç noktaları, Authorization başlığında bir API anahtarı gerektirir. Ham anahtar, oluşturma sırasında bir kez gösterilir; sunucu yalnızca bir karma saklar.
Authorization: Bearer gih_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxModeller
Modelin uç noktası, model kimliklerini, sağlayıcıları, desteklenen en boy oranlarını, desteklenen nitelikleri, referans görüntü sınırlarını ve görüntü başına krediyi döndürür.
curl https://www.gptimagehub.com/api/v1/modelsGPT IMAGE 2
gpt-image-2Talep alanları
| Alan | Değer | Notlar |
|---|---|---|
model | gpt-image-2 | Bu model kimliğine ayarlanmalıdır |
size | 1024x1024 | OpenAI-compatible output size, for example auto or 1024x1024 |
quality | high | Mevcut nitelikler: auto, low, medium, high |
n | 1 | 1'den 4'e kadar resim sayısı |
reference_image | @./reference.png | Yalnızca multipart/form-data için; sayım model sınırını aşamaz |
JSON çağrı
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
}'Referans görseli çağrısı
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"Kredi
Kredi uç noktası, API anahtarına sahip olan kullanıcının bakiyesini, hesap türünü ve yaklaşan kredi son kullanma tarihini döndürür.
curl https://www.gptimagehub.com/api/v1/credits \
-H "Authorization: Bearer gih_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Görüntüler oluştur
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 isteği
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"
}Referans görseli isteği
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"Yanıt
{
"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
}
}Oluşturmayı al
Kaydedilen günlüğünü ve URLs görüntüsünü almak için nesil uç noktası tarafından döndürülen kimliği kullanın. API anahtarları yalnızca aynı kullanıcıya ait nesilleri okuyabilir.
curl https://www.gptimagehub.com/api/v1/generations/clx_generation_log_id \
-H "Authorization: Bearer gih_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Hatalar
{
"error": {
"message": "Invalid request body",
"code": "invalid_request"
}
}| HTTP | code | Açıklama |
|---|---|---|
| 400 | invalid_request | İstek gövdesi veya parametreler geçersiz. |
| 401 | missingApiKey | Authorization başlığı eksik. |
| 401 | invalidApiKey | API anahtarı mevcut değil veya iptal edildi. |
| 401 | expiredApiKey | API anahtarının süresi doldu. |
| 402 | insufficientCredits | Hesapta yeterli kredi yok. |
| 404 | notFound | İstenilen kaynak bulunamadı. |
| 500 | generationFailed | Görüntü oluşturma başarısız oldu. |
Sınırlar
- 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.