> ## 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/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 Flash 的发布调用 ID。使用 Messages 格式调用本页的 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/integrations/mcp)

## 相关链接

* [支持的LLM模型](https://apixo.ai/docs/zh/llm/supported-models.md)
* [Claude Messages API](https://apixo.ai/docs/zh/models/text/claude.md)
* [兼容的 SDK](https://apixo.ai/docs/zh/llm/official-sdks.md)
* [流式传输](https://apixo.ai/docs/zh/llm/streaming.md)
* [身份验证](https://apixo.ai/docs/zh/llm/authentication.md)
* [错误与重试](https://apixo.ai/docs/zh/llm/errors-retry.md)


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