> ## 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.

# GLM-5.2 - OpenAI 互換 API

> - OpenAI Chat Completions プロトコルを使用して GLM-5.2 モデルを呼び出します
- 同期処理モードで、対話内容をリアルタイムに返却します
- **プレーンテキスト対話**：シングルターンまたはマルチターンの文脈対話
- **システムプロンプト**：`role=system` メッセージで AI の役割と振る舞いをカスタマイズ
- **深い思考**：`thinking.type` で思考連鎖を切り替え、`reasoning_effort` で推論強度を調整します。推論過程は `reasoning_content` で返却されます
- **ストリーミング出力**：SSE ストリーミングレスポンスに対応（`stream=true`）
- **ツール呼び出し**：Function Calling、ナレッジベース検索（retrieval）、ウェブ検索（web_search）、MCP に対応（最大 128 個のツール）
- **構造化出力**：`response_format` で JSON モードを有効化

**ストリーミングレスポンスの説明**：`stream=true` の場合、Server-Sent Events で返却され、各メッセージの形式は `data: {JSON}` となり、終了時に `data: [DONE]` を返します。各データチャンク（`ChatCompletionChunk`）には `id`、`created`、`model`、`choices`、およびオプションの `usage` と `content_filter` が含まれます。そのうち `choices[].delta` は `role` / `content` / `reasoning_content` / `tool_calls` を増分で返し、`choices[].finish_reason` は最後のチャンクで終了理由を示します。

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


## OpenAPI

````yaml ja/api-manual/language-series/glm-5.2/glm-5.2-api.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: GLM-5.2 完全パラメータドキュメント (OpenAI 互換)
  description: |-
    GLM-5.2 対話インターフェースの完全な API リファレンス。

    **モデル能力**：
    - 最新のフラッグシップモデルで、複雑な推論、超長文コンテキスト、極めて高速な推論速度を備えています
    - 最大出力：**131,072 tokens**（128K）、**1,024 tokens** 以上を推奨
    - 深い思考：`thinking` フィールドで思考連鎖を切り替え、`reasoning_effort` で推論強度を調整します（GLM-5.2 専用）
    - ツール呼び出し：Function Calling、ナレッジベース検索、ウェブ検索、MCP に対応（最大 128 個のツール）
    - ストリーミング出力：SSE ストリーミングレスポンスに対応
    - 構造化出力：`text` / `json_object` の 2 種類のレスポンス形式に対応
  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: GLM-5.2 対話インターフェース（OpenAI 互換）
      description: >-
        - OpenAI Chat Completions プロトコルを使用して GLM-5.2 モデルを呼び出します

        - 同期処理モードで、対話内容をリアルタイムに返却します

        - **プレーンテキスト対話**：シングルターンまたはマルチターンの文脈対話

        - **システムプロンプト**：`role=system` メッセージで AI の役割と振る舞いをカスタマイズ

        - **深い思考**：`thinking.type` で思考連鎖を切り替え、`reasoning_effort`
        で推論強度を調整します。推論過程は `reasoning_content` で返却されます

        - **ストリーミング出力**：SSE ストリーミングレスポンスに対応（`stream=true`）

        - **ツール呼び出し**：Function
        Calling、ナレッジベース検索（retrieval）、ウェブ検索（web_search）、MCP に対応（最大 128 個のツール）

        - **構造化出力**：`response_format` で JSON モードを有効化


        **ストリーミングレスポンスの説明**：`stream=true` の場合、Server-Sent Events
        で返却され、各メッセージの形式は `data: {JSON}` となり、終了時に `data: [DONE]`
        を返します。各データチャンク（`ChatCompletionChunk`）には
        `id`、`created`、`model`、`choices`、およびオプションの `usage` と `content_filter`
        が含まれます。そのうち `choices[].delta` は `role` / `content` / `reasoning_content`
        / `tool_calls` を増分で返し、`choices[].finish_reason` は最後のチャンクで終了理由を示します。
      operationId: createChatCompletionGLM52
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              simple_text:
                summary: シングルターンのテキスト対話
                value:
                  model: glm-5.2
                  messages:
                    - role: user
                      content: 自己紹介してください
              multi_turn:
                summary: マルチターン対話（文脈理解）
                value:
                  model: glm-5.2
                  messages:
                    - role: user
                      content: Python とは何ですか？
                    - role: assistant
                      content: Python は高水準プログラミング言語です...
                    - role: user
                      content: どんな利点がありますか？
              system_prompt:
                summary: システムプロンプトの使用
                value:
                  model: glm-5.2
                  messages:
                    - role: system
                      content: あなたはプロの Python プログラミングアシスタントです。簡潔な言葉で質問に答えてください。
                    - role: user
                      content: ファイルを読み込むにはどうすればよいですか？
              deep_thinking:
                summary: 深い思考を有効化して推論強度を調整
                value:
                  model: glm-5.2
                  messages:
                    - role: user
                      content: >-
                        農夫がオオカミ、ヤギ、キャベツを連れて川を渡ろうとしています。一度に運べるのは 1
                        つだけです。どうすれば安全に川を渡れますか？
                  thinking:
                    type: enabled
                  reasoning_effort: max
              disable_thinking:
                summary: 深い思考を無効化（直接回答）
                value:
                  model: glm-5.2
                  messages:
                    - role: user
                      content: 相対性理論を一文で要約してください。
                  thinking:
                    type: disabled
              function_calling:
                summary: ツール呼び出し（Function Calling）
                value:
                  model: glm-5.2
                  messages:
                    - role: user
                      content: 北京の今日の天気はどうですか？
                  tools:
                    - type: function
                      function:
                        name: get_weather
                        description: 指定した都市のリアルタイムの天気を照会します
                        parameters:
                          type: object
                          properties:
                            city:
                              type: string
                              description: 都市名、例：北京
                          required:
                            - city
                  tool_choice: auto
              web_search:
                summary: ウェブ検索ツールを有効化
                value:
                  model: glm-5.2
                  messages:
                    - role: user
                      content: 直近 1 週間の人工知能のニュースを調べてください
                  tools:
                    - type: web_search
                      web_search:
                        enable: true
                        search_engine: search_pro
                        count: 10
                        search_recency_filter: oneWeek
              json_mode:
                summary: JSON 構造化出力
                value:
                  model: glm-5.2
                  messages:
                    - role: system
                      content: name と age の 2 つのフィールドを含む JSON 形式で出力してください。
                    - role: user
                      content: 張三、今年 28 歳
                  response_format:
                    type: json_object
              streaming:
                summary: ストリーミング出力（SSE）
                value:
                  model: glm-5.2
                  messages:
                    - role: user
                      content: 春についての短い詩を書いてください
                  stream: true
      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: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 未認証、Token が無効または期限切れ
          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: Insufficient quota
                  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: glm-5.2
        '429':
          description: リクエスト頻度が上限を超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: Rate limit exceeded
                  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: Internal server error
                  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: Service temporarily unavailable
                  type: service_unavailable_error
                  fallback_suggestion: retry after 30 seconds
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: |-
            呼び出すモデルコード

            - `glm-5.2`：最新のフラッグシップモデルで、複雑な推論、超長文コンテキスト、極めて高速な推論速度を提供します
          enum:
            - glm-5.2
          default: glm-5.2
          example: glm-5.2
        messages:
          type: array
          description: >-
            対話メッセージのリスト。現在の対話の完全な文脈情報を含みます


            `system`、`user`、`assistant`、`tool` の 4
            種類の役割に対応します。役割が異なるメッセージは異なるフィールド構造を持つため、対応する役割を選択して確認してください。少なくとも 1
            件のメッセージを含む必要があり、システムメッセージまたはアシスタントメッセージのみで構成することはできません。
          items:
            oneOf:
              - $ref: '#/components/schemas/SystemMessage'
              - $ref: '#/components/schemas/UserMessage'
              - $ref: '#/components/schemas/AssistantRequestMessage'
              - $ref: '#/components/schemas/ToolMessage'
            discriminator:
              propertyName: role
              mapping:
                system:
                  $ref: '#/components/schemas/SystemMessage'
                user:
                  $ref: '#/components/schemas/UserMessage'
                assistant:
                  $ref: '#/components/schemas/AssistantRequestMessage'
                tool:
                  $ref: '#/components/schemas/ToolMessage'
          minItems: 1
        stream:
          type: boolean
          description: >-
            ストリーミング出力モードを有効にするかどうか


            - `false`：モデルが完全なレスポンスを生成してから一括で返します（デフォルト）。短いテキストやバッチ処理に適しています

            - `true`：Server-Sent
            Events（SSE）でチャンクごとにリアルタイムに返します。チャットや長文に適しています。ストリーミング終了時に `data:
            [DONE]` を返します
          default: false
          example: false
        thinking:
          type: object
          description: 思考連鎖（Chain of Thought）を有効にするかどうかを制御します
          properties:
            type:
              type: string
              description: |-
                思考連鎖の切り替え

                - `enabled`：深い思考を有効化（デフォルト）
                - `disabled`：深い思考を無効化し、モデルが直接回答します
              enum:
                - enabled
                - disabled
              default: enabled
            clear_thinking:
              type: boolean
              description: >-
                過去の対話ターンの `reasoning_content` をクリアするかどうか


                - `true`（デフォルト）：過去ターンの `reasoning_content` を無視 /
                削除し、推論以外の内容（ユーザー /
                アシスタントの可視テキスト、ツール呼び出しとその結果など）のみを文脈として使用します。コンテキスト長とコストを削減できます

                - `false`：過去ターンの `reasoning_content`
                を保持し、文脈とともにモデルへ渡します（Preserved Thinking）。この場合、過去の
                `reasoning_content` を `messages`
                内で**完全に、未修正のまま、元の順序で**透過する必要があります。欠落、切り詰め、書き換え、並べ替えがあると効果が低下したり機能しなくなったりします

                - 注意：このパラメータはターンをまたぐ過去の思考にのみ影響し、現在のターンで思考を生成するかどうかは変わりません
              default: true
              example: true
        reasoning_effort:
          type: string
          description: >-
            モデルの推論の度合いを制御します（GLM-5.2 専用能力）


            **説明**：

            - `thinking` が有効な場合のみ有効で、デフォルトは `max`

            - 値は強い順から弱い順へ：`max` > `xhigh` > `high` > `medium` > `low` >
            `minimal` > `none`


            **GLM-5.2 のマッピングルール**（他のプロトコルとの互換性のため）：

            - `xhigh` → `max` と等価

            - `low` / `medium` → `high` と等価

            - `none` / `minimal` → 思考を放棄（深い推論を行わない）
          enum:
            - max
            - xhigh
            - high
            - medium
            - low
            - minimal
            - none
          default: max
          example: max
        do_sample:
          type: boolean
          description: >-
            サンプリング戦略を有効にするかどうか


            - `true`（デフォルト）：`temperature` / `top_p`
            を用いてランダムサンプリングを行い、出力がより多様になります

            - `false`：常に確率が最も高い語彙を選択し（貪欲デコード）、出力がより定まります。この場合 `temperature` と
            `top_p` は無視されます


            一貫性や再現性が必要なタスク（コード生成、翻訳など）には `false` の設定を推奨します
          default: true
          example: true
        temperature:
          type: number
          format: float
          description: |-
            サンプリング温度。出力のランダム性と創造性を制御します

            **説明**：
            - 範囲：`[0.0, 1.0]`、小数第 2 位まで
            - 高い値（例：0.8）：よりランダムで独創性が高くなり、クリエイティブな執筆に適しています
            - 低い値（例：0.2）：より安定して定まりやすくなり、事実に基づく質問応答やコード生成に適しています
            - GLM-5.2 のデフォルト値：`1.0`

            **推奨**：`temperature` と `top_p` を同時に調整しないでください
          minimum: 0
          maximum: 1
          default: 1
          example: 1
        top_p:
          type: number
          format: float
          description: >-
            核サンプリング（Nucleus Sampling）パラメータ。`temperature` サンプリングの代替手段です


            **説明**：

            - 範囲：`[0.01, 1.0]`、小数第 2 位まで

            - モデルは累積確率が `top_p` に達する候補語彙のみを考慮します。例えば 0.1 は上位 10%
            の確率の語彙のみを考慮することを意味します

            - 小さい値ほど絞り込まれた一貫性のある出力になり、大きい値ほど多様性が増します

            - GLM-5.2 のデフォルト値：`0.95`


            **推奨**：`temperature` と `top_p` を同時に調整しないでください
          minimum: 0.01
          maximum: 1
          default: 0.95
          example: 0.95
        max_tokens:
          type: integer
          description: |-
            モデル出力の最大 token 数の制限

            **説明**：
            - GLM-5.2 は最大 **131,072 tokens**（128K）の出力長に対応します。`1024` 以上の設定を推奨します
            - `thinking` が有効な場合、思考連鎖の token もこの上限に含まれます
            - 生成が `length` の理由で中断された場合は、この値を引き上げてみてください
          minimum: 1
          maximum: 131072
          example: 1024
        tools:
          type: array
          description: >-
            モデルが呼び出せるツールのリスト


            **説明**：

            -
            関数呼び出し（`function`）、ナレッジベース検索（`retrieval`）、ウェブ検索（`web_search`）、MCP（`mcp`）に対応します

            - 最大 128 個の関数に対応します
          items:
            oneOf:
              - $ref: '#/components/schemas/FunctionTool'
              - $ref: '#/components/schemas/RetrievalTool'
              - $ref: '#/components/schemas/WebSearchTool'
              - $ref: '#/components/schemas/McpTool'
            discriminator:
              propertyName: type
              mapping:
                function:
                  $ref: '#/components/schemas/FunctionTool'
                retrieval:
                  $ref: '#/components/schemas/RetrievalTool'
                web_search:
                  $ref: '#/components/schemas/WebSearchTool'
                mcp:
                  $ref: '#/components/schemas/McpTool'
          maxItems: 128
        tool_choice:
          type: string
          description: >-
            モデルがどの関数を呼び出すかを選択する方法を制御します


            **説明**：ツールの種類が `function` の場合のみ有効で、デフォルトかつ `auto`
            のみに対応します（ツールを呼び出すかどうかをモデルが自動で判断します）
          enum:
            - auto
          default: auto
          example: auto
        stop:
          type: array
          description: |-
            停止ワードのリスト

            **説明**：
            - モデルが生成テキスト中に指定した文字列に遭遇すると、ただちに生成を停止します（停止ワード自体は返却テキストに含まれません）
            - 現在は単一の停止ワードのみに対応し、形式は `["stop_word1"]`、例えば `["Human:"]` です
          items:
            type: string
          maxItems: 4
          example:
            - 'Human:'
        response_format:
          type: object
          description: >-
            モデルのレスポンス出力形式を指定します。デフォルトは `text`


            **説明**：

            - `{ "type": "json_object" }` で JSON モードを有効化すると、モデルは有効な JSON
            形式のデータを返します。構造化データの抽出などのシナリオに適しています

            - JSON モードを使用する場合は、`system` または `user` メッセージで JSON
            出力をはっきりと要求することを推奨します
          required:
            - type
          properties:
            type:
              type: string
              description: |-
                出力形式の種類

                - `text`：プレーンテキスト出力（デフォルト）
                - `json_object`：JSON 形式の出力
              enum:
                - text
                - json_object
              default: text
        request_id:
          type: string
          description: |-
            リクエストの一意の識別子

            **説明**：
            - ユーザー側から渡し、長さは 6〜64 文字です。一意性を確保するため UUID 形式を推奨します
            - 指定しない場合は、プラットフォームが自動で生成します
          minLength: 6
          maxLength: 64
          example: req-7f3a2c1e8b9d4f0a
        user_id:
          type: string
          description: >-
            エンドユーザーの一意の識別子


            **説明**：長さは 6〜128
            文字です。機密情報を含まない一意の識別子の使用を推奨します。プラットフォームによる不正利用の監視と検出に役立ちます
          minLength: 6
          maxLength: 128
          example: user-abc123456
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: タスク `ID`
          example: chatcmpl-a6613b56-c61c-94ba-9a9f-43d4cdc7d77a
        object:
          type: string
          description: レスポンスの種類
          enum:
            - chat.completion
          example: chat.completion
        request_id:
          type: string
          description: リクエスト `ID`（リクエストで `request_id` を指定した場合に返送されます）
          example: req-7f3a2c1e8b9d4f0a
        created:
          type: integer
          description: リクエストの作成時刻。`Unix` タイムスタンプ（秒）
          example: 1777021417
        model:
          type: string
          description: モデル名
          example: glm-5.2
        choices:
          type: array
          description: モデルレスポンスのリスト
          items:
            $ref: '#/components/schemas/Choice'
        usage:
          $ref: '#/components/schemas/Usage'
        web_search:
          type: array
          description: ウェブ検索関連情報。`web_search` ツールを使用し検索がヒットした場合に返却されます
          items:
            $ref: '#/components/schemas/WebSearchResult'
        content_filter:
          type: array
          description: コンテンツ安全関連情報
          items:
            $ref: '#/components/schemas/ContentFilter'
    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: エラー時の推奨事項
    SystemMessage:
      title: System Message
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - system
          description: 役割識別子。固定値 `system`
        content:
          type: string
          description: システムプロンプトの内容。AI の役割と振る舞いを設定するために使用します
    UserMessage:
      title: User Message
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
          description: 役割識別子。固定値 `user`
        content:
          type: string
          description: ユーザーメッセージの内容（プレーンテキスト文字列）
    AssistantRequestMessage:
      title: Assistant Message
      type: object
      description: アシスタントメッセージ。ツール呼び出しを含めることができます
      required:
        - role
      properties:
        role:
          type: string
          enum:
            - assistant
          description: 役割識別子。固定値 `assistant`
        content:
          type:
            - string
            - 'null'
          description: >-
            アシスタントメッセージの内容


            **説明**：マルチターン対話で過去のアシスタントの返信を渡すために使用します。`tool_calls` が存在する場合は通常
            `null` になります
        reasoning_content:
          type:
            - string
            - 'null'
          description: >-
            過去の思考連鎖の内容


            **説明**：`thinking.clear_thinking=false`（Preserved
            Thinking）の場合のみ必要で、前のターンのレスポンスの `reasoning_content`
            をそのまま返送します。デフォルト（`clear_thinking=true`）では返送する必要はありません
        tool_calls:
          type: array
          description: |-
            ツール呼び出しリスト

            マルチターン対話で過去のツール呼び出し情報を渡すために使用します。このフィールドを指定する場合、`content` は通常空になります
          items:
            type: object
            required:
              - id
              - type
            properties:
              id:
                type: string
                description: ツール呼び出し ID
              type:
                type: string
                enum:
                  - function
                  - web_search
                  - retrieval
                description: ツールの種類
              function:
                type: object
                description: 関数呼び出し情報。`type` が `function` の場合は空になりません
                required:
                  - name
                  - arguments
                properties:
                  name:
                    type: string
                    description: 関数名
                  arguments:
                    type: string
                    description: 関数の引数（JSON 形式の文字列）
    ToolMessage:
      title: Tool Message
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - tool
          description: 役割識別子。固定値 `tool`
        content:
          type: string
          description: ツール呼び出しの返却結果の内容
        tool_call_id:
          type: string
          description: >-
            このメッセージが対応するツール呼び出しの `ID` を示します（assistant メッセージの `tool_calls` で返された
            `id` に対応します）
    FunctionTool:
      title: Function ツール
      type: object
      required:
        - type
        - function
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - function
          default: function
          description: ツールの種類。固定値 `function`
        function:
          type: object
          required:
            - name
            - description
            - parameters
          properties:
            name:
              type: string
              description: >-
                呼び出す関数名


                **説明**：`a-z`、`A-Z`、`0-9` の文字、またはアンダースコアとハイフンで構成する必要があります。最大長は 64
                文字です
              minLength: 1
              maxLength: 64
              pattern: ^[a-zA-Z0-9_-]+$
            description:
              type: string
              description: 関数の機能説明。モデルがこの関数をいつ、どのように呼び出すかを選択するのに役立ちます
            parameters:
              type: object
              description: 関数の入力パラメータ。JSON Schema オブジェクトとして記述します
    RetrievalTool:
      title: Retrieval ツール（ナレッジベース検索）
      type: object
      required:
        - type
        - retrieval
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - retrieval
          default: retrieval
          description: ツールの種類。固定値 `retrieval`
        retrieval:
          type: object
          required:
            - knowledge_id
          properties:
            knowledge_id:
              type: string
              description: ナレッジベースの `ID`。プラットフォームで作成または取得します
            prompt_template:
              type: string
              description: >-
                モデルへのリクエストに使うプロンプトテンプレート。プレースホルダー `{{ knowledge }}` と `{{
                question }}` を含むカスタムテンプレートです。指定しない場合はデフォルトテンプレートを使用します
    WebSearchTool:
      title: Web Search ツール（ウェブ検索）
      type: object
      required:
        - type
        - web_search
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - web_search
          default: web_search
          description: ツールの種類。固定値 `web_search`
        web_search:
          type: object
          required:
            - search_engine
          properties:
            enable:
              type: boolean
              description: 検索機能を有効にするかどうか。有効にする場合は `true` に設定します
              default: false
            search_engine:
              type: string
              description: 検索エンジンの種類。デフォルトは `search_std`
              enum:
                - search_std
                - search_pro
                - search_pro_sogou
                - search_pro_quark
            search_query:
              type: string
              description: 検索を強制してトリガーするカスタムキーワード
            search_intent:
              type: string
              description: |-
                検索意図の認識を行うかどうか。デフォルトで実行します

                - `true`：検索意図の認識を実行し、検索意図があれば検索を実行します
                - `false`：意図認識をスキップし、直接検索を実行します
            count:
              type: integer
              description: >-
                返却する結果の件数。範囲 `1-50`、デフォルト `10`（`search_std` / `search_pro` /
                `search_pro_sogou` に対応）
              minimum: 1
              maximum: 50
              default: 10
            search_domain_filter:
              type: string
              description: 検索結果を限定するドメインのホワイトリスト（例：`www.example.com`）
            search_recency_filter:
              type: string
              description: 検索結果を限定する時間範囲。デフォルトは `noLimit`
              enum:
                - oneDay
                - oneWeek
                - oneMonth
                - oneYear
                - noLimit
              default: noLimit
            content_size:
              type: string
              description: |-
                ウェブページ要約の文字数を制御します。デフォルトは `medium`

                - `medium`：要約情報を返し、基本の推論ニーズを満たします
                - `high`：コンテキストを最大化し、より詳細な情報を提供します
              enum:
                - medium
                - high
              default: medium
            result_sequence:
              type: string
              description: 検索結果を返す位置（モデルの返信の前か後か）。デフォルトは `after`
              enum:
                - before
                - after
              default: after
            search_result:
              type: boolean
              description: 検索ソースの詳細情報を返すかどうか。デフォルトは `false`
              default: false
            require_search:
              type: boolean
              description: 検索結果に基づくことを強制して回答を返すかどうか。デフォルトは `false`
              default: false
            search_prompt:
              type: string
              description: 検索結果の処理をカスタマイズするための `Prompt`。指定しない場合はデフォルトテンプレートを使用します
    McpTool:
      title: MCP ツール
      type: object
      required:
        - type
        - mcp
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - mcp
          default: mcp
          description: ツールの種類。固定値 `mcp`
        mcp:
          type: object
          required:
            - server_label
          properties:
            server_label:
              type: string
              description: >-
                MCP server の識別子。プラットフォーム組み込みの MCP server に接続する場合は対応する mcp code
                を入力し、`server_url` を入力する必要はありません
            server_url:
              type: string
              description: MCP server のアドレス
            transport_type:
              type: string
              description: トランスポートの種類
              enum:
                - sse
                - streamable-http
              default: streamable-http
            allowed_tools:
              type: array
              description: 呼び出しを許可するツールの集合
              items:
                type: string
            headers:
              type: object
              description: MCP server が必要とする認証情報
    Choice:
      type: object
      properties:
        index:
          type: integer
          description: 結果のインデックス
          example: 0
        message:
          $ref: '#/components/schemas/AssistantMessage'
        finish_reason:
          type: string
          description: |-
            推論の終了理由

            - `stop`：自然終了または停止ワードのトリガー
            - `tool_calls`：モデルが関数（ツール呼び出し）にヒット
            - `length`：token 長の上限に到達
            - `sensitive`：内容が安全審査によりブロックされた（公開した内容を撤回するかどうかを判断し決定してください）
            - `network_error`：モデル推論の異常
            - `model_context_window_exceeded`：モデルのコンテキストウィンドウを超過
          enum:
            - stop
            - tool_calls
            - length
            - sensitive
            - network_error
            - model_context_window_exceeded
          example: stop
    Usage:
      type: object
      description: 呼び出し終了時に返却される Token 使用統計
      properties:
        prompt_tokens:
          type: integer
          description: ユーザー入力の token 数
          example: 24
        completion_tokens:
          type: integer
          description: 出力の token 数（思考連鎖 `reasoning_tokens` 部分を含む）
          example: 346
        total_tokens:
          type: integer
          description: token 総数 = prompt_tokens + completion_tokens
          example: 370
        prompt_tokens_details:
          type: object
          description: 入力 token の詳細内訳
          properties:
            cached_tokens:
              type: integer
              description: キャッシュに該当した token 数
              example: 0
        completion_tokens_details:
          type: object
          description: 出力 token の詳細内訳
          properties:
            reasoning_tokens:
              type: integer
              description: 思考連鎖（深い思考）が生成した token 数。`completion_tokens` に含まれます
              example: 321
    WebSearchResult:
      type: object
      description: 単一のウェブ検索結果
      properties:
        icon:
          type: string
          description: ソースサイトのアイコン
        title:
          type: string
          description: 検索結果のタイトル
        link:
          type: string
          description: 検索結果のウェブページリンク
        media:
          type: string
          description: 検索結果ウェブページのメディアソース名
        publish_date:
          type: string
          description: サイトの公開時刻
        content:
          type: string
          description: 検索結果ウェブページが引用したテキスト内容
        refer:
          type: string
          description: 添え字の番号
    ContentFilter:
      type: object
      description: コンテンツ安全情報
      properties:
        role:
          type: string
          description: |-
            安全が適用された段階

            - `assistant`：モデル推論
            - `user`：ユーザー入力
            - `history`：過去の文脈
          enum:
            - assistant
            - user
            - history
        level:
          type: integer
          description: 深刻度 `0-3`。`0` が最も深刻、`3` が軽微を示します
          minimum: 0
          maximum: 3
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: 現在の対話の役割。デフォルトは `assistant`
          enum:
            - assistant
          example: assistant
        content:
          type:
            - string
            - 'null'
          description: >-
            対話テキストの内容


            **説明**：ツール（`tool_calls`）を呼び出す場合は `null`
            になることがあります。それ以外の場合はモデルの返信内容を返します
          example: こんにちは！私は GLM-5.2 です。対話、推論、執筆、コーディングなど、さまざまなタスクをお手伝いできます。
        reasoning_content:
          type: string
          description: |-
            思考連鎖の内容

            **説明**：`thinking` が有効な場合に返却され、モデルの推論過程を記録します
          example: まずこの問題を分析してみましょう...
        tool_calls:
          type: array
          description: 生成されたツール呼び出し情報（モデルがツールの呼び出しを決定した場合に返却）
          items:
            type: object
            properties:
              id:
                type: string
                description: ツール呼び出しの一意の識別子
              type:
                type: string
                description: ツール呼び出しの種類
                enum:
                  - function
                  - mcp
              function:
                type: object
                description: 関数呼び出し情報（生成された関数名と JSON 形式の引数を含みます）
                properties:
                  name:
                    type: string
                    description: 生成された関数名
                  arguments:
                    type: string
                    description: 関数呼び出し引数の JSON 形式文字列。関数を呼び出す前に引数を検証してください
              mcp:
                type: object
                description: MCP ツール呼び出し引数（`type=mcp` の場合に返却）
                properties:
                  id:
                    type: string
                    description: MCP ツール呼び出しの一意の識別子
                  type:
                    type: string
                    description: MCP 呼び出しの種類
                    enum:
                      - mcp_list_tools
                      - mcp_call
                  server_label:
                    type: string
                    description: MCP server のラベル
                  error:
                    type: string
                    description: エラー情報
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##すべての API は Bearer Token 認証が必要です##

        **API キーの取得：**

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

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

````