Skip to content

gpt-image-2 画像生成モデル

  • 2026.04.20 当サイトはGPTの画像生成モデルgpt-image-2に対応しました。dall-eインターフェースで呼び出せます
  • 2025.12.17 当サイトはGPTの画像生成モデルgpt-image-1.5に対応しました。dall-eインターフェースで呼び出せます
  • 2025.04.24 当サイトはGPTの画像生成モデルgpt-image-1に対応しました。dall-eインターフェースで呼び出せます
  • 複数画像参照をサポート /v1/images/edits
  • 画像は入力・出力画像のトークンが課金されます

料金体系

  • 料金は input.text_token、input.image_token、ouput.image_token によって決定されます
  • (input.text_token*5 + input.image_token*10 + output.image_token*40)*7.1*10000/1000000 = ポイント
  • 1024*1024のlow品質の場合、約800ポイント消費します。medium品質の場合は約3000ポイントですので、品質を適切に選択してください
  • 料金参考 https://openai.com/api/pricing/ Image Generation API

リクエストパラメータ

パラメータ名必須説明
modelstringはいモデル名 gpt-image-2、gpt-image-1、gpt-image-1.5
promptstringはい画像の説明
nintegerいいえ生成する画像の数
sizestringいいえ出力サイズ、解像度形式またはauto(デフォルト)をサポート
qualitystringいいえ画質レベル:low、medium、high、auto(デフォルト)
imagefileいいえ画像編集の元画像 /v1/images/editsのみサポート
response_formatstringいいえレスポンス形式:b64_json または url(デフォルト)
  • size 制約

    • 最大辺長 ≤ 3840px
    • 両辺とも16の倍数である必要があります
    • 長辺と短辺の比率は3:1を超えないこと
    • 総ピクセル数範囲:655,360 ~ 8,294,400
  • 一般的なサイズの組み合わせ

比率sizeK
1:1 Square1024×10241K
1:1 Square2048×20482K
1:1 Square2880×28804K
16:9 Widescreen1280×7201K
16:9 Widescreen2048×11522K
16:9 Widescreen3840×21604K
9:16 Story720×12801K
9:16 Story1152×20482K
9:16 Story2160×38404K
5:4 Print1040×8321K
5:4 Print2080×16642K
5:4 Print3200×25604K
4:5 Feed832×10401K
4:5 Feed1664×20802K
4:5 Feed2560×32004K
4:3 Classic1024×7681K
4:3 Classic2048×15362K
4:3 Classic3264×24484K
3:4 Vertical768×10241K
3:4 Vertical1536×20482K
3:4 Vertical2448×32644K
3:2 Photo1008×6721K
3:2 Photo2064×13762K
3:2 Photo3504×23364K
2:3 Portrait672×10081K
2:3 Portrait1376×20642K
2:3 Portrait2336×35044K
21:9 Exclusive1344×5761K
21:9 Exclusive2016×8642K
21:9 Exclusive3808×16324K
参照画像に合わせて自動auto-

curl 実例

  • リクエストエントリーは /v1/images/generations/v1/images/edits をサポート

テキストから画像生成

shell
curl  https://api.openai-hk.com/v1/images/generations \
  -H 'Authorization: Bearer hk-替換為你的key' \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "a white siamese cat",
    "n": 1,
    "size": "1024x1024",
    "quality": "low"
  }'
curl  https://api.openai-hk.com/v1/images/generations \
  -H 'Authorization: Bearer hk-替換為你的key' \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "a white siamese cat",
    "n": 1,
    "size": "1024x1024",
    "quality": "low"
  }'

gpt-image-1

画像編集

shell
curl -X POST "https://api.openai-hk.com/v1/images/edits" \
  -H "Authorization: Bearer hk-替換為你的key" \
  -F "model=gpt-image-2" \
  -F "image[]=@body-lotion.png" \
  -F "image[]=@bath-bomb.png" \
  -F "image[]=@incense-kit.png" \
  -F "image[]=@soap.png" \
  -F 'prompt=Generate a photorealistic image of a gift basket on a white background labeled "Relax & Unwind" with a ribbon and handwriting-like font, containing all the items in the reference pictures'
curl -X POST "https://api.openai-hk.com/v1/images/edits" \
  -H "Authorization: Bearer hk-替換為你的key" \
  -F "model=gpt-image-2" \
  -F "image[]=@body-lotion.png" \
  -F "image[]=@bath-bomb.png" \
  -F "image[]=@incense-kit.png" \
  -F "image[]=@soap.png" \
  -F 'prompt=Generate a photorealistic image of a gift basket on a white background labeled "Relax & Unwind" with a ribbon and handwriting-like font, containing all the items in the reference pictures'

gpt-image-1

レスポンスデータ

json
{
  "created": 1776220106,
  "data": [
    {
      "revised_prompt": "你原來輸入prompt",
      "url": "https://myfile.addmao.com/20260427/d3272fe0-92c9-4f20-a50b-3114affc45c5.png",
      "b64_json": "data:image/png;base64 当response_format 參數為 b64_json 時返回"
    }
  ],
  "usage": {
    "input_tokens": 6,
    "input_tokens_details": {
      "image_tokens": 0,
      "text_tokens": 6
    },
    "output_tokens": 275,
    "total_tokens": 281
  }
}
{
  "created": 1776220106,
  "data": [
    {
      "revised_prompt": "你原來輸入prompt",
      "url": "https://myfile.addmao.com/20260427/d3272fe0-92c9-4f20-a50b-3114affc45c5.png",
      "b64_json": "data:image/png;base64 当response_format 參數為 b64_json 時返回"
    }
  ],
  "usage": {
    "input_tokens": 6,
    "input_tokens_details": {
      "image_tokens": 0,
      "text_tokens": 6
    },
    "output_tokens": 275,
    "total_tokens": 281
  }
}

オンラインテスト

注意

1.アクセス https://gpt4o.ddaiai.com/ (ブロックされている場合は、サブドメインプレフィックスをsuibianに変更してください)
2.ブロックされていることが判明した場合、アドレスを自分で変更できます https://suibian.ddaiai.comsuibian を他のものに変更してください。例:https://2025.ddaiai.com でもアクセス可能です

設定

  • 下図の対応する場所で設定してください
  • OpenAi インターフェースアドレス:https://api.openai-hk.com
  • OpenAi API KEY: hk-あなたのapiKey

cover

効果

入力ボックスで対話

抽象化、スタイル最適化

同時に画像+の場所で参照画像をアップロード

gpt-image-1