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
sourceURLretrieved
Architecturehuggingface.co/zai-org/GLM-4.7-Flash β†—2026-06-09verified
Context windowdocs.z.ai β†—2026-06-09verified
Max output tokensdocs.z.ai β†—2026-06-09verified
Precision / tensor typehuggingface.co/zai-org/GLM-4.7-Flash β†—2026-06-09verified
Licensehuggingface.co/zai-org/GLM-4.7-Flash β†—2026-06-09verified
Supported languageshuggingface.co/zai-org/GLM-4.7-Flash β†—2026-06-09verified
Inference frameworkshuggingface.co/zai-org/GLM-4.7-Flash β†—2026-06-09verified
Local VRAM requirementawesomeagents.ai β†—2026-06-09to verify
Pricing on TheRouterdocs.z.ai β†—2026-06-09verified
SWE-bench Verifiedhuggingface.co/zai-org/GLM-4.7-Flash β†—2026-06-09verified
τ²-Bench (tau2-Bench)huggingface.co/zai-org/GLM-4.7-Flash β†—2026-06-09verified
AIME 2025huggingface.co/zai-org/GLM-4.7-Flash β†—2026-06-09verified
GPQA-Diamondhuggingface.co/zai-org/GLM-4.7-Flash β†—2026-06-09verified
LCB v6 (LiveCodeBench)huggingface.co/zai-org/GLM-4.7-Flash β†—2026-06-09verified
HLE (Humanity's Last Exam)huggingface.co/zai-org/GLM-4.7-Flash β†—2026-06-09verified
BrowseComphuggingface.co/zai-org/GLM-4.7-Flash β†—2026-06-09verified
Zhipu AI releases GLM-4.7-Flash: strongest 30B-class agent model at zero costmarktechpost.com β†—2026-06-09verified
Is GLM-4.7-Flash actually free to use on TheRouter?docs.z.ai β†—2026-06-09to verify
What is Preserved Thinking mode and when should I use it?docs.z.ai/guides/capabilities/thinking-mode β†—2026-06-09to verify
How does GLM-4.7-Flash compare to the full GLM-4.7?docs.z.ai β†—2026-06-09to verify
Can I run GLM-4.7-Flash locally on my own GPU?huggingface.co/zai-org/GLM-4.7-Flash β†—2026-06-09to verify
What is the difference between GLM-4.7-Flash and GLM-4.7-FlashX?docs.z.ai β†—2026-06-09to verify
Help & contact