Back to Models
GLM 4.7 Flash
zhipuzhipu/glm-4.7-flash
API guide
Basic chat completion
GLM-4.7-Flash is fully OpenAI-compatible. Swap the model name and point baseURL to TheRouter β your existing SDK code works unchanged.
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."}]
}'Tool / function calling
GLM-4.7-Flash supports native function calling. Combined with its 200K context window and Preserved Thinking mode, it handles complex multi-step tool sequences without losing intermediate state.
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"
}'Streaming responses
Enable streaming to receive tokens as they are generated, ideal for interactive coding assistants and chat UIs where responsiveness matters.
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."}]
}'Self-hosted local deployment
GLM-4.7-Flash runs on a single RTX 4090. The commands below start an OpenAI-compatible local server via vLLM; point TheRouter's BYOK base URL here for hybrid routing.
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"}]}'Fact ledger β every claim on this page traces here
| source | URL | retrieved | |
|---|---|---|---|
| Architecture | huggingface.co/zai-org/GLM-4.7-Flash β | 2026-06-09 | verified |
| Context window | docs.z.ai β | 2026-06-09 | verified |
| Max output tokens | docs.z.ai β | 2026-06-09 | verified |
| Precision / tensor type | huggingface.co/zai-org/GLM-4.7-Flash β | 2026-06-09 | verified |
| License | huggingface.co/zai-org/GLM-4.7-Flash β | 2026-06-09 | verified |
| Supported languages | huggingface.co/zai-org/GLM-4.7-Flash β | 2026-06-09 | verified |
| Inference frameworks | huggingface.co/zai-org/GLM-4.7-Flash β | 2026-06-09 | verified |
| Local VRAM requirement | awesomeagents.ai β | 2026-06-09 | to verify |
| Pricing on TheRouter | docs.z.ai β | 2026-06-09 | verified |
| SWE-bench Verified | huggingface.co/zai-org/GLM-4.7-Flash β | 2026-06-09 | verified |
| ΟΒ²-Bench (tau2-Bench) | huggingface.co/zai-org/GLM-4.7-Flash β | 2026-06-09 | verified |
| AIME 2025 | huggingface.co/zai-org/GLM-4.7-Flash β | 2026-06-09 | verified |
| GPQA-Diamond | huggingface.co/zai-org/GLM-4.7-Flash β | 2026-06-09 | verified |
| LCB v6 (LiveCodeBench) | huggingface.co/zai-org/GLM-4.7-Flash β | 2026-06-09 | verified |
| HLE (Humanity's Last Exam) | huggingface.co/zai-org/GLM-4.7-Flash β | 2026-06-09 | verified |
| BrowseComp | huggingface.co/zai-org/GLM-4.7-Flash β | 2026-06-09 | verified |
| Zhipu AI releases GLM-4.7-Flash: strongest 30B-class agent model at zero cost | marktechpost.com β | 2026-06-09 | verified |
| Is GLM-4.7-Flash actually free to use on TheRouter? | docs.z.ai β | 2026-06-09 | to verify |
| What is Preserved Thinking mode and when should I use it? | docs.z.ai/guides/capabilities/thinking-mode β | 2026-06-09 | to verify |
| How does GLM-4.7-Flash compare to the full GLM-4.7? | docs.z.ai β | 2026-06-09 | to verify |
| Can I run GLM-4.7-Flash locally on my own GPU? | huggingface.co/zai-org/GLM-4.7-Flash β | 2026-06-09 | to verify |
| What is the difference between GLM-4.7-Flash and GLM-4.7-FlashX? | docs.z.ai β | 2026-06-09 | to verify |