> ## 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 全モデルインターフェース - Responses 完全なパラメータ

> Responses 形式で GLM を呼び出し、テキスト会話、ストリーミング、関数呼び出しを利用できます。画像理解と Web 検索はモデルに応じて利用可能です。パラメータとモデルの違いは以下を参照してください。

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

Responses 形式で GLM を呼び出し、テキスト会話、ストリーミング、関数呼び出しを利用できます。画像理解と Web 検索はモデルに応じて利用可能です。パラメータとモデルの違いは以下を参照してください。

## モデルとパラメータの違い

GLM モデルを選択します。4 モデルともこのエンドポイントのテキスト入力に対応します。オプション機能はモデルによって異なります。

| モデル ID           | 入力      | 推論に関する注意                                                       |
| ---------------- | ------- | -------------------------------------------------------------- |
| `glm-5.3`        | テキスト    | 実際のレベルは `low` / `high` / `max`。互換値は reasoning を参照。思考は無効化できません。 |
| `glm-5.3-flash`  | テキスト、画像 | `glm-5.3` と同じ。画像には `input_image` を使用します。                       |
| `glm-5.3-flashx` | テキスト、画像 | `glm-5.3` と同じ。画像には `input_image` を使用します。                       |
| `glm-5.2`        | テキスト    | `none` でも思考トークンが生成される場合があり、思考の無効化は保証されません。                     |

Responses はトップレベルの `reasoning_effort` や `thinking` ではなく、ネストした `reasoning.effort` を使用します。思考の使用量は `output_tokens` に含まれます。簡単なタスクで `reasoning_tokens=0` が返っても、思考の無効化に対応することを意味しません。

推論強度。`low` を推奨します。

**`glm-5.3` / `glm-5.3-flash` / `glm-5.3-flashx` の互換ルール**

| 指定値                    | 実際の思考レベル       |
| ---------------------- | -------------- |
| `low` / `high` / `max` | 同じレベルを維持       |
| `xhigh`                | `max`          |
| `medium`               | `high`         |
| `minimal` / `none`     | `low`。思考は有効なまま |

**`minimal` と `none` は 5.3 シリーズの思考を無効にしません。** 思考トークンは出力として課金されます。認識されない値は互換変換せず、そのまま扱われます。表の値を使用してください。これらの互換ルールは `glm-5.2` には適用されません。

このエンドポイントでは `glm-5.2` に `none` を指定しても思考トークンが生成される場合があり、思考の無効化は保証されません。

## システムプロンプトと複数ターンの会話

`instructions`: システム指示。`glm-5.3-flash` は input が文字列の場合にこのフィールドを使用できます。メッセージ配列の場合、システムプロンプトは先頭の `role=system` メッセージに置いてください。

```json theme={null}
{
  "model": "glm-5.3-flash",
  "input": [
    {
      "role": "system",
      "content": "簡潔な日本語で回答してください。"
    },
    {
      "role": "user",
      "content": "合言葉 RED-583 を覚えてください"
    },
    {
      "role": "assistant",
      "content": "覚えました"
    },
    {
      "role": "user",
      "content": "合言葉は何ですか？合言葉だけを返してください。"
    }
  ],
  "reasoning": {
    "effort": "low"
  },
  "max_output_tokens": 1024
}
```

後で参照できるように応答を保存します。`glm-5.3-flash` と `glm-5.3-flashx` は `store=true` と `previous_response_id` による会話継続に対応します。`glm-5.2` は応答 ID による継続に非対応で、`store=true` でも有効になりません。input に全履歴を含めてください。

前の応答のトップレベルの id。`glm-5.3-flash` と `glm-5.3-flashx` は `store=true` と同一モデルで使用できます。output 内の項目 ID ではなく、応答 ID をそのまま指定してください。`glm-5.2` では 400 を返します。モデルを切り替える場合はこのフィールドを省略し、input に全履歴を含めてください。

## ストリーミング応答

SSE ストリーミングを有効にします。本文は `response.output_text.delta` の delta から読み取ります。成功時の終了イベントは `response.completed` です。`response.incomplete`、`response.failed`、error でもそのターンを終了して処理してください。\[DONE] や接続終了だけを待たないでください。

| イベント                                                                      | 処理                                                 |
| ------------------------------------------------------------------------- | -------------------------------------------------- |
| `response.created` / `response.in_progress`                               | ターンの開始。                                            |
| `response.output_text.delta`                                              | delta を本文に追加します。                                   |
| `response.reasoning_text.delta` / `response.reasoning_summary_text.delta` | 思考内容を本文から分離し、両方のイベント形式に対応します。                      |
| `response.output_item.done`                                               | `function_call` などの完全な出力項目を収集します。                  |
| `response.completed`                                                      | 生成終了。`response.output` と `response.usage` を読み取ります。 |
| `response.incomplete` / `response.failed` / `error`                       | 打ち切りやエラーを処理し、ターンを終了します。                            |

終了イベントを受信したら読み取りを終了してください。HTTP 200 はストリームの確立のみを示すため、イベントの最終状態も確認します。ツール呼び出しのターンが `response.completed` で終了しても、アプリケーションによる関数実行と次のリクエストが必要な場合があります。

## 関数呼び出し

リクエストメニューから関数呼び出しの例を選択してください。Responses の関数定義はフラットな構造です。

```json theme={null}
{
  "type": "function",
  "name": "get_temperature",
  "description": "指定した都市の気温を返す",
  "parameters": {
    "type": "object",
    "properties": {
      "city": {
        "type": "string"
      }
    },
    "required": [
      "city"
    ],
    "additionalProperties": false
  }
}
```

1. `response.output` を走査し、`type=function_call` の全項目を取得します。
2. arguments の JSON 文字列を解析・検証し、アプリケーションで各関数を実行します。
3. 前の output 全体を履歴に追加します。呼び出しごとに `function_call_output` を追加し、元の `call_id` と文字列の output を指定します。
4. 更新した履歴を次のリクエストの input として送信します。関数結果の返送例がこの構造を示しています。

<Note>
  `parallel_tool_calls`: 1 ターンで複数のツール呼び出しを許可するかどうか。false でも関数呼び出しが 1 件だけになる保証はありません。すべての `function_call` を走査して処理してください。
</Note>

## 画像・検索・JSON 出力

`glm-5.3-flash` と `glm-5.3-flashx` では、ユーザーメッセージの content 配列に `input_text` と `input_image` を混在できます。`image_url` に公開画像 URL または Base64 Data URL を指定してください。`glm-5.3` と `glm-5.2` にはテキストのみを使用します。

`tools: [{"type":"web_search"}]` を宣言します。検索はサーバー側で実行され、`web_search_call` と本文で結果が返ります。検索が実行されたかは出力項目で確認してください。トークン料金に加えて検索単位の料金がかかる場合があります。モデル料金を参照してください。

検索後に会話を続ける場合は、`web_search_call` と `message` を含む前のレスポンスの `output` 全体を `input` に追加し、その後に新しい質問を追加してください。元の `id`、`status`、`action` などのフィールドはそのまま保持します。検索はサーバー側ですでに実行されているため、`web_search_call` に対する `function_call_output` を作成する必要はありません。リクエスト例 `web_search_history` を参照してください。

`text.format.type`: 出力形式。text は通常のテキスト、`json_object` は JSON オブジェクトです。`json_object` では有効な JSON をプロンプトで明示的に要求し、クライアントで解析・検証してください。厳密な JSON Schema 制約は提供されないため、`json_schema` や `strict=true` で構造が保証されるとは限りません。

## 応答と使用量

順序付き出力項目。`type=message` の content 内にある `type=output_text` の text が本文です。reasoning が本文より前に来る場合や、`function_call` のターンに本文がない場合があります。常に output\[0] を読む実装は避けてください。

`output_text`: 本文を集約したオプションフィールド。存在しない場合があります。汎用クライアントでは output を走査してください。

message 内は `output_text`、reasoning 内は `reasoning_text` の場合があります。 思考内容は `summary_text` で返る場合もあります。すべての reasoning 項目に content があるとは限りません。

* `usage.input_tokens`: 入力トークン総数。キャッシュにヒットした分を含みます。 `usage.input_tokens_details.cached_tokens`: 入力のうちキャッシュにヒットしたトークン数。`input_tokens` に再加算しないでください。プレフィックスキャッシュは自動で、明示的な `cache_control` は不要です。ヒット数は返された値で確認してください。
* `usage.output_tokens`: 出力トークン総数。思考トークンを含みます。 `usage.output_tokens_details.reasoning_tokens`: 出力のうち思考に使われたトークン数。`output_tokens` に二重計上しないでください。この詳細は省略される場合や 0 の場合があります。

`status=incomplete` かつ `incomplete_details.reason=max_output_tokens` は出力上限の消費を示します。思考のみで本文がない場合があるため、上限を増やしてください。


## OpenAPI

````yaml ja/api-manual/language-series/glm/responses/responses-reference.json POST /v1/responses
openapi: 3.1.0
info:
  title: GLM 全モデルインターフェース - Responses 完全なパラメータ
  description: >-
    OpenAI 互換の Responses 形式で智譜 GLM
    シリーズを呼び出します。glm-5.3、glm-5.3-flash、glm-5.3-flashx、glm-5.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: Responses
    description: GLM Responses API
paths:
  /v1/responses:
    post:
      tags:
        - Responses
      summary: GLM Responses API（完全なパラメータ）
      description: >-
        Responses 形式で GLM を呼び出し、テキスト会話、ストリーミング、関数呼び出しを利用できます。画像理解と Web
        検索はモデルに応じて利用可能です。パラメータとモデルの違いは以下を参照してください。
      operationId: createGLMResponse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesRequest'
            examples:
              basic:
                summary: 基本的なテキスト対話
                value:
                  model: glm-5.3-flash
                  input: 自己紹介を一文でしてください。
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
              system_message:
                summary: システムプロンプトとメッセージ配列
                value:
                  model: glm-5.3-flash
                  input:
                    - role: system
                      content: 簡潔な日本語で回答してください。
                    - role: user
                      content: 二分探索とは何ですか？
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
              stream:
                summary: SSE ストリーミング出力
                value:
                  model: glm-5.3-flash
                  input: 自己紹介を一文でしてください。
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  stream: true
              history:
                summary: 履歴を含む複数ターンの会話
                value:
                  model: glm-5.3-flash
                  input:
                    - role: user
                      content: 合言葉 RED-583 を覚えてください
                    - role: assistant
                      content: 覚えました
                    - role: user
                      content: 合言葉は何ですか？合言葉だけを返してください。
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
              function:
                summary: クライアント側の関数呼び出し
                value:
                  model: glm-5.3-flash
                  input: 北京の気温を調べてください。
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  tools:
                    - type: function
                      name: get_temperature
                      description: 指定した都市の気温を返す
                      parameters:
                        type: object
                        properties:
                          city:
                            type: string
                        required:
                          - city
                        additionalProperties: false
                  tool_choice:
                    type: function
                    name: get_temperature
              function_result:
                summary: 関数の実行結果を返す
                description: 例の call_id を前のターンで実際に返された値に置き換え、前の output 全体を保持してください。
                value:
                  model: glm-5.3-flash
                  input:
                    - role: user
                      content: 北京の気温を調べてください。
                    - type: function_call
                      call_id: call_weather_demo
                      name: get_temperature
                      arguments: '{"city":"北京"}'
                    - type: function_call_output
                      call_id: call_weather_demo
                      output: '{"city":"北京","temperature":25}'
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  tools:
                    - type: function
                      name: get_temperature
                      description: 指定した都市の気温を返す
                      parameters:
                        type: object
                        properties:
                          city:
                            type: string
                        required:
                          - city
                        additionalProperties: false
                  tool_choice: none
              web_search:
                summary: サーバー側の Web 検索
                value:
                  model: glm-5.3-flash
                  input: Web 検索で Python 公式サイトのホームページのタイトルを調べ、タイトルと参照リンクだけを返してください。
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  tools:
                    - type: web_search
                  tool_choice: required
              web_search_history:
                summary: Web 検索後に会話を続ける
                description: >-
                  実際のリクエストでは、例の web_search_call と message を前のレスポンスの output
                  に含まれるすべての元の項目に置き換えてから、新しい質問を追加してください。id、status、action
                  などのフィールドはそのまま保持してください。web_search_call に対する
                  function_call_output を作成する必要はありません。
                value:
                  model: glm-5.3-flash
                  input:
                    - role: user
                      content: >-
                        Web 検索で Python
                        公式サイトのホームページのタイトルを調べ、タイトルと参照リンクだけを返してください。
                    - type: web_search_call
                      id: ws_search_demo
                      status: completed
                      action:
                        type: open_page
                        url: https://www.python.org
                    - type: message
                      id: msg_search_demo
                      status: completed
                      role: assistant
                      content:
                        - type: output_text
                          text: Welcome to Python.org — https://www.python.org
                          annotations: []
                    - role: user
                      content: 前のターンで見つけたホームページのタイトルは何ですか？再検索せず、タイトルだけを返してください。
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
              json_object:
                summary: JSON オブジェクト出力
                value:
                  model: glm-5.3-flash
                  input: >-
                    city フィールドの値が Beijing の有効な JSON オブジェクトのみを返してください。Markdown
                    は使用しないでください。
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  text:
                    format:
                      type: json_object
              image:
                summary: 画像理解（Flash の例）
                description: 例は赤い PNG 画像の Data URL です。
                value:
                  model: glm-5.3-flash
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  input:
                    - role: user
                      content:
                        - type: input_text
                          text: 画像は単色です。色だけを回答してください。
                        - type: input_image
                          image_url: >-
                            data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAIAAABMXPacAAABK0lEQVR4nO3RMQEAMAyAsLb+PW8y8hADHOybSEfraYDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANGOsDz+EB/5Uf+TQAAAAASUVORK5CYII=
              store:
                summary: 後から参照できる応答を作成（Flash）
                value:
                  model: glm-5.3-flash
                  input: 合言葉 BLUE-728 を覚え、「覚えました」とだけ返してください。
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  store: true
              previous_response:
                summary: 前の応答を参照（Flash）
                description: >-
                  先に応答を保存する例を実行し、返されたトップレベルの id を previous_response_id
                  に設定します。glm-5.2 はこの継続方法に対応していません。
                value:
                  model: glm-5.3-flash
                  input: 先ほどの合言葉は何ですか？合言葉だけを返してください。
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  previous_response_id: 前のターンで返された応答 ID
              flashx:
                summary: GLM-5.3-FlashX を呼び出す
                value:
                  model: glm-5.3-flashx
                  input: 自己紹介を一文でしてください。
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
              vision_flashx:
                summary: GLM-5.3-FlashX の画像入力
                value:
                  model: glm-5.3-flashx
                  max_output_tokens: 1024
                  reasoning:
                    effort: low
                  input:
                    - role: user
                      content:
                        - type: input_text
                          text: 画像は単色です。色だけを回答してください。
                        - type: input_image
                          image_url: >-
                            data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAIAAABMXPacAAABK0lEQVR4nO3RMQEAMAyAsLb+PW8y8hADHOybSEfraYDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANwBqANQBrANYArAFYA7AGYA3AGoA1AGsA1gCsAVgDsAZgDcAagDUAawDWAKwBWAOwBmANGOsDz+EB/5Uf+TQAAAAASUVORK5CYII=
      responses:
        '200':
          description: 生成完了または不完全な結果。status を確認してください。ストリーミングでは text/event-stream を返します。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesResponse'
              example:
                id: response_demo
                object: response
                created_at: 1789971757
                model: glm-5.3-flash
                status: completed
                output:
                  - type: message
                    id: message_demo
                    status: completed
                    role: assistant
                    content:
                      - type: output_text
                        text: こんにちは、GLM です。会話、文章作成、プログラミングをお手伝いします。
                        annotations: []
                usage:
                  input_tokens: 17
                  output_tokens: 24
                  total_tokens: 41
                  input_tokens_details:
                    cached_tokens: 0
                  output_tokens_details:
                    reasoning_tokens: 0
                error: null
            text/event-stream:
              schema:
                type: string
              example: >+
                event: response.output_text.delta

                data:
                {"type":"response.output_text.delta","item_id":"message_demo","output_index":0,"content_index":0,"delta":"こんにちは"}


                event: response.completed

                data:
                {"type":"response.completed","response":{"id":"response_demo","object":"response","created_at":1789971757,"model":"glm-5.3-flash","status":"completed","output":[{"type":"message","id":"message_demo","status":"completed","role":"assistant","content":[{"type":"output_text","text":"こんにちは","annotations":[]}]}],"usage":{"input_tokens":17,"output_tokens":3,"total_tokens":20},"error":null}}

        '400':
          description: >-
            無効なリクエストパラメータ。input の欠落、reasoning の形式不正、previous_response_id
            に非対応のモデルなどが該当します。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: API キーが無効、または有効期限切れです。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: 利用可能なクレジットが不足しています。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: リクエスト頻度の上限を超えました。待機時間を増やして再試行してください。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: サービスを一時的に利用できません。後で再試行してください。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ResponsesRequest:
      type: object
      properties:
        model:
          type: string
          description: >-
            GLM モデルを選択します。4 モデルともこのエンドポイントのテキスト入力に対応します。オプション機能はモデルによって異なります。


            | モデル ID | 入力 | 推論に関する注意 |

            | --- | --- | --- |

            | `glm-5.3` | テキスト | 実際のレベルは low / high / max。互換値は reasoning
            を参照。思考は無効化できません。 |

            | `glm-5.3-flash` | テキスト、画像 | glm-5.3 と同じ。画像には input_image を使用します。 |

            | `glm-5.3-flashx` | テキスト、画像 | glm-5.3 と同じ。画像には input_image を使用します。
            |

            | `glm-5.2` | テキスト | none でも思考トークンが生成される場合があり、思考の無効化は保証されません。 |
          enum:
            - glm-5.3
            - glm-5.3-flash
            - glm-5.3-flashx
            - glm-5.2
          default: glm-5.3-flash
          example: glm-5.3-flash
        input:
          description: >-
            必須。テキスト文字列、または Responses
            入力項目の配列。配列にはメッセージ、モデル出力の再送項目、function_call_output
            を含められます。複数ターンでは毎回すべての履歴を送信できます。システムプロンプトは先頭の role=system
            メッセージに置くことを推奨します。画像は input_image を使用し、glm-5.3-flash と glm-5.3-flashx
            のみ対応します。Chat Completions の messages / image_url ブロック形式は使用しないでください。
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/InputItem'
          example: 自己紹介を一文でしてください。
        max_output_tokens:
          type: integer
          minimum: 1
          description: >-
            今回の生成の出力トークン上限。思考トークンも含みます。1024
            を目安にタスクに応じて調整してください。少なすぎると思考中に上限に達し、reasoning
            項目のみで本文が返らない場合があります。status と incomplete_details を確認してください。パラメータ名は
            max_tokens ではなく max_output_tokens です。
          example: 1024
        stream:
          type: boolean
          default: false
          description: >-
            SSE ストリーミングを有効にします。本文は response.output_text.delta の delta
            から読み取ります。成功時の終了イベントは response.completed
            です。response.incomplete、response.failed、error
            でもそのターンを終了して処理してください。[DONE] や接続終了だけを待たないでください。
        reasoning:
          type: object
          properties:
            effort:
              type: string
              description: >-
                推論強度。low を推奨します。


                **glm-5.3 / glm-5.3-flash / glm-5.3-flashx の互換ルール**


                | 指定値 | 実際の思考レベル |

                | --- | --- |

                | `low` / `high` / `max` | 同じレベルを維持 |

                | `xhigh` | `max` |

                | `medium` | `high` |

                | `minimal` / `none` | low。思考は有効なまま |


                **minimal と none は 5.3 シリーズの思考を無効にしません。**
                思考トークンは出力として課金されます。認識されない値は互換変換せず、そのまま扱われます。表の値を使用してください。これらの互換ルールは
                glm-5.2 には適用されません。


                このエンドポイントでは glm-5.2 に none
                を指定しても思考トークンが生成される場合があり、思考の無効化は保証されません。
              enum:
                - max
                - xhigh
                - high
                - medium
                - low
                - minimal
                - none
              example: low
          description: >-
            Responses はトップレベルの reasoning_effort や thinking ではなく、ネストした
            reasoning.effort を使用します。思考の使用量は output_tokens に含まれます。簡単なタスクで
            reasoning_tokens=0 が返っても、思考の無効化に対応することを意味しません。
        instructions:
          type: string
          description: >-
            システム指示。glm-5.3-flash は input
            が文字列の場合にこのフィールドを使用できます。メッセージ配列の場合、システムプロンプトは先頭の role=system
            メッセージに置いてください。
        tools:
          type: array
          items:
            $ref: '#/components/schemas/Tool'
          description: >-
            クライアント側の function とサーバー側の web_search に対応します。関数は name / description /
            parameters を同じ階層に定義し、Chat Completions のような function
            オブジェクトにネストしないでください。function_call はアプリケーションで実行し、結果を返します。web_search
            はサーバー側で実行され、実際の検索はトークン料金に加えて呼び出し単位の料金が発生する場合があります。モデル料金を参照してください。
        tool_choice:
          description: >-
            auto はモデルが選択、none はツールなし、required はツール呼び出し必須です。関数を指定する場合は
            {"type":"function","name":"get_temperature"}
            を使用します。強制選択の動作は、すべてのモデルとツールの組み合わせで同一とは限りません。
          oneOf:
            - type: string
              enum:
                - auto
                - none
                - required
            - type: object
              properties:
                type:
                  type: string
                  const: function
                name:
                  type: string
              required:
                - type
                - name
          example: auto
        parallel_tool_calls:
          type: boolean
          description: >-
            1 ターンで複数のツール呼び出しを許可するかどうか。false でも関数呼び出しが 1 件だけになる保証はありません。すべての
            function_call を走査して処理してください。
        text:
          type: object
          properties:
            format:
              type: object
              properties:
                type:
                  type: string
                  description: >-
                    出力形式。text は通常のテキスト、json_object は JSON オブジェクトです。json_object
                    では有効な JSON をプロンプトで明示的に要求し、クライアントで解析・検証してください。厳密な JSON Schema
                    制約は提供されないため、json_schema や strict=true で構造が保証されるとは限りません。
                  enum:
                    - text
                    - json_object
                  example: json_object
              required:
                - type
          description: 出力形式。例では json_object を使用します。HTTP 200 は JSON Schema への適合を保証しません。
        store:
          type: boolean
          description: >-
            後で参照できるように応答を保存します。glm-5.3-flash と glm-5.3-flashx は store=true と
            previous_response_id による会話継続に対応します。glm-5.2 は応答 ID
            による継続に非対応で、store=true でも有効になりません。input に全履歴を含めてください。
        previous_response_id:
          type: string
          description: >-
            前の応答のトップレベルの id。glm-5.3-flash と glm-5.3-flashx は store=true
            と同一モデルで使用できます。output 内の項目 ID ではなく、応答 ID をそのまま指定してください。glm-5.2 では 400
            を返します。モデルを切り替える場合はこのフィールドを省略し、input に全履歴を含めてください。
          example: 前のターンで返された応答 ID
        metadata:
          type: object
          additionalProperties:
            type: string
          description: カスタムの文字列キー・値のメタデータ。応答の metadata から取得できます。キーや機密情報を含めないでください。
          example:
            conversation: demo
        temperature:
          type: number
          description: サンプリングパラメータ。有効範囲と効果はモデルによって異なります。決定的な出力を保証するものではなく、推論タスクでは省略できます。
        top_p:
          type: number
          description: サンプリングパラメータ。有効範囲と効果はモデルによって異なり、通常は省略できます。
      required:
        - model
        - input
    ResponsesResponse:
      type: object
      properties:
        id:
          type: string
          description: 今回の応答 ID。previous_response_id にはそのまま指定します。
          example: response_demo
        object:
          type: string
          const: response
        created_at:
          type: integer
          description: 作成時刻。Unix 秒単位。
        model:
          type: string
          example: glm-5.3-flash
        status:
          type: string
          description: >-
            completed は今回の生成終了を示し、ツール呼び出しのみの場合もあります。incomplete
            は出力が不完全であることを示します。output と error を両方確認してください。
          enum:
            - completed
            - incomplete
            - failed
            - in_progress
            - queued
        output:
          type: array
          items:
            $ref: '#/components/schemas/OutputItem'
          description: >-
            順序付き出力項目。type=message の content 内にある type=output_text の text
            が本文です。reasoning が本文より前に来る場合や、function_call のターンに本文がない場合があります。常に
            output[0] を読む実装は避けてください。
        output_text:
          type: string
          description: 本文を集約したオプションフィールド。存在しない場合があります。汎用クライアントでは output を走査してください。
        usage:
          $ref: '#/components/schemas/Usage'
        error:
          type:
            - object
            - 'null'
          description: 応答エラー。成功時は通常 null です。
          additionalProperties: true
        incomplete_details:
          type: object
          properties:
            reason:
              type: string
              description: 出力が打ち切られた場合の詳細。例：max_output_tokens。
        metadata:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            param:
              type:
                - string
                - 'null'
            code:
              type:
                - string
                - integer
                - 'null'
      required:
        - error
    InputItem:
      description: >-
        メッセージ、関数結果、または前の output からそのまま再送する項目。ツール結果には返された call_id
        を使用し、前の出力項目の元のフィールドを保持してください。
      oneOf:
        - $ref: '#/components/schemas/InputMessage'
        - $ref: '#/components/schemas/FunctionCallOutput'
        - type: object
          properties:
            type:
              type: string
              description: 再送する出力項目の種類。
              enum:
                - function_call
                - reasoning
                - web_search_call
            id:
              type: string
            call_id:
              type: string
            name:
              type: string
            arguments:
              type: string
              description: JSON 文字列にエンコードされた引数。
            status:
              type: string
            action:
              type: object
              additionalProperties: true
              description: web_search_call の検索またはページアクセスの操作。
          required:
            - type
    Tool:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              const: function
            name:
              type: string
            description:
              type: string
            parameters:
              type: object
              description: 関数パラメータの JSON Schema。
            strict:
              type: boolean
              description: 関数引数の制約オプション。関数を実行する前に、クライアントで arguments の解析・検証が必要です。
          required:
            - type
            - name
            - parameters
        - type: object
          properties:
            type:
              type: string
              const: web_search
          required:
            - type
    OutputItem:
      type: object
      properties:
        type:
          type: string
          description: 主な種類：message、reasoning、function_call、web_search_call。
          enum:
            - message
            - reasoning
            - function_call
            - web_search_call
        id:
          type: string
        status:
          type: string
        role:
          type: string
        content:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              text:
                type: string
              annotations:
                type: array
                items:
                  type: object
          description: message 内は output_text、reasoning 内は reasoning_text の場合があります。
        summary:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              text:
                type: string
          description: 思考内容は summary_text で返る場合もあります。すべての reasoning 項目に content があるとは限りません。
        call_id:
          type: string
          description: 結果の返送に使用する関数呼び出し ID。
        name:
          type: string
          description: 関数名。
        arguments:
          type: string
          description: 関数引数の JSON 文字列。実行前に解析と検証を行ってください。
        action:
          type: object
          additionalProperties: true
          description: web_search_call の検索またはページアクセスの操作。
      required:
        - type
    Usage:
      type: object
      properties:
        input_tokens:
          type: integer
          description: 入力トークン総数。キャッシュにヒットした分を含みます。
        output_tokens:
          type: integer
          description: 出力トークン総数。思考トークンを含みます。
        total_tokens:
          type: integer
          description: 入力と出力のトークン合計。
        input_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
              description: >-
                入力のうちキャッシュにヒットしたトークン数。input_tokens
                に再加算しないでください。プレフィックスキャッシュは自動で、明示的な cache_control
                は不要です。ヒット数は返された値で確認してください。
        output_tokens_details:
          type: object
          properties:
            reasoning_tokens:
              type: integer
              description: >-
                出力のうち思考に使われたトークン数。output_tokens に二重計上しないでください。この詳細は省略される場合や 0
                の場合があります。
    InputMessage:
      type: object
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
        content:
          description: >-
            テキスト文字列または入力コンテンツブロックの配列。既存の assistant 出力を再送する場合、output_text
            ブロックをそのまま保持できます。
          oneOf:
            - type: string
            - type: array
              items:
                oneOf:
                  - $ref: '#/components/schemas/InputText'
                  - $ref: '#/components/schemas/InputImage'
                  - $ref: '#/components/schemas/OutputText'
      required:
        - role
        - content
    FunctionCallOutput:
      type: object
      properties:
        type:
          type: string
          const: function_call_output
        call_id:
          type: string
          description: 元の function_call の call_id。
        output:
          type: string
          description: 関数結果。通常は JSON エンコードされた文字列です。
      required:
        - type
        - call_id
        - output
    InputText:
      type: object
      properties:
        type:
          type: string
          const: input_text
        text:
          type: string
      required:
        - type
        - text
    InputImage:
      type: object
      properties:
        type:
          type: string
          const: input_image
        image_url:
          type: string
          description: >-
            公開画像 URL または Base64 Data URL。PNG
            の例：data:image/png;base64,...。画像に対応するのは glm-5.3-flash /
            glm-5.3-flashx のみです。glm-5.3 と glm-5.2 にはテキストのみを使用してください。
      required:
        - type
        - image_url
    OutputText:
      type: object
      properties:
        type:
          type: string
          const: output_text
        text:
          type: string
        annotations:
          type: array
          items:
            type: object
      required:
        - type
        - text
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Authorization ヘッダーに Bearer YOUR_API_KEY を指定します。

````