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

# GPT Image 2.6の新機能

> GPT Image 2.6 FlareおよびSunburstのモデル選択に加え、複雑さの制御、SVGベクター出力、アニメーションGIF、マークアップ指定編集、インタラクティブな例、実際の生成結果について解説します。

> [!NOTE]
>
> Playgroundには、**複雑なラスターPNG、SVG、および2フレームGIF**という3つの名前付きサンプルが用意されています。**Authorization**に`Bearer sk-xxx`を入力し、サンプルを選択してpromptを編集し、リクエストを送信してください。

> [!WARNING]
>
> `data[0].b64_json`には`data:`プレフィックスがなく、SVGおよびGIFのレスポンスもbase64エンコードされています。リクエストが成功した場合でも、ブラウザのPlaygroundでは長いbase64レスポンスを表示できないことがあります。以下のPythonサンプルを使用して、結果をローカルにデコードして保存してください。

## モデルの選択

GPT Image 2.6は2026-11-04にリリースされました。`/v1/images/generations`と`/v1/images/edits`を維持しつつ、複雑さの制御、SVG出力、アニメーションGIF出力、マークアップによる編集機能が追加されています。

| モデル | 特徴 | 最適な用途 |
| - | - | - |
| `gpt-image-2.6-flare` | 高速なイテレーション | 下書き、バッチ生成、ソーシャルコンテンツ、迅速なprompt比較 |
| `gpt-image-2.6-sunburst` | 詳細なビジュアル制作 | 複雑なレイアウト、高密度なテキスト、完成アセット、精密な編集 |

現在のtokenレートについては、[モデル料金一覧](https://docs.apiyi.com/ja/models/index.md)をご覧ください。実際のコストは、サイズ、品質、出力形式、およびtoken使用量によって異なります。また、SVGにはオーサリングモデルの料金も発生するため、そのコストは標準的なPNGと同列には比較できません。

## 新機能

> [card] [複雑度コントロール](#complexity-control-planning)
>
> 品質設定とは独立して、レンダリング前のプランニングを制御します。

> [card] [SVGベクター出力](#svg-generate-editable-vector-files)
>
> アイコン、イラスト、UIアセット向けに、編集可能なパス、シェイプ、カラーを返します。

> [card] [アニメーションGIF出力](#gif-generate-looping-animations)
>
> フレーム数とフレーム表示時間の制御により、1回のリクエストで完全なGIFを生成します。

> [card] [マークアップガイド編集](#markup-guided-edits)
>
> prompt で変更内容を記述しながら、透明なアノテーションレイヤーを使用して編集領域を特定します。

## complexity: プランニングの制御

`complexity`は、モデルがレンダリング前にどの程度プランニングを行うかを制御します。これは、密度の高いテキスト、複雑なレイアウト、オブジェクト間の関係性を処理することを想定しています。一方で`quality`はレンダリング品質を制御するため、これら2つの設定は異なる目的を果たします。

| 公式レベル | 推奨される用途 |
| - | - |
| `low` | ピンポイントの編集、シンプルな構図、素早いドラフト作成 |
| `medium` | 通常のレイアウトと複数の制約条件のバランス重視 |
| `high` | 密度の高いテキスト、複雑なレイアウト、オブジェクト間の関係性。complexityを省略した場合はデフォルトで使用されます |

complexityに追加料金はかかりません。レベルを高く設定すると、レイテンシが増加したり、意図しない変更が生じたりする可能性があります。高いレベルほど常に優れていると思い込まず、実際のタスクに応じて結果を比較してください。

> [accordion] アップストリームのテストメモ: 追加で受け入れられるレベル
>
> テスト時のアップストリームからのエラーレスポンスには`none`、`xhigh`、`max`もリストされており、現在のルートではこれらが受け入れられました。OpenAIの公開ガイドには`low / medium / high`が記載されています。長期的な互換性の保証として追加の値に依存するのではなく、本番環境のリクエストではそれらの公式レベルを使用してください。

## SVG: 編集可能なベクターファイルの生成

`output_format: "svg"` を設定します。現在の上流では、ベクターコードを作成するテキストモデルを選択するために、ネストされた `svg.model` フィールドも必要です:

```json theme={null}
{
  "model": "gpt-image-2.6-sunburst",
  "prompt": "A minimal flat vector icon of a rocket, exactly three solid colors, geometric editable shapes, no text, no raster texture, transparent background.",
  "output_format": "svg",
  "svg": {
    "model": "gpt-5.6-terra"
  },
  "quality": "low",
  "size": "1024x1024",
  "n": 1
}
```

![赤色のフィン、青色の窓、白い機体を持つベクターのロケットアイコン](https://mintcdn.com/apiyillc/I9X_C01jz8OkWw6c/images/gpt-image-2-6/rocket.svg?fit=max\&auto=format\&n=I9X_C01jz8OkWw6c\&q=85\&s=c2dc54229ae6495d2926adcc44513fa4)

A real SVG generated through APIYI's passthrough route: editable path and circle elements

### 作成モデルの選択と課金

クライアントが `svg.model` を指定します。APIYI がランダムに選択することはありません。サポートされるモデルのセットは上流および現在のグループに依存するため、すべての OpenAI テキストモデルでのサポートが保証されているわけではありません。このページでは `gpt-5.6-terra`、`gpt-6-luna`、および `gpt-4.1-mini` を検証しています。その他のモデルは実際のグループでテストしてください。作成料金には、選択したテキストモデルの入力および出力 token レートが適用されます:

* 作成コスト = `svg_usage.input_tokens` × 入力レート + `svg_usage.output_tokens` × 出力レート。
* 合計SVGコスト = 参照画像コスト + 作成モデルコスト。テキストモデルがSVGを作成する前に、画像モデルが参照画像を生成します。
* 成功したレスポンスには `usage` と `svg_usage` の両方が含まれます: `usage` は参照画像を対象とし、`svg_usage` は作成モデルを対象とします。両方がコストに寄与します。
* `svg_usage.reasoning_tokens` はすでに `svg_usage.output_tokens` に含まれています。二重に加算しないでください。

2026-11-05 に `gpt-image-2.6-sunburst` および `gpt-5.6-terra` を使用した APIYI パススルーテストでは、レスポンスに以下の usage フィールドが含まれていました:

```json theme={null}
{
  "output_format": "svg",
  "usage": {
    "input_tokens": 100,
    "output_tokens": 824,
    "total_tokens": 924
  },
  "svg_usage": {
    "model": "gpt-5.6-terra",
    "input_tokens": 1572,
    "output_tokens": 850,
    "reasoning_tokens": 350,
    "total_tokens": 2422
  }
}
```

100万入力 tokens あたり \$2、100万出力 tokens あたり \$12 という `gpt-5.6-terra` の現在のディレクトリレートを使用すると、参照画像の料金を除いた推定作成料金は `1572 ÷ 1000000 × 2 + 850 ÷ 1000000 × 12 = \$0.013344` です。

同じ prompt を使用して、以下の作成モデルをテストしました。いずれもスクリプト、埋め込みラスター画像、または外部リンクを含まない本物のSVGを返しました:

| `svg.model` | 結果 | 入力 / 出力 tokens | 推論 tokens | 所要時間 | 推定作成料金 |
| - | - | -: | -: | -: | -: |
| `gpt-5.6-terra` | 合格 | 1,572 / 850 | 350 | 29.196s | \$0.013344 |
| `gpt-6-luna` | 合格 | 1,572 / 1,618 | 1,110 | 53.436s | \$0.0009662 |
| `gpt-4.1-mini` | 合格 | 2,005 / 513 | 0 | 23.777s | \$0.0016228 |

3つのリクエストはすべて同じ参照画像の usage を報告しました: 入力 100、出力 824、合計 924 tokens であり、個別に課金されます。`gpt-4.1-mini` に対するレスポンスモデル名は `gpt-4.1-mini-2025-04-14` でした。価格は変更される可能性があり、階層レートはグループによって異なる場合があります。実際の料金については、[モデル料金ディレクトリ](https://docs.apiyi.com/ja/models/index.md)および請求書をご確認ください。モデルごとに1枚の画像のみでの検証であるため、品質ランキングを示すものではありません。

### 制限事項

* SVG は `n=1` を指定した `/v1/images/generations` 経由でのみ利用可能です。編集エンドポイントは SVG 出力やラスター入力としての SVG をサポートしていません。
* ストリーミング、部分画像、`output_compression`、および `prompt_rewriter` はサポートされていません。
* 生成結果は、スクリプト、外部リソース、埋め込みラスター画像を含まない静的なベクター XML です。PNG ではなく `.svg` としてデコードして保存してください。

## GIF: ループアニメーションの生成

`output_format: "gif"` を設定し、prompt 内で被写体、動き、およびループについて記述します。この低コストなサンプルでは、**各フレーム 100ms の 2 フレーム、合計時間 0.2 秒**が生成されます:

```json theme={null}
{
  "model": "gpt-image-2.6-sunburst",
  "prompt": "A minimal two-frame looping animation of a yellow circle moving slightly right and returning to its starting position on a plain white background, no text, seamless loop.",
  "output_format": "gif",
  "quality": "low",
  "size": "512x512",
  "frame_count": 2,
  "frame_duration_ms": 100,
  "n": 1
}
```

![右に移動して元の位置に戻る黄色い円の2フレームループアニメーション](https://mintcdn.com/apiyillc/I9X_C01jz8OkWw6c/images/gpt-image-2-6/two-frame-loop.gif?s=d010bf9dbb9b5c3a3e9b915bb2164a3d)

A real GIF generated through APIYI's passthrough route: 2 frames and 0.2 seconds

| パラメータ | 公式の範囲とデフォルト値 | 備考 |
| - | - | - |
| `frame_count` | 2–64、デフォルトは 9 | フレーム数が増えると、一般的にレイテンシとコストが増加します |
| `frame_duration_ms` | 20–2000ms、デフォルトは 200ms、10ms 単位に丸め処理 | 合計時間はおよそフレーム数 × フレーム表示時間になります |
| `size` | `auto` または有効な WIDTHxHEIGHT | 完成した各フレームのサイズ。フレーム数、フレームサイズ、総ピクセルバジェットのすべてが制限内に収まる必要があります |

GIF は生成専用であり、ストリーミング、部分画像、カスタム `output_compression`、または `prompt_rewriter` はサポートしていません。PNG、JPEG、WebP、または SVG で `frame_count` や `frame_duration_ms` を使用しないでください。

### 実際のフレーム数を確認する

HTTP 200 やレスポンスの `output_format` だけを信頼しないでください。ルートによってフレーム関連フィールドが欠落した場合でも、デフォルトの 9 フレーム、1.8 秒の GIF が返送されることがあります。`ffprobe` を使用して実際のファイルを検査してください:

```bash theme={null}
ffprobe -v error -select_streams v:0 -count_frames \
  -show_entries stream=codec_name,width,height,nb_read_frames,duration \
  -of json result.gif
```

このサンプルの場合、`nb_read_frames=2` および `duration=0.200000` となることが期待されます。

## マークアップによる編集

GPT Image 2.6は、`/v1/images/edits`の`markup`フィールドを介したマークアップによる編集にも対応しています：

1. 元の画像を最初の入力として保持します。
2. 同じ寸法の透明なPNGを作成し、変更したい領域の周囲に丸、矢印、スケッチを追加します。
3. その注釈レイヤーを`markup`としてアップロードし、変更内容と保持したい詳細を`prompt`に記述します。
4. マークアップは最初の入力画像に適用され、`mask`や`prompt_rewriter`と組み合わせることはできません。

通常の編集、複数画像の合成、およびマスクについては、[Image Edit API](https://docs.apiyi.com/ja/api-capabilities/gpt-image-2/image-edit.md)を参照してください。マークアップの転送は対象ルート上で個別に検証する必要があります。このページではテスト済みのインタラクティブな例としては提示していません。

## クライアント側でのデコード

すべての出力フォーマットで`data[0].b64_json`が使用され、異なるのはファイル拡張子のみです：

```python theme={null}
import base64
from pathlib import Path

payload = response.json()
fmt = payload["output_format"]
raw = base64.b64decode(payload["data"][0]["b64_json"])
Path(f"result.{fmt}").write_bytes(raw)
```

SVGはUTF-8 XMLにデコードされますが、GIFおよびラスター形式はバイナリファイルにデコードされます。本番環境のコードでは、拡張子のみを信頼するのではなく、HTTPステータス、`error`フィールド、および実際のファイルシグネチャも確認する必要があります。

## ルートの互換性とトラブルシューティング

> [!WARNING]
>
> 新しい2.6のフィールドには、ネイティブなJSONパススルーが必要です。互換性はアップストリームのルートによって異なる場合があり、これらの公開されている例はすべてのグループで同一の動作を保証するものではありません。アカウントが実際に使用しているグループで検証してください。

| 症状 | 最初に確認すべきこと |
| - | - |
| 提供されているにもかかわらず `SVG generation requires 'svg.model'` が発生する | ルートがネストされた `svg` オブジェクトをフィルタリングまたは書き換えていないかどうか |
| 100msで2フレームのリクエストに対し、9フレームかつ1.8秒が返される | `frame_count` と `frame_duration_ms` がドロップされ、デフォルト値が優先されていないかどうか |
| 無効な複雑さの文字列でも200が返される | バリデーションの動作はアップストリームによって異なる場合があります。これ単体ではフィールドがドロップされたことを証明するものではありません。有効なレベルでの動作と比較し、アップストリームのログを調査してください |
| Playgroundに `unable to complete request` が表示される | レスポンスが実際に200であったか確認してください。長いbase64はブラウザの表示容量を超える可能性があるため、ローカルでデコードしてください |
| SVGのコストが想定より高い | 参照画像のtokensだけでなく、`usage` と `svg_usage` の両方を確認してください |

## 関連ドキュメント

* [GPT-Image-2.5 / 2 概要](https://docs.apiyi.com/ja/api-capabilities/gpt-image-2/overview.md)
* [標準 Text-to-Image プレイグラウンド](https://docs.apiyi.com/ja/api-capabilities/gpt-image-2/text-to-image.md)
* [画像編集プレイグラウンド](https://docs.apiyi.com/ja/api-capabilities/gpt-image-2/image-edit.md)
* [画像 API の基本とベストプラクティス](https://docs.apiyi.com/ja/api-capabilities/image-api-best-practices.md)
* [モデル料金一覧](https://docs.apiyi.com/ja/models/index.md)


## OpenAPI

````yaml api-reference/gpt-image-2-6-generate-openapi-en.yaml POST /v1/images/generations
openapi: 3.1.0
info:
  title: GPT Image 2.6 Text-to-Image and New Capabilities API
  description: >
    Text-to-image with OpenAI `gpt-image-2.6-flare` / `gpt-image-2.6-sunburst`,
    including raster images, complexity control, SVG vector output, and animated
    GIF output.


    - Complexity: official low / medium / high levels, default high, with no
    separate fee

    - SVG: set output_format=svg and provide svg.model; generations only, n=1

    - GIF: set output_format=gif and optionally frame_count and
    frame_duration_ms

    - Responses contain data[0].b64_json for client-side base64 decoding


    **Authentication**: Add `Authorization: Bearer YOUR_API_KEY` to request
    headers


    **Get an API Key**: Visit the [APIYI Console](https://api.apiyi.com/token)
  version: 1.0.0
servers:
  - url: https://api.apiyi.com
    description: Primary endpoint
security:
  - bearerAuth: []
paths:
  /v1/images/generations:
    post:
      tags:
        - GPT Image 2.6
      summary: 'GPT Image 2.6: generate PNG, SVG, or GIF'
      description: >
        Generate images from text prompts with GPT Image 2.6. The three named
        request examples demonstrate complexity, SVG, and GIF.


        Complexity controls planning before rendering and is independent of
        rendering quality. SVG requires the nested svg.model field. GIF frame
        controls apply only when output_format=gif. SVG and GIF do not support
        streaming, partial images, or output_compression.
      operationId: generateGptImage26
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Image26Request'
            examples:
              complexityPng:
                summary: Raster PNG + low complexity
                description: >-
                  Use a four-panel infographic to inspect complexity;
                  quality=low controls cost
                value:
                  model: gpt-image-2.6-sunburst
                  prompt: >-
                    A clean 2x2 technical infographic on a white background.
                    Top-left: a red circle labeled 'A'. Top-right: a blue square
                    labeled 'B'. Bottom-left: a green triangle labeled 'C'.
                    Bottom-right: a yellow hexagon labeled 'D'. A black arrow
                    connects A to B to C to D in that order. Exactly four
                    labels, balanced grid, no other text.
                  output_format: png
                  complexity: low
                  quality: low
                  size: 1024x1024
                  'n': 1
              svgVector:
                summary: SVG vector icon
                description: >-
                  Keep the nested svg.model object; the response also contains
                  svg_usage
                value:
                  model: gpt-image-2.6-sunburst
                  prompt: >-
                    A minimal flat vector icon of a rocket, exactly three solid
                    colors, geometric editable shapes, no text, no raster
                    texture, transparent background.
                  output_format: svg
                  svg:
                    model: gpt-5.6-terra
                  quality: low
                  size: 1024x1024
                  'n': 1
              gifAnimation:
                summary: Two-frame looping GIF
                description: >-
                  The finished file should contain 2 frames and last 0.2
                  seconds, not the default 9 frames
                value:
                  model: gpt-image-2.6-sunburst
                  prompt: >-
                    A minimal two-frame looping animation of a yellow circle
                    moving slightly right and returning to its starting position
                    on a plain white background, no text, seamless loop.
                  output_format: gif
                  quality: low
                  size: 512x512
                  frame_count: 2
                  frame_duration_ms: 100
                  'n': 1
      responses:
        '200':
          description: >-
            Generation succeeded; returns base64-encoded PNG, JPEG, WebP, SVG,
            or GIF
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Image26Response'
        '400':
          description: >-
            Invalid parameters, or the active route did not forward new fields
            such as svg.model
        '401':
          description: Unauthorized - invalid API Key
        '403':
          description: Content moderation block
        '429':
          description: Rate limit or insufficient quota
        '500':
          description: Internal server error
      security:
        - bearerAuth: []
components:
  schemas:
    Image26Request:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: >-
            Flare is optimized for fast iteration; Sunburst is intended for
            detailed visual work
          enum:
            - gpt-image-2.6-flare
            - gpt-image-2.6-sunburst
          default: gpt-image-2.6-sunburst
        prompt:
          type: string
          maxLength: 32000
          description: >-
            Prompt text in English or Chinese. For GIF, describe the subject,
            motion, and loop
          example: A minimal flat vector icon of a rocket, three solid colors, no text
        complexity:
          type: string
          description: >-
            Planning complexity before rendering, independent of quality.
            Official levels are low / medium / high, with high as the default
            when omitted. No separate fee
          enum:
            - low
            - medium
            - high
          default: high
        size:
          type: string
          description: >-
            Output size as a preset or a valid WIDTHxHEIGHT string. The GIF
            example uses 512x512; frame count, frame size, and the total pixel
            budget must all fit
          example: 1024x1024
          default: auto
        quality:
          type: string
          description: >-
            Rendering quality, independent of complexity. For SVG, controls the
            reference image quality
          enum:
            - auto
            - low
            - medium
            - high
            - xhigh
            - max
          default: auto
        output_format:
          type: string
          description: >-
            Output format. SVG and GIF are generation-only and do not support
            edits, streaming, partial images, or output_compression
          enum:
            - png
            - jpeg
            - webp
            - svg
            - gif
          default: png
        output_compression:
          type: integer
          description: Compression level for jpeg / webp only; do not use with SVG or GIF
          minimum: 0
          maximum: 100
          example: 85
        background:
          type: string
          description: >-
            Background mode. transparent requires a compatible output format;
            JPEG does not support transparency
          enum:
            - auto
            - opaque
            - transparent
          default: auto
        moderation:
          type: string
          description: Moderation strength
          enum:
            - auto
            - low
          default: auto
        'n':
          type: integer
          description: Number of results. The examples and SVG output use 1
          enum:
            - 1
          default: 1
        svg:
          type: object
          description: >-
            SVG-specific configuration. The current upstream requires svg.model
            when output_format=svg
          properties:
            model:
              type: string
              description: >-
                Text model that authors the SVG vector code. Verified with
                gpt-5.6-terra, gpt-6-luna, and gpt-4.1-mini; test other models
                in your actual group. The example uses gpt-5.6-terra
              example: gpt-5.6-terra
              default: gpt-5.6-terra
          required:
            - model
        frame_count:
          type: integer
          description: >-
            GIF frame count. Official documented range: 2–64; default: 9. Only
            valid when output_format=gif
          minimum: 2
          maximum: 64
          default: 9
          example: 2
        frame_duration_ms:
          type: integer
          description: >-
            Duration of each GIF frame in milliseconds, 20–2000, rounded to
            10ms; default 200. Only valid when output_format=gif
          minimum: 20
          maximum: 2000
          default: 200
          example: 100
    Image26Response:
      type: object
      properties:
        created:
          type: integer
          description: Unix timestamp
        background:
          type: string
          description: Effective background mode
          example: opaque
        data:
          type: array
          description: Generated results
          items:
            type: object
            properties:
              b64_json:
                type: string
                description: >-
                  Raw base64 without a data: prefix. Save using output_format;
                  SVG decodes to UTF-8 XML
              generation_id:
                type: string
                description: Generation ID, when provided
        output_format:
          type: string
          example: gif
        quality:
          type: string
          example: low
        size:
          type: string
          example: 512x512
        usage:
          $ref: '#/components/schemas/ImageUsage'
        svg_usage:
          $ref: '#/components/schemas/SvgUsage'
    ImageUsage:
      type: object
      description: Token usage for the image model
      properties:
        input_tokens:
          type: integer
          example: 59
        output_tokens:
          type: integer
          example: 555
        total_tokens:
          type: integer
          example: 614
        input_tokens_details:
          type: object
          properties:
            text_tokens:
              type: integer
              example: 59
            image_tokens:
              type: integer
              example: 0
        output_tokens_details:
          type: object
          properties:
            text_tokens:
              type: integer
              example: 0
            image_tokens:
              type: integer
              example: 555
    SvgUsage:
      type: object
      description: >-
        Authoring-model usage returned for SVG output. The client selects the
        model through svg.model, and charges use that text model's input and
        output token rates. reasoning_tokens is already included in
        output_tokens and must not be added again
      properties:
        model:
          type: string
          example: gpt-5.6-terra
        input_tokens:
          type: integer
          example: 1572
        output_tokens:
          type: integer
          example: 850
        reasoning_tokens:
          type: integer
          example: 350
        total_tokens:
          type: integer
          example: 2422
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API Key obtained from the APIYI Console

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.