GPT Image 2
ID:
openai/gpt-image-2OpenAI の GPT Image 2 画像生成 API — 最大 4K、ネイティブ推論、多言語テキストレンダリング、参照画像ガイド付き編集。
テキストから画像画像編集参照画像商用利用
概要
OpenAI の GPT Image 2 画像生成 API — 最大 4K、ネイティブ推論、多言語テキストレンダリング、参照画像ガイド付き編集。
認証
すべての API リクエストには、Authorization ヘッダーで Bearer スキームを使用した有効な API キーが必要です。
クイックスタート
認証情報
環境変数 RUNBASE_API_KEY を設定してください。
Shell
export RUNBASE_API_KEY=your-api-key実行を作成
Shell
curl -s https://runbase.net/api/v1/runs \
-H "Authorization: Bearer $RUNBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-image-2",
"input": {
"prompt": "A cinematic product photo of a ceramic lamp"
}
}'実行
実行は非同期で処理されます。リクエストを送信し、結果をポーリングで取得してください。
実行を作成
Shell
curl -s https://runbase.net/api/v1/runs \
-H "Authorization: Bearer $RUNBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-image-2",
"input": { "prompt": "A cinematic product photo of a ceramic lamp" }
}'実行ステータスを取得
Shell
curl -s https://runbase.net/api/v1/runs/RUN_ID \
-H "Authorization: Bearer $RUNBASE_API_KEY"結果を取得
status が "succeeded" になるまでステータスエンドポイントをポーリングし、レスポンスの output.urls を参照してください。
入力スキーマ
| パラメータ | タイプ | 必須 | 説明 |
|---|---|---|---|
| prompt | string | 必須 | Prompt |
| aspect_ratio | string | 任意 | Aspect ratioオプション: 1:12:33:23:44:34:55:49:1616:921:9 |
| resolution | string | 任意 | Resolutionオプション: 1K2K4K |
| image_urls | string[] | 任意 | Reference images |
出力スキーマ
| フィールド | タイプ | 説明 |
|---|---|---|
| urls | string[] | 生成された出力 URL |
エラー
API は標準の HTTP ステータスコードで成功または失敗を示します。
| ステータスコード | 説明 |
|---|---|
| 400 | Ungültige Anfrage – fehlende oder fehlerhafte Parameter |
| 401 | Authentifizierung fehlgeschlagen – fehlender oder ungültiger API-Schlüssel |
| 402 | Unzureichendes Guthaben |
| 403 | Zugriff verweigert – IP nicht erlaubt oder Ausgabenlimit des API-Schlüssels überschritten |
| 404 | Ausführung nicht gefunden |
| 429 | Rate-Limit überschritten |
| 500 | Interner Serverfehler |

