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

# GPT Image 2画像生成Beta

> - GPT Image 2（gpt-image-2-beta）モデルはテキストから画像、画像から画像、画像編集モードに対応
- 非同期処理モード、返却されたタスクIDで[ステータスを照会](/ja/api-manual/task-management/get-task-detail)
- 生成された画像リンクは24時間有効です、お早めに保存してください

**サイズ対応:**
- 現在は `size=auto`、または比率サイズ（例：`size="1:1"`）と `resolution="1K"` の組み合わせのみ対応
- `size=auto` の場合、`resolution` フィールドは無視され、1K として扱われます
- `resolution="2K"` / `resolution="4K"` および明示的なピクセルサイズ（例：`1024x1024`）は現在サポートされていません
- 2K、4K、または明示的なピクセル制御が必要な場合は [gpt-image-2](/ja/api-manual/image-series/gpt-image-2/gpt-image-2-image-generation) を使用してください

**課金（per_call）：**
- 1K 単一ティアで課金
- `n` は 1 に固定。`quality` はこのチャネルでは公開されません



## OpenAPI

````yaml ja/api-manual/image-series/gpt-image-2/gpt-image-2-beta-image-generation.json POST /v1/images/generations
openapi: 3.1.0
info:
  title: gpt-image-2-beta API
  description: AIモデルを使用して画像タスクを作成、複数のモデルとパラメータ設定に対応
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.evolink.ai
    description: 本番環境
security:
  - bearerAuth: []
tags:
  - name: 画像生成
    description: AI画像生成API
paths:
  /v1/images/generations:
    post:
      tags:
        - 画像生成
      summary: gpt-image-2-beta API
      description: >-
        - GPT Image 2（gpt-image-2-beta）モデルはテキストから画像、画像から画像、画像編集モードに対応

        -
        非同期処理モード、返却されたタスクIDで[ステータスを照会](/ja/api-manual/task-management/get-task-detail)

        - 生成された画像リンクは24時間有効です、お早めに保存してください


        **サイズ対応:**

        - 現在は `size=auto`、または比率サイズ（例：`size="1:1"`）と `resolution="1K"` の組み合わせのみ対応

        - `size=auto` の場合、`resolution` フィールドは無視され、1K として扱われます

        - `resolution="2K"` / `resolution="4K"`
        および明示的なピクセルサイズ（例：`1024x1024`）は現在サポートされていません

        - 2K、4K、または明示的なピクセル制御が必要な場合は
        [gpt-image-2](/ja/api-manual/image-series/gpt-image-2/gpt-image-2-image-generation)
        を使用してください


        **課金（per_call）：**

        - 1K 単一ティアで課金

        - `n` は 1 に固定。`quality` はこのチャネルでは公開されません
      operationId: createImageGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
            examples:
              text_to_image:
                summary: テキストから画像（デフォルト auto / 1K ティア）
                value:
                  model: gpt-image-2-beta
                  prompt: A beautiful colorful sunset over the ocean
              ratio_landscape:
                summary: 横長比率 + 1K（16:9 / 1K）
                value:
                  model: gpt-image-2-beta
                  prompt: A beautiful colorful sunset over the ocean
                  size: '16:9'
                  resolution: 1K
              ratio_portrait:
                summary: 縦長比率 + 1K（9:16 / 1K）
                value:
                  model: gpt-image-2-beta
                  prompt: A beautiful colorful sunset over the ocean
                  size: '9:16'
                  resolution: 1K
      responses:
        '200':
          description: 画像タスクの作成に成功しました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
        '400':
          description: リクエストパラメータが不正です
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_request
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 未認証、トークンが無効または期限切れです
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: クォータ不足のため、チャージが必要です
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: insufficient_quota
                  message: Insufficient quota. Please top up your account.
                  type: insufficient_quota
        '403':
          description: アクセスが拒否されました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: model_access_denied
                  message: 'Token does not have access to model: gpt-image-2-beta'
                  type: invalid_request_error
        '429':
          description: レート制限を超えました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: rate_limit_exceeded
                  message: Too many requests, please try again later
                  type: rate_limit_error
        '500':
          description: サーバー内部エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: internal_error
                  message: Internal server error
                  type: api_error
components:
  schemas:
    ImageGenerationRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: 画像生成モデル名
          enum:
            - gpt-image-2-beta
          default: gpt-image-2-beta
          example: gpt-image-2-beta
        prompt:
          type: string
          description: 生成したい画像を説明するプロンプト、または入力画像の編集方法を説明するプロンプト。2000トークンまで
          example: A beautiful colorful sunset over the ocean
          maxLength: 2000
        size:
          type: string
          description: >-
            生成画像のサイズ。2つのモードに対応しています：


            **1. `auto`（デフォルト）**


            モデルが出力サイズを自動的に決定します。この場合、`resolution` フィールドは無視され、1K として扱われます。


            **2. 比率（`resolution="1K"` と組み合わせて使用）**


            - `1:1`：正方形

            - `3:2` / `2:3`：横長 / 縦長

            - `4:3` / `3:4`：横長 / 縦長

            - `5:4` / `4:5`：横長 / 縦長

            - `16:9` / `9:16`：ワイドスクリーン横長 / 縦長

            - `21:9` / `9:21`：ウルトラワイド横長 / 縦長

            - `2:1` / `1:2`：横長 / 縦長

            - `3:1` / `1:3`：パノラマ横長 / 縦長（最大アスペクト比）


            **注:** 明示的なピクセルサイズ（例：`1024x1024`）は現在サポートされていません。明示的なピクセル制御が必要な場合は
            [gpt-image-2](/ja/api-manual/image-series/gpt-image-2/gpt-image-2-image-generation)
            を使用してください。
          default: auto
          example: '16:9'
        resolution:
          type: string
          description: >-
            解像度ティア。`size` が比率の場合のみ有効で、現在は `1K` のみサポートされています。


            **無視される条件：**

            - `size=auto` の場合、このフィールドは無視され、1K として扱われます（このパラメータを渡す必要はありません）


            **横長/正方形の出力寸法**（縦長は横長の幅/高さを入れ替えたもの）：


            | 比率 | 1K |

            |---|---|

            | `1:1` | 1024×1024 |

            | `2:1` | 1456×720 |

            | `3:1` | 1776×592 |

            | `3:2` | 1248×832 |

            | `4:3` | 1184×880 |

            | `5:4` | 1152×912 |

            | `16:9` | 1360×768 |

            | `21:9` | 1568×672 |


            **注:** `2K` / `4K` は現在サポートされていません。より高い解像度が必要な場合は
            [gpt-image-2](/ja/api-manual/image-series/gpt-image-2/gpt-image-2-image-generation)
            を使用してください。
          enum:
            - 1K
          default: 1K
          example: 1K
        image_urls:
          type: array
          description: >-
            画像から画像への変換および画像編集機能のための参照画像URLリスト


            **注意:**

            - リクエストあたり最大 `16` 枚の参照画像

            - サポート形式: `.jpeg`, `.jpg`, `.png`, `.webp`

            -
            画像URLはサーバーから直接アクセス可能であるか、直接ダウンロードをトリガーするURL（通常、`.png`、`.jpg`などの画像拡張子で終わるURL）
          items:
            type: string
            format: uri
          example:
            - https://example.com/image1.png
            - https://example.com/image2.png
          maxItems: 16
        callback_url:
          type: string
          description: |-
            タスク完了時のHTTPSコールバックURL

            **コールバックタイミング:**
            - タスクが完了、失敗、またはキャンセルされた時にトリガー
            - 課金確認後に送信

            **セキュリティ制限:**
            - HTTPSプロトコルのみ
            - 内部IPアドレスは禁止（127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x など）
            - URLの長さは`2048`文字以下

            **コールバックメカニズム:**
            - タイムアウト: `10`秒
            - 失敗後最大`3`回リトライ（失敗後`1`/`2`/`4`秒）
            - コールバックレスポンス形式はタスク照会APIと一致
            - 2xxステータスコードは成功とみなされ、その他のコードはリトライをトリガー
          format: uri
          example: https://your-domain.com/webhooks/image-task-completed
    ImageGenerationResponse:
      type: object
      properties:
        created:
          type: integer
          description: タスク作成タイムスタンプ
          example: 1757156493
        id:
          type: string
          description: タスク ID
          example: task-unified-1757156493-imcg5zqt
        model:
          type: string
          description: 使用された実際のモデル名
          example: gpt-image-2-beta
        object:
          type: string
          enum:
            - image.generation.task
          description: タスクオブジェクトタイプ
        progress:
          type: integer
          description: タスク進捗率（0-100）
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: タスクステータス
          enum:
            - pending
            - processing
            - completed
            - failed
          example: pending
        task_info:
          $ref: '#/components/schemas/TaskInfo'
          description: 非同期タスク情報
        type:
          type: string
          enum:
            - text
            - image
            - audio
            - video
          description: タスク出力タイプ
          example: image
        usage:
          $ref: '#/components/schemas/Usage'
          description: 使用量と課金情報
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: エラーコード識別子
            message:
              type: string
              description: エラーの説明
            type:
              type: string
              description: エラータイプ
    TaskInfo:
      type: object
      properties:
        can_cancel:
          type: boolean
          description: タスクをキャンセルできるかどうか
          example: true
        estimated_time:
          type: integer
          description: 推定完了時間（秒）
          minimum: 0
          example: 100
    Usage:
      type: object
      description: 使用量と課金情報
      properties:
        billing_rule:
          type: string
          description: 課金ルール
          enum:
            - per_call
            - per_token
            - per_second
          example: per_call
        credits_reserved:
          type: number
          description: 推定クレジット消費量
          minimum: 0
          example: 2.5
        user_group:
          type: string
          description: ユーザーグループカテゴリ
          example: default
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ## すべてのAPIにBearer Token認証が必要です ##

        **APIキーの取得：**

        [APIキー管理ページ](https://evolink.ai/dashboard/keys)にアクセスしてAPIキーを取得してください

        **リクエストヘッダーに追加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````