> ## 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.1 - 完全なAPIリファレンス

> - OpenAI SDK形式でGPT-5.1シリーズモデルを呼び出し
- 同期処理モード、リアルタイムレスポンス
- **利用可能なモデル**: gpt-5.1（ベース）、gpt-5.1-chat（会話に最適化）、gpt-5.1-thinking（推論出力付き）
- **テキスト会話**: シングルターンまたはマルチターンのコンテキスト対話
- **システムプロンプト**: AIのロールと動作をカスタマイズ
- **マルチモーダル入力**: テキスト+画像の混合入力をサポート
- **ツール呼び出し**: Function Callingをサポート
- **推論出力**: gpt-5.1-thinkingは思考プロセスを示すreasoning_contentフィールドを返却

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


## OpenAPI

````yaml ja/api-manual/language-series/gpt-5-1/gpt-5-1-api.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: GPT-5.1完全なAPIリファレンス
  description: GPT-5.1 チャットインターフェースの完全な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.1 チャットインターフェース
      description: >-
        - OpenAI SDK形式でGPT-5.1シリーズモデルを呼び出し

        - 同期処理モード、リアルタイムレスポンス

        - **利用可能なモデル**:
        gpt-5.1（ベース）、gpt-5.1-chat（会話に最適化）、gpt-5.1-thinking（推論出力付き）

        - **テキスト会話**: シングルターンまたはマルチターンのコンテキスト対話

        - **システムプロンプト**: AIのロールと動作をカスタマイズ

        - **マルチモーダル入力**: テキスト+画像の混合入力をサポート

        - **ツール呼び出し**: Function Callingをサポート

        - **推論出力**: gpt-5.1-thinkingは思考プロセスを示すreasoning_contentフィールドを返却
      operationId: createChatCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              simple_text:
                summary: シングルターンテキスト会話
                value:
                  model: gpt-5.1
                  messages:
                    - role: user
                      content: Please introduce yourself
                  temperature: 1
              multi_turn:
                summary: マルチターン会話（コンテキスト理解）
                value:
                  model: gpt-5.1
                  messages:
                    - role: user
                      content: What is Python?
                    - role: assistant
                      content: Python is a high-level programming language...
                    - role: user
                      content: What are its advantages?
                  temperature: 1
              system_prompt:
                summary: システムプロンプトの使用
                value:
                  model: gpt-5.1
                  messages:
                    - role: system
                      content: >-
                        You are a helpful AI assistant. You provide safe,
                        helpful, and accurate answers.
                    - role: user
                      content: What is 1+1?
                  temperature: 1
              vision:
                summary: マルチモーダル入力（テキスト+画像）
                value:
                  model: gpt-5.1
                  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: >-
                              data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
                  temperature: 1
              tool_use:
                summary: ツール呼び出し（Function Calling）
                value:
                  model: gpt-5.1
                  messages:
                    - role: user
                      content: What's the weather like in San Francisco?
                  tools:
                    - type: function
                      function:
                        name: get_weather
                        description: 指定された場所の現在の天気を取得
                        parameters:
                          type: object
                          properties:
                            location:
                              type: string
                              description: '都市と州、例: San Francisco, CA'
                          required:
                            - location
                  temperature: 1
      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
        '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
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: |-
            チャット補完用モデル名

            - **gpt-5.1**: 汎用タスク向けベースモデル
            - **gpt-5.1-chat**: 会話タスクに最適化
            - **gpt-5.1-thinking**: 思考プロセス出力付きの推論機能を搭載（reasoning_contentを返却）
          enum:
            - gpt-5.1
            - gpt-5.1-chat
            - gpt-5.1-thinking
          example: gpt-5.1
        messages:
          type: array
          description: 会話用メッセージリスト、マルチターン対話とマルチモーダル入力をサポート
          items:
            $ref: '#/components/schemas/Message'
          minItems: 1
        stream:
          type: boolean
          description: |-
            レスポンスをストリーミングするかどうか

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

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

            - 累積確率に基づくトークンサンプリングを制御
            - 例えば、0.9は累積確率上位90%のトークンからサンプリングすることを意味します
          minimum: 0
          maximum: 1
          default: 1
          example: 0.9
        frequency_penalty:
          type: number
          description: |-
            頻度ペナルティ、-2.0から2.0の間の数値

            - 正の値はテキスト内での出現頻度に基づいて新しいトークンにペナルティを与えます
          minimum: -2
          maximum: 2
          default: 0
          example: 0
        presence_penalty:
          type: number
          description: |-
            存在ペナルティ、-2.0から2.0の間の数値

            - 正の値はテキスト内に出現するかどうかに基づいて新しいトークンにペナルティを与えます
          minimum: -2
          maximum: 2
          default: 0
          example: 0
        stop:
          oneOf:
            - type: string
              description: 単一のストップワード
            - type: array
              description: ストップワードのリスト、最大4つ
              items:
                type: string
              maxItems: 4
          description: ストップシーケンス、これらのシーケンスが一致すると生成が停止します
        tools:
          type: array
          description: Function Calling用のツールリスト
          items:
            $ref: '#/components/schemas/Tool'
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: チャット補完の一意の識別子
          example: chatcmpl-abc123
        model:
          type: string
          description: 補完に使用されたモデル
          example: gpt-5.1
        object:
          type: string
          enum:
            - chat.completion
          description: レスポンスタイプ
          example: chat.completion
        created:
          type: integer
          description: 補完が作成されたUnixタイムスタンプ
          example: 1698999496
        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: エラータイプ
            fallback_suggestion:
              type: string
              description: エラー処理の提案
    Message:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          description: |-
            メッセージのロール

            - `user`: ユーザーメッセージ
            - `assistant`: AIアシスタントメッセージ
            - `system`: システムプロンプト
          enum:
            - user
            - assistant
            - system
          example: user
        content:
          oneOf:
            - type: string
              description: プレーンテキストのメッセージ内容
              example: Please introduce yourself
            - type: array
              description: マルチモーダルメッセージ内容、テキストと画像の混合入力をサポート
              items:
                $ref: '#/components/schemas/ContentPart'
          description: メッセージ内容
    Tool:
      type: object
      required:
        - type
        - function
      properties:
        type:
          type: string
          enum:
            - function
          description: ツールタイプ
        function:
          type: object
          required:
            - name
            - description
            - parameters
          properties:
            name:
              type: string
              description: 関数名
              example: get_weather
            description:
              type: string
              description: 関数の説明
              example: 指定された場所の現在の天気を取得
            parameters:
              type: object
              description: 関数パラメータの定義
    Choice:
      type: object
      properties:
        index:
          type: integer
          description: この選択肢のインデックス
          example: 0
        message:
          $ref: '#/components/schemas/AssistantMessage'
        finish_reason:
          type: string
          description: 補完が終了した理由
          enum:
            - stop
            - length
            - tool_calls
            - content_filter
          example: stop
    Usage:
      type: object
      description: トークン使用統計
      properties:
        prompt_tokens:
          type: integer
          description: 入力のトークン数
          example: 8
        completion_tokens:
          type: integer
          description: 出力のトークン数
          example: 292
        total_tokens:
          type: integer
          description: 使用されたトークンの合計数
          example: 300
    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: Hi there! How can I help you?
        reasoning_content:
          type: string
          description: |-
            推論プロセスの内容（gpt-5.1-thinkingモデルのみ返却）

            **注意**:
            - モデルの思考と推論プロセスを表示
            - モデルが最終的な回答に至る過程を理解するのに役立ちます
          example: Let me think about this step by step...
    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またはBase64エンコーディング

                **形式**:
                - URL形式: `https://example.com/image.png`
                - Base64形式: `data:image/<format>;base64,<Base64 encoding>`
              example: data:image/png;base64,iVBORw0KGgo...
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        すべてのAPIはBearer Token認証が必要です

        **APIキーの取得:**

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

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

````