GPT Image Hub API ドキュメント
Bearer API キーを使用して、イメージ生成、モデル リスト、クレジット残高、および世代ルックアップ エンドポイントを呼び出します。
https://www.gptimagehub.com認証ヘッダーAuthorization: Bearer gih_live_...クイックスタート
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 キーが必要です。生のキーは作成時に 1 回表示されます。サーバーにはハッシュのみが保存されます。
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 を使用して、保存されたログとイメージ URL を取得します。 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.