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

# GPT-5.2 - 完全なAPIリファレンス

> - OpenAI SDK形式でGPT-5.2モデルを呼び出し
- 同期処理モード、リアルタイムレスポンス
- **テキスト会話**: シングルターンまたはマルチターンのコンテキスト対話
- **システムプロンプト**: AIのロールと動作をカスタマイズ
- **マルチモーダル入力**: テキスト+画像の混合入力をサポート
- クイックスタートは[クイックスタートガイド](./gpt-5.2-quickstart)をご確認ください

<Note>
  **BaseURL**：デフォルトの BaseURL は `https://direct.evolink.ai` で、テキストモデルへの対応が優れており、長時間接続をサポートします。`https://api.evolink.ai` はマルチモーダルの主力エンドポイントで、テキストモデルに対しては代替アドレスとして使用されます。
</Note>


## OpenAPI

````yaml ja/api-manual/language-series/gpt-5.2/gpt-5.2-reference.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: GPT-5.2完全なAPIリファレンス
  description: GPT-5.2 チャットインターフェースの完全なAPIリファレンス、全パラメータと高度な機能を含む
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: 本番環境（推奨）
  - url: https://api.evolink.ai
    description: 代替 URL
security:
  - bearerAuth: []
tags:
  - name: チャット補完
    description: AIチャット補完関連エンドポイント
paths:
  /v1/chat/completions:
    post:
      tags:
        - チャット補完
      summary: GPT-5.2 チャットインターフェース
      description: |-
        - OpenAI SDK形式でGPT-5.2モデルを呼び出し
        - 同期処理モード、リアルタイムレスポンス
        - **テキスト会話**: シングルターンまたはマルチターンのコンテキスト対話
        - **システムプロンプト**: AIのロールと動作をカスタマイズ
        - **マルチモーダル入力**: テキスト+画像の混合入力をサポート
        - クイックスタートは[クイックスタートガイド](./gpt-5.2-quickstart)をご確認ください
      operationId: createChatCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              simple_text:
                summary: シングルターンテキスト会話
                value:
                  model: gpt-5.2
                  messages:
                    - role: user
                      content: Please introduce yourself
              multi_turn:
                summary: マルチターン会話（コンテキスト理解）
                value:
                  model: gpt-5.2
                  messages:
                    - role: user
                      content: What is Python?
                    - role: assistant
                      content: Python is a high-level programming language...
                    - role: user
                      content: What are its advantages?
              system_prompt:
                summary: システムプロンプトの使用
                value:
                  model: gpt-5.2
                  messages:
                    - role: system
                      content: >-
                        You are a professional Python programming assistant.
                        Answer questions concisely.
                    - role: user
                      content: How to read a file?
              vision:
                summary: マルチモーダル入力（テキスト+画像）
                value:
                  model: gpt-5.2
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: >-
                            Please describe the scene and main elements in this
                            image in detail.
                        - type: image_url
                          image_url:
                            url: https://example.com/image.png
              multi_image:
                summary: 複数画像入力
                value:
                  model: gpt-5.2
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: Compare the differences between these two images
                        - type: image_url
                          image_url:
                            url: https://example.com/image1.png
                        - type: image_url
                          image_url:
                            url: https://example.com/image2.png
      responses:
        '200':
          description: チャット補完成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
        '400':
          description: 無効なリクエストパラメータ
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 400
                  message: 無効なリクエストパラメータ
                  type: invalid_request_error
        '401':
          description: 未認可、トークンが無効または期限切れです
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 401
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: クォータ不足、チャージが必要です
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 402
                  message: クォータ不足
                  type: insufficient_quota_error
                  fallback_suggestion: https://evolink.ai/dashboard/billing
        '403':
          description: アクセス拒否
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 403
                  message: Access denied for this model
                  type: permission_error
                  param: model
        '404':
          description: リソースが見つかりません
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 404
                  message: Specified model not found
                  type: not_found_error
                  param: model
                  fallback_suggestion: gpt-5.2
        '413':
          description: リクエストボディが大きすぎます
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 413
                  message: Image file too large
                  type: request_too_large_error
                  param: content
                  fallback_suggestion: compress image to under 10MB
        '429':
          description: レート制限を超過しました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: レート制限を超過しました
                  type: rate_limit_error
                  fallback_suggestion: retry after 60 seconds
        '500':
          description: 内部サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 500
                  message: 内部サーバーエラー
                  type: internal_server_error
                  fallback_suggestion: try again later
        '502':
          description: 上流サービスエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: Upstream AI service unavailable
                  type: upstream_error
                  fallback_suggestion: try different model
        '503':
          description: サービス一時利用不可
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: サービス一時利用不可
                  type: service_unavailable_error
                  fallback_suggestion: retry after 30 seconds
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: チャット補完用モデル名
          enum:
            - gpt-5.2
          default: gpt-5.2
          example: gpt-5.2
        messages:
          type: array
          description: 会話用メッセージリスト、マルチターン対話とマルチモーダル入力（テキスト、画像）をサポート
          items:
            $ref: '#/components/schemas/Message'
          minItems: 1
        stream:
          type: boolean
          description: |-
            レスポンスをストリーミングするかどうか

            - `true`: ストリームレスポンス、リアルタイムでチャンク単位にコンテンツを返却
            - `false`: 完全なレスポンスを待って一括で返却
          example: false
        temperature:
          type: number
          description: |-
            サンプリング温度、出力のランダム性を制御

            **注意**:
            - 低い値（例: 0.2）: より決定的で集中した出力
            - 高い値（例: 1.5）: よりランダムで創造的な出力
          minimum: 0
          maximum: 2
          example: 0.7
        top_p:
          type: number
          description: |-
            Nucleus samplingパラメータ

            **注意**:
            - 累積確率に基づくトークンサンプリングを制御
            - 例えば、0.9は累積確率上位90%のトークンからサンプリングすることを意味します
            - デフォルト: 1.0（全トークンを考慮）

            **推奨**: temperatureとtop_pを同時に調整しないでください
          minimum: 0
          maximum: 1
          example: 0.9
        top_k:
          type: integer
          description: |-
            Top-Kサンプリングパラメータ

            **注意**:
            - 例えば、10は各サンプリングステップで最も確率の高い上位10トークンのみを考慮することを意味します
            - 小さい値は出力をより集中させます
            - デフォルト: 無制限
          minimum: 1
          example: 40
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: チャット補完の一意の識別子
          example: chatcmpl-20251010015944503180122WJNB8Eid
        model:
          type: string
          description: 補完に使用されたモデル
          example: gpt-5.2
        object:
          type: string
          enum:
            - chat.completion
          description: レスポンスタイプ
          example: chat.completion
        created:
          type: integer
          description: 補完が作成されたUnixタイムスタンプ
          example: 1760032810
        choices:
          type: array
          description: 補完選択肢のリスト
          items:
            $ref: '#/components/schemas/Choice'
        usage:
          $ref: '#/components/schemas/Usage'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
              description: HTTP ステータスエラーコード
            message:
              type: string
              description: エラーメッセージ
            type:
              type: string
              description: エラータイプ
            param:
              type: string
              description: 関連パラメータ名
            fallback_suggestion:
              type: string
              description: エラー処理の提案
    Message:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          description: |-
            メッセージのロール

            - `user`: ユーザーメッセージ
            - `assistant`: AIアシスタントメッセージ（マルチターン対話用）
            - `system`: システムプロンプト（AIのロールと動作を設定）
          enum:
            - user
            - assistant
            - system
          example: user
        content:
          type: array
          description: |-
            メッセージ内容。2つの形式をサポート:

            **1. プレーンテキスト文字列**: 文字列を直接渡すことができます。例: `"content":"自己紹介してください"`

            **2. オブジェクト配列**（テキスト入力、マルチモーダル入力をサポート）: 以下の構造を参照
          items:
            $ref: '#/components/schemas/ContentPart'
    Choice:
      type: object
      properties:
        index:
          type: integer
          description: この選択肢のインデックス
          example: 0
        message:
          $ref: '#/components/schemas/AssistantMessage'
        finish_reason:
          type: string
          description: 補完が終了した理由
          enum:
            - stop
            - length
            - content_filter
          example: stop
    Usage:
      type: object
      description: トークン使用統計
      properties:
        prompt_tokens:
          type: integer
          description: 入力のトークン数
          example: 13
        completion_tokens:
          type: integer
          description: 出力のトークン数
          example: 1891
        total_tokens:
          type: integer
          description: 使用されたトークンの合計数
          example: 1904
        prompt_tokens_details:
          type: object
          description: 入力トークンの詳細
          properties:
            cached_tokens:
              type: integer
              description: キャッシュトークン数
              example: 0
            text_tokens:
              type: integer
              description: テキストトークン数
              example: 13
            audio_tokens:
              type: integer
              description: オーディオトークン数
              example: 0
            image_tokens:
              type: integer
              description: 画像トークン数
              example: 0
        completion_tokens_details:
          type: object
          description: 出力トークンの詳細
          properties:
            text_tokens:
              type: integer
              description: テキストトークン数
              example: 0
            audio_tokens:
              type: integer
              description: オーディオトークン数
              example: 0
            reasoning_tokens:
              type: integer
              description: 推論トークン数
              example: 1480
        input_tokens:
          type: integer
          description: 入力トークン数（互換性フィールド）
          example: 0
        output_tokens:
          type: integer
          description: 出力トークン数（互換性フィールド）
          example: 0
        input_tokens_details:
          type: object
          nullable: true
          description: 入力トークンの詳細（互換性フィールド）
          example: null
    ContentPart:
      oneOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/ImageContent'
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: メッセージ送信者のロール
          enum:
            - assistant
          example: assistant
        content:
          type: string
          description: AIのレスポンス内容
          example: >-
            Hello! I'm GPT-5.2, with enhanced reasoning and understanding
            capabilities. I excel at handling complex problems, multi-step
            reasoning, and code generation.\n\nKey features include:\n- Stronger
            logical reasoning\n- Better context understanding\n- More accurate
            code generation
    TextContent:
      title: テキストコンテンツ
      type: object
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - text
          description: コンテンツタイプ
        text:
          type: string
          description: テキストコンテンツ
          example: Please describe this image in detail
    ImageContent:
      title: 画像コンテンツ
      type: object
      required:
        - type
        - image_url
      properties:
        type:
          type: string
          enum:
            - image_url
          description: コンテンツタイプ
        image_url:
          type: object
          required:
            - url
          properties:
            url:
              type: string
              format: uri
              description: |-
                画像URL

                **制限**:
                - 画像1枚あたりの最大サイズ: `10MB`
                - サポート形式: `.jpeg`, `.jpg`, `.png`, `.webp`
                - URL要件: 公開アクセス可能であること、通常は画像拡張子で終わること
              example: https://example.com/image.png
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ## すべてのAPIにBearer Token認証が必要です ##

        **APIキーの取得：**

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

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

````