> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jiekou.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT Image 2 画像編集

OpenAI GPT Image 2 画像編集 API。テキストプロンプトに基づいて画像を編集し、マスク修復、透明背景、およびさまざまな品質/サイズオプションに対応しています。

## リクエストヘッダー

<ParamField header="Content-Type" type="string" required={true}>
  列挙値: `application/json`
</ParamField>

<ParamField header="Authorization" type="string" required={true}>
  Bearer 認証形式: Bearer \{\{API Key}}。
</ParamField>

## リクエストボディ

<ParamField body="n" type="integer" default={1}>
  生成する画像の数。実際に返される数はリクエスト数より少ない場合があります。

  値の範囲：\[1, 10]
</ParamField>

<ParamField body="mask" type="string">
  追加画像。その完全に透明な領域が編集対象の位置を示します。alpha チャンネル付きの PNG 形式である必要があります。
</ParamField>

<ParamField body="size" type="string" default="1024x1024">
  生成画像のサイズ。

  選択可能な値：`auto`, `688x2048`, `880x2048`, `1024x1024`, `1024x1536`, `1024x2048`, `1152x2048`, `1360x2048`, `1536x1024`, `1536x2048`, `2048x688`, `2048x880`, `2048x1024`, `2048x1152`, `2048x1360`, `2048x1536`, `2048x2048`, `2160x3840`, `3840x2160`
</ParamField>

<ParamField body="image" type="string" required={true}>
  編集する画像。単一の画像 URL/base64、または画像配列を指定できます。対応形式：PNG、JPEG、GIF、WebP。
</ParamField>

<ParamField body="prompt" type="string" required={true}>
  必要な編集効果を説明するテキストプロンプト。最大長は 32000 文字です。

  長さ制限：0 - 32000
</ParamField>

<ParamField body="quality" type="string" default="low">
  生成画像の品質。品質が高いほど時間がかかり、コストも高くなります。

  選択可能な値：`low`, `medium`, `high`
</ParamField>

<ParamField body="background" type="string" default="auto">
  背景を不透明にするか、自動検出するか。

  選択可能な値：`opaque`, `auto`
</ParamField>

<ParamField body="output_format" type="string" default="png">
  出力画像形式。

  選択可能な値：`png`, `jpeg`
</ParamField>

## レスポンス情報

<ResponseField name="images" type="string[]" required={false}>
  生成された画像 URL の配列。
</ResponseField>
