GPT Image 2 API:料金、サイズ、動作するコード
GPT Image 2は、2026年4月にリリースされたOpenAIの画像生成・編集モデルです。このガイドでは、受け付けるサイズと入力、1枚あたりの料金、1つのAPIキーで実行できるリクエストを解説します。
GPT Image 2とは
OpenAIは2026年4月にGPT Image 2をリリースしました。APIのスナップショットは gpt-image-2-2026-04-21 です。OpenAIはこのモデルを、「高速かつ高品質な画像生成と編集のための最先端の画像生成モデル」と説明し、「柔軟な画像サイズと高忠実度の画像入力に対応している」としています。Revanaでは、次のとおりです:
- 3種類の出力サイズ:1K、2K、4K。
- 9種類のアスペクト比:正方形や縦向きから、ヘッダーやバナー向けの21:9、5:2まで。
- 最大16枚の入力画像:編集や合成のための、商品、ロゴ、人物、スタイルの参照。
- 生成と編集を1つのモデルで:Revanaのほかのすべてのモデルと同じリクエスト形式です。
代表的な用途:商品写真、広告クリエイティブ、SNS用画像、Webサイトのバナー、モックアップ、既存の写真の編集。
入力と制限
| オプション | GPT Image 2 |
|---|---|
| モデルID | gpt-image-2 |
| タスク | テキストから画像、画像編集 |
| 解像度 | 1K、2K、4K |
| アスペクト比 | 1:1、3:4、4:3、2:3、3:2、9:16、16:9、21:9、5:2 |
| 入力画像 | 編集する1枚を image_url として、または最大16枚を次の形式で image_urls |
| ルート | 2ルート |
画像リクエストは、duration と audio を除き、動画と同じフィールドを使います。モデルが対応していないサイズやアスペクト比は、課金される前に 422 で拒否されます。
GPT Image 2の料金(2026年10月)
GPT Image 2は、出力サイズごとに、生成した画像1枚あたりで課金されます。2026年10月時点のRevanaのカタログの料金は次のとおりです:
| 解像度 | 1枚あたり | 100枚 | 1,000枚 |
|---|---|---|---|
| 1K | $0.03 | $3.00 | $30.00 |
| 2K | $0.03 | $3.00 | $30.00 |
| 4K | $0.03 | $3.00 | $30.00 |
各ジョブの料金は、送信時に前払い残高から確保され、画像が納品された場合にのみ課金されます。ジョブが失敗した場合は、確保が解除されます。課金額は、生成結果に cost_usd として含まれます。クレジットパックとすべてのモデルの料金は料金ページに掲載されています。
前世代のGPT Image 1.5も引き続き掲載しています。カタログの料金はアスペクト比と品質によって異なり、低品質の正方形が$0.01、高品質の3:2が$0.14までです。
GPT Image 2で画像を生成する
"model": "gpt-image-2" を付けて POST /v1/generations を送信し、プロンプト、サイズ、アスペクト比を指定します。生成の id を含む 202 が返されるので、ステータスが succeeded になるまでポーリングします。画像は通常、数秒で完成します。この2Kの正方形の画像は$0.03です。
export REVANA_API_KEY="sr_live_..."
# 1. Submit the job (returns 202 with the generation id)
curl https://api.revana.si/v1/generations \
-H "Authorization: Bearer $REVANA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"input": {
"prompt": "Flat-lay product photo of a matte black water bottle on a terracotta background, hard midday shadow. A small white card next to the bottle reads \"STAY COLD\" in black sans-serif letters.",
"resolution": "2K",
"aspect_ratio": "1:1"
},
"max_cost_usd": 0.1
}'
# 2. Poll with the id from step 1 until status is "succeeded" or "failed"
curl https://api.revana.si/v1/generations/gen_01JBX7Q2M4 \
-H "Authorization: Bearer $REVANA_API_KEY"import os
import time
import requests
API = "https://api.revana.si/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['REVANA_API_KEY']}"}
resp = requests.post(f"{API}/generations", headers=HEADERS, json={
"model": "gpt-image-2",
"input": {
"prompt": "Flat-lay product photo of a matte black water bottle on a terracotta background, hard midday shadow. A small white card next to the bottle reads \"STAY COLD\" in black sans-serif letters.",
"resolution": "2K",
"aspect_ratio": "1:1",
},
"max_cost_usd": 0.1,
})
resp.raise_for_status()
job = resp.json()
while job["status"] in ("queued", "running"):
time.sleep(5)
job = requests.get(f"{API}/generations/{job['id']}", headers=HEADERS).json()
if job["status"] == "succeeded":
print(job["output"]["urls"], job["cost_usd"])
else:
print("Failed:", job["error"])// Node 18 or later. Save as generate.mjs and run: node generate.mjs
const API = "https://api.revana.si/v1";
const headers = {
Authorization: `Bearer ${process.env.REVANA_API_KEY}`,
"Content-Type": "application/json",
};
const res = await fetch(`${API}/generations`, {
method: "POST",
headers,
body: JSON.stringify({
model: "gpt-image-2",
input: {
prompt: "Flat-lay product photo of a matte black water bottle on a terracotta background, hard midday shadow. A small white card next to the bottle reads \"STAY COLD\" in black sans-serif letters.",
resolution: "2K",
aspect_ratio: "1:1",
},
max_cost_usd: 0.1,
}),
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
let job = await res.json();
while (job.status === "queued" || job.status === "running") {
await new Promise((r) => setTimeout(r, 5000));
job = await (await fetch(`${API}/generations/${job.id}`, { headers })).json();
}
if (job.status === "succeeded") console.log(job.output.urls, job.cost_usd);
else console.error("Failed:", job.error);完了した生成結果です。画像のリンクは output.urls に入っています。リンクには有効期限があるため、ファイルは自分のストレージにコピーしてください:
{
"id": "gen_01JC4K2W9T",
"model": "gpt-image-2",
"status": "succeeded",
"output": {
"urls": [
"https://cdn.revana.si/g/gen_01JC4K2W9T/0.png"
]
},
"cost_usd": 0.03,
"attempts": 1,
"error": null,
"created_at": "2026-10-19T14:02:11Z",
"completed_at": "2026-10-19T14:02:29Z"
}自分の画像からバナーを作る
商品写真とロゴを image_urls として送信し、位置で指定して参照し、横長の比率を選びます。代わりに1枚の写真を編集する場合は、image_url として送信し、変更内容を説明します。
{
"model": "gpt-image-2",
"input": {
"prompt": "A website banner. The sneaker from the first image on the right, floating above a soft shadow. The logo from the second image at the top left. The words \"NEW SEASON\" in large white letters on a warm orange gradient. Keep the logo exactly as it is.",
"image_urls": [
"https://example.com/sneaker.png",
"https://example.com/logo.png"
],
"resolution": "2K",
"aspect_ratio": "5:2"
},
"max_cost_usd": 0.1
}GPT Image 2のプロンプトのコツ
- デザイナーに依頼するように指示する。被写体、背景、構図、照明、スタイル、そして文字の順に書きます。
- 文字は一字一句引用し、どこに入れて、どう見せるかを指定します。
- チャネルに合わせて比率を選ぶ。フィードは1:1、ストーリーズとリールは9:16、ヘッダーは16:9または21:9、バナーは5:2です。
- 入力画像に番号を付ける。複数の画像を送るときは、「2枚目の画像のロゴ」のように書けば、迷いがありません。
- 変えてはいけないものを伝える。編集では、変更する内容と同じくらい明確に、残すもの(顔、ラベル、ロゴ)を指定します。
- 校正する。公開する前に、すべての画像でスペルと小さな文字を確認します。
GPT Image 2とNano Banana Pro、どちらを選ぶ?
どちらも、テキストと入力画像から、4Kまでの画像を生成・編集でき、リクエスト形式も同じです。カタログ上の違いは次のとおりです:
| GPT Image 2 | Nano Banana Pro | |
|---|---|---|
| 開発元 | OpenAI | |
| 解像度 | 1K、2K、4K | 1K、2K、4K |
| アスペクト比 | 9 | 10 |
| 入力画像 | 最大16枚 | 最大14枚 |
| 最安価格 | $0.03 / 枚 | $0.04 / 枚 |
| ルート | 2ルート | 1ルート |
品質ランキングは公開していません。大切なプロンプトを両方で試してください。リクエスト形式が同じなので、切り替えは model を1語変更するだけです。Nano Banana Proについては、Nano Banana Proのガイドで同じ詳しさで解説しています。
ルーティングとフォールバック
GPT Image 2は、現在Revanaに2つのルートがあります。複数のルートを持つモデルでは、ルーターはまず最も安いルートを試し、失敗した場合は次に移ります。料金は常に掲載価格のままです。すべてのルートが失敗した場合、ジョブは failed で終了し、課金はありません。
failed のジョブに備えておきましょう。後で再試行するか、自分のコードで、別の model 文字列を持つ2つ目の画像モデルへフォールバックします。
すべての画像モデルはモデルページで確認でき、ドキュメントを読むか、APIキーを取得できます。
よくある質問
GPT Image 2 APIの料金はいくらですか?
2026年10月時点で、GPT Image 2は、1枚あたり1Kが$0.03、2Kが$0.03、4Kが$0.03です。1Kで100枚のバッチは$3.00です。
GPT Image 2はいつリリースされましたか?
OpenAIは2026年4月にGPT Image 2をリリースしました。APIのスナップショットは gpt-image-2-2026-04-21 です。
GPT Image 2は、どのサイズとアスペクト比に対応していますか?
サイズは1K、2K、4K、アスペクト比は1:1、3:4、4:3、2:3、3:2、9:16、16:9、21:9、5:2です。
GPT Image 2には、入力画像を何枚送れますか?
image_urls として最大16枚です。1枚の画像を編集する場合は、image_url として送信します。
GPT Image 2とNano Banana Proのどちらを使うべきですか?
自分のプロンプトで両方を試してください。カタログでは、GPT Image 2は最大16枚の入力画像と9種類のアスペクト比に対応し、Nano Banana Proは最大14枚と10種類に対応しています。どちらも4Kまで対応します。
GPT Image 1.5は、まだ利用できますか?
はい。料金はアスペクト比と品質によって異なり、2026年10月時点で1枚あたり$0.01から$0.14です。