Skip to main content
Vendor: Zhipu (智谱) Model ID: glm-5 Capability: 128K context · tool use · streaming · structured output · CJK-native Pricing: per-token, mid tier (live rate) GLM-5 is Zhipu’s prior flagship — the model that brought tool use and structured output to parity with Western mid-tiers in the Chinese open-weight ecosystem. Still a fine production model. GLM-5-1 is the recommended starting point for new work.

Request

curl https://llm.bytespike.ai/v1/chat/completions \
  -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "glm-5",
    "messages": [{"role": "user", "content": "把这段技术文档翻译成英文,保留专业术语。"}]
  }'

Body parameters

FieldTypeRequiredDefaultNotes
modelstringyesglm-5
messagesarrayyesCJK accepted natively.
max_tokensintegernomodel maxMax: 8192.
toolsarraynoFunction calling supported.
response_formatobjectnoJSON mode.
streambooleannofalseSSE streaming.

Response

{
  "id": "chatcmpl-…",
  "object": "chat.completion",
  "model": "glm-5",
  "choices": [{"index": 0, "message": {"role": "assistant", "content": "..."}, "finish_reason": "stop"}],
  "usage": {"prompt_tokens": 412, "completion_tokens": 587, "total_tokens": 999}
}

Code examples

curl https://llm.bytespike.ai/v1/chat/completions \
  -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
  -H "content-type: application/json" \
  -d '{"model": "glm-5", "messages": [{"role": "user", "content": "翻译技术文档"}]}'

Streaming + caching

"stream": true for SSE. Automatic prompt caching.

Errors

CodeTriggerBilled?
400 / 401 / 402 / 422 / 429StandardNo
5xxUpstreamNo (auto-retry)

When to use

  • Existing Chinese-market projects validated against this version.
  • For new work, prefer GLM-5-1.
  • For larger context, see Kimi K2.6.

Limits

LimitValue
Context window128K tokens
Max output8192 tokens
Supports tool useYes
Supports visionNo
Supports streamingYes
Supports prompt cachingAutomatic