コンテンツへスキップ

GPT Image 2 API

統合

モデルID openai/gpt-image-2
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://vit.doitong.com/api/v1/run/openai/gpt-image-2?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://vit.doitong.com/api/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

このリクエスト: ≈$0.106 106 APIクレジット このページで実行

APIキーを取得
OpenAI テキストから画像 #gpt-image-2#openai#typography#chatgpt-images-2

微細なタイポグラフィ向けのGPT Image 2テキスト画像生成。1辺最大3840pxの柔軟なサイズに対応

OpenAI · 画像

最初の結果がここに表示されます

以下でリクエストを作成し、APIキーで実行してください。出力はストレージにコピーされ、永久保存または無料で7日保存されます。

リクエストを作成

コントロールはモデルスキーマから生成されます。値を変更するとコードと価格が更新されます。

•必須 88 / 32000

画像生成に使用したプロンプト。

image_size デフォルト landscape_4_3

出力寸法にはプリセット名、{width, height}オブジェクト、またはモデルが最適なサイズを選ぶ'auto'を指定できます。具体的なサイズはすべて16で割り切れる必要があり、各辺は3840px以下、アスペクト比は3:1以下、総画素数は655,360~8,294,400である必要があります。

num_images デフォルト 1

生成する画像数。

詳細設定 background · quality · output_format · enable_safety_checker
background デフォルト auto

生成画像の背景。

quality デフォルト high

画像品質の選択。'auto'では、プロンプトに応じてモデルが最適な品質を選択します。

output_format デフォルト png

出力画像のファイル形式。

POST /run/openai/gpt-image-2?wait=20 見積もり → $0.106
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://vit.doitong.com/api/v1/run/openai/gpt-image-2?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://vit.doitong.com/api/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

このリクエストを実行

キーはこのブラウザ内に保持されます。Doitong APIにのみ送信され、「記憶する」にチェックを入れた場合のみlocalStorageに保存されます。 APIキーを取得

GPT Image 2 APIについて

最大32000文字のプロンプトから画像を生成します。`image_size` はプリセット、auto、または幅と高さの明示指定に対応し、両方の寸法は16の倍数、最大辺は3840pxである必要があります。品質は auto、low、medium、high から選択でき、1回の呼び出しでpng、jpeg、webpの画像を最大4枚生成できます。

パラメータ

正式名称またはネイティブ名のいずれか一方を送信してください。両方は送信しないでください。 正式名称

名前型 デフォルト許可される値 説明
prompt必須
型string
≤ 32,000文字≥ 2文字
画像生成に使用したプロンプト。
image_size任意
型object
デフォルトlandscape_4_3
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9auto
出力寸法にはプリセット名、{width, height}オブジェクト、またはモデルが最適なサイズを選ぶ'auto'を指定できます。具体的なサイズはすべて16で割り切れる必要があり、各辺は3840px以下、アスペクト比は3:1以下、総画素数は655,360~8,294,400である必要があります。
background任意
型enum
デフォルトauto
autotransparentopaque
生成画像の背景。
quality任意
型enum
デフォルトhigh
autolowmediumhigh
画像品質の選択。'auto'では、プロンプトに応じてモデルが最適な品質を選択します。
num_images任意 num_outputs
型integer
デフォルト1
1 – 4
生成する画像数。
output_format任意
型enum
デフォルトpng
jpegpngwebp
出力画像のファイル形式。
enable_safety_checker任意
型boolean
デフォルトtrue
呼び出し元に権限がある場合、false に設定するとスクリーニングを緩和できます。
必須 正式名称(こちらも使用可能)

出力

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "openai/gpt-image-2",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 106,
    "usd": "0.106",
    "charged": 106,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  },
  "output": {
    "images": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200,
        "width": 1024,
        "height": 768
      }
    ]
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://vit.doitong.com/api/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://vit.doitong.com/api/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
ファイルの保存期間を選択すべてのoutputs[].urlはストレージ上のコピーです。アカウント設定または?storage=により、永久保存(GB・月単位で有料)または無料で7日保存できます。
すべてのモデルで同じ形式画像、動画、音声のいずれでも、type、url、content_type、width、height、durationが含まれます。outputはモデル独自の結果オブジェクトです。
出力フィールド
images
array of object {url, content_type, file_name, file_size, width, height}モデルが生成した画像。

その他のモデル: テキストから画像

AIエージェント向け:このページのMarkdown版はこちらです: https://doitong.com/ja/developers/models/openai/gpt-image-2.md. すべてのモデルとガイド: https://doitong.com/developers/llms.txt