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

# GLM-5

> GLM-5: 汎用言語モデル。MixRouteでのリクエスト例とパラメーター。

GLM-5は、Zhipuの汎用言語モデルです。

以下のエンドポイントを使用し、MixRouteを通じて`glm-5`を呼び出します。

## 主な機能

* OpenAI互換 - base\_urlを変更することでOpenAI SDKから利用できます
* ストリーミング - SSEを通じたリアルタイムのトークン出力
* 複数ターンの会話 - ロールに基づくメッセージを使用

## 簡単な使用例

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.mixroute.ai/v1/chat/completions" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "model": "glm-5",
      "messages": [
        {
          "role": "user",
          "content": "Explain quantum entanglement in simple terms."
        }
      ],
      "max_tokens": 256
    }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    from openai import OpenAI

    client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.mixroute.ai/v1")

    response = client.chat.completions.create(
        model="glm-5",
        messages=[{"role": "user", "content": "Explain quantum entanglement in simple terms."}],
        max_tokens=256,
    )

    print(response.choices[0].message.content)
    ```
  </Tab>

  <Tab title="ストリーミング">
    ```python theme={null}
    from openai import OpenAI

    client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.mixroute.ai/v1")

    stream = client.chat.completions.create(
        model="glm-5",
        messages=[{"role": "user", "content": "Write a short poem about the sea."}],
        max_tokens=256,
        stream=True,
    )

    for chunk in stream:
        print(chunk.choices[0].delta.content or "", end="")
    ```
  </Tab>
</Tabs>

## パラメータ

| パラメーター | 型 | 必須 | 説明 |
| - | - | - | - |
| `model` | string | はい | `glm-5`である必要があります。 |
| `messages` | array | はい | roleとcontentを含む会話メッセージ。 |
| `max_tokens` | integer | いいえ | 生成するトークンの最大数。 |
| `stream` | boolean | いいえ | SSEストリーミングを有効にします。デフォルト: false。 |
| `temperature` | number | いいえ | モデルが対応している場合のサンプリング温度。 |
| `top_p` | number | いいえ | 対応している場合のNucleusサンプリングのしきい値。 |
| `stop` | string \| array | いいえ | 生成を停止するシーケンス。 |
| `tools` | array | いいえ | OpenAI互換のツール定義。 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.