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

# Messages API：接入 GLM、DeepSeek、Kimi 和 Grok 模型

> 透過 APIXO 的 Messages 相容端點呼叫 GLM、DeepSeek、Kimi 與 Grok 模型，並指定精確模型 ID、支援串流回應與標準 token 費率。

這些模型使用與 Anthropic Messages 相容的請求與回應格式。它們屬於獨立的模型家族；協議相容性不表示它們是 Claude 模型。若要呼叫 Claude 模型，請參閱[Claude 閘道](https://apixo.ai/docs/zh-hant/models/text/claude.md)。

## 比較 Messages 模型與價格

| 模型 | 模型 ID | 推薦用於 | 輸入 | 輸出 | 快取寫入 | 快取讀取 | 節省比例 |
| - | - | - | -: | -: | -: | -: | -: |
| GLM 5.3 | `glm-5.3` | 各模型的 Messages API 串接方式 | \$0.9 | \$3.15 | \$0 | \$0.225 | 25% |
| GLM 5.2 | `glm-5.2` | 各模型的 Messages API 串接方式 | \$0.9 | \$3.15 | \$0 | \$0.225 | 25% |
| GLM 5.1 | `glm-5.1` | 各模型的 Messages API 串接方式 | \$0.9 | \$3.15 | \$0 | \$0.225 | 25% |
| DeepSeek V4.1 Flash | `deepseek-flash` | 各模型的 Messages API 串接方式 | \$0.18 | \$0.72 | \$0 | \$0.0036 | 40% |
| DeepSeek V4 Pro | `deepseek-v4-pro` | 各模型的 Messages API 串接方式 | \$0.792 | \$2.376 | \$0 | \$0.0264 | 40% |
| Kimi K3.1 Pro | `kimi-k3.1-pro` | 各模型的 Messages API 串接方式 | \$1.5492 | \$8.10344 | \$1.5492 | \$0.15488 | 20% |
| Kimi K3 | `kimi-k3` | 各模型的 Messages API 串接方式 | \$2.38336 | \$11.9168 | \$2.38336 | \$0.23832 | 20% |
| Kimi K2.7 Code | `kimi-k2.7-code` | 各模型的 Messages API 串接方式 | \$0.77456 | \$3.21752 | \$0 | \$0.15488 | 20% |
| Kimi K2.6 | `kimi-k2.6` | 各模型的 Messages API 串接方式 | \$0.77456 | \$3.21752 | \$0 | \$0.13112 | 20% |
| Grok 4.7 | `grok-4.7` | 各模型的 Messages API 串接方式 | \$1.2 | \$3.6 | \$0 | \$0.3 | 40% |
| Grok 4.6 | `grok-4.6` | 各模型的 Messages API 串接方式 | \$1.2 | \$3.6 | \$0 | \$0.3 | 40% |
| Grok 4.5 | `grok-4.5` | 各模型的 Messages API 串接方式 | \$1.2 | \$3.6 | \$0 | \$0.18 | 40% |

每 100 萬 token 的價格以美元列出。核價日期：2026-11-18。節省比例以標準輸入價與一般市場參考價比較得出。GLM、Kimi、DeepSeek 與 Grok 的標準價分別為參考價的 75%、80%、60% 與 60%。實際價格可能因帳戶而異。費率為 \$0 表示此價目表對快取寫入不另外收費。詳見[API 定價](https://apixo.ai/pricing/api)。

## 改變什麼

| 設定 | APIXO 值 |
| - | - |
| SDK Base URL | `https://llm.apixo.ai` |
| 原始 HTTP 路徑 | `POST /v1/messages` |
| 請求 URL | `https://llm.apixo.ai/v1/messages` |
| API 金鑰標頭 | `x-api-key` |
| API 金鑰值 | `$APIXO_API_KEY` |
| 必填的版本標頭 | `anthropic-version: 2023-06-01` |
| 模型位置 | 請求主體 `model` |

## 快速入門

```bash theme={null}
curl https://llm.apixo.ai/v1/messages \
  -H "x-api-key: $APIXO_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-5.3","max_tokens":256,"messages":[{"role":"user","content":"Reply with OK."}]}'
```

```python theme={null}
import os
from anthropic import Anthropic

client = Anthropic(api_key=os.environ["APIXO_API_KEY"], base_url="https://llm.apixo.ai")
response = client.messages.create(
    model="glm-5.3",
    max_tokens=256,
    messages=[{"role": "user", "content": "Reply with OK."}],
)
print(response.content)
```

僅更動 `model` 參數以使用此頁面提供的另一個 ID。`deepseek-flash` 是 DeepSeek V4.1 閃光模型的公開呼叫 ID。使用訊息格式來呼叫此頁面的 Grok 文字模型；Grok 影像與影片任務 API 屬於獨立產品。

## 串流媒體和使用

將 `"stream": true` 新增至相同請求主體以接收訊息 SSE 事件。回應報告實際令牌使用情況，包括快取讀取和寫入（如果存在）。計費將普通輸入、輸出、快取讀取和快取寫入令牌分開。將 API 金鑰保留在伺服器端並使用 [API 定價](https://apixo.ai/pricing/api) 以取得目前費率。

## 支援的訊息模型

* `glm-5.3`
* `glm-5.2`
* `glm-5.1`
* `deepseek-flash`
* `deepseek-v4-pro`
* `kimi-k3.1-pro`
* `kimi-k3`
* `kimi-k2.7-code`
* `kimi-k2.6`
* `grok-4.7`
* `grok-4.6`
* `grok-4.5`

## 遠端 MCP 可用性

呼叫 `list_models` 時傳入 `integration_type: llm_gateway`，即可查詢這些模型的 ID。將選定的 ID 傳給 `get_model_schema` 可檢視 Messages 協議，傳給 `get_integration_guide` 可取得服務端 SDK 配置。[APIXO MCP](https://apixo.ai/docs/zh-hant/integrations/mcp)

## 相關連結

* [支援的LLM型號](https://apixo.ai/docs/zh-hant/llm/supported-models.md)
* [Claude Messages API](https://apixo.ai/docs/zh-hant/models/text/claude.md)
* [相容的 SDK](https://apixo.ai/docs/zh-hant/llm/official-sdks.md)
* [正在傳輸](https://apixo.ai/docs/zh-hant/llm/streaming.md)
* [身分驗證](https://apixo.ai/docs/zh-hant/llm/authentication.md)
* [錯誤並重試](https://apixo.ai/docs/zh-hant/llm/errors-retry.md)


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