返回模型列表

GLM 4.7 Flash

zhipuzhipu/glm-4.7-flash

API 使用指南

基础对话补全

GLM-4.7-Flash 完全兼容 OpenAI API。只需更换模型名称并将 baseURL 指向 TheRouter,现有 SDK 代码无需修改即可运行。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zhipu/glm-4.7-flash",
    "messages": [{"role": "user", "content": "Explain MoE architectures in one paragraph."}]
  }'

工具 / 函数调用

GLM-4.7-Flash 支持原生函数调用。结合 200K 上下文窗口和保留思维模式,可处理复杂的多步工具调用序列而不丢失中间状态。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zhipu/glm-4.7-flash",
    "messages": [{"role": "user", "content": "What is the weather in Shanghai?"}],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Get current weather for a city",
        "parameters": {
          "type": "object",
          "properties": {"city": {"type": "string"}},
          "required": ["city"]
        }
      }
    }],
    "tool_choice": "auto"
  }'

流式响应

启用流式响应,实时接收生成的 token,非常适合对响应速度有要求的交互式编程助手和聊天 UI。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zhipu/glm-4.7-flash",
    "stream": true,
    "messages": [{"role": "user", "content": "Write a bubble sort in TypeScript."}]
  }'

本地自托管部署

GLM-4.7-Flash 可在单张 RTX 4090 上运行。以下命令通过 vLLM 启动兼容 OpenAI 的本地服务;将 TheRouter 的 BYOK 基础 URL 指向此地址即可实现混合路由。

cURL
# Start local vLLM server (requires vLLM main branch)
vllm serve zai-org/GLM-4.7-Flash \
  --tensor-parallel-size 1 \
  --speculative-config.method mtp \
  --speculative-config.num_speculative_tokens 1 \
  --tool-call-parser glm47 \
  --reasoning-parser glm45 \
  --enable-auto-tool-choice \
  --served-model-name glm-4.7-flash

# Then call it like any OpenAI endpoint
curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-4.7-flash","messages":[{"role":"user","content":"Hello"}]}'
事实档案 — 本页每条断言可在此回溯来源
来源URL采集于
架构huggingface.co/zai-org/GLM-4.7-Flash ↗2026-06-09已核实
上下文窗口docs.z.ai ↗2026-06-09已核实
最大输出 token 数docs.z.ai ↗2026-06-09已核实
精度 / 张量类型huggingface.co/zai-org/GLM-4.7-Flash ↗2026-06-09已核实
许可证huggingface.co/zai-org/GLM-4.7-Flash ↗2026-06-09已核实
支持语言huggingface.co/zai-org/GLM-4.7-Flash ↗2026-06-09已核实
推理框架支持huggingface.co/zai-org/GLM-4.7-Flash ↗2026-06-09已核实
本地显存需求awesomeagents.ai ↗2026-06-09待核实
TheRouter 定价docs.z.ai ↗2026-06-09已核实
SWE-bench Verifiedhuggingface.co/zai-org/GLM-4.7-Flash ↗2026-06-09已核实
τ²-Bench (tau2-Bench)huggingface.co/zai-org/GLM-4.7-Flash ↗2026-06-09已核实
AIME 2025huggingface.co/zai-org/GLM-4.7-Flash ↗2026-06-09已核实
GPQA-Diamondhuggingface.co/zai-org/GLM-4.7-Flash ↗2026-06-09已核实
LCB v6 (LiveCodeBench)huggingface.co/zai-org/GLM-4.7-Flash ↗2026-06-09已核实
HLE (Humanity's Last Exam)huggingface.co/zai-org/GLM-4.7-Flash ↗2026-06-09已核实
BrowseComphuggingface.co/zai-org/GLM-4.7-Flash ↗2026-06-09已核实
智谱 AI 发布 GLM-4.7-Flash:零成本最强 30B 级 Agent 模型marktechpost.com ↗2026-06-09已核实
GLM-4.7-Flash 在 TheRouter 上真的免费吗?docs.z.ai ↗2026-06-09待核实
什么是「保留思维模式」,何时应该使用它?docs.z.ai/guides/capabilities/thinking-mode ↗2026-06-09待核实
GLM-4.7-Flash 与完整版 GLM-4.7 相比如何?docs.z.ai ↗2026-06-09待核实
我可以在自己的 GPU 上本地运行 GLM-4.7-Flash 吗?huggingface.co/zai-org/GLM-4.7-Flash ↗2026-06-09待核实
GLM-4.7-Flash 和 GLM-4.7-FlashX 有什么区别?docs.z.ai ↗2026-06-09待核实
帮助与联系