Skip to main content
Vendor: Zhipu (智谱) Model ID: glm-5-1 Capability: 128K context · vision · tool use · streaming · structured output · CJK-native Pricing: per-token, mid tier (live rate) GLM-5.1 is the refinement step on GLM-5 — same context window with added vision support, tighter tool-call argument generation, and a measurable quality bump on Chinese-market code generation. Default starting point for new Chinese-market projects on the gateway.

Request

curl https://llm.bytespike.ai/v1/chat/completions \
  -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "glm-5-1",
    "messages": [{"role": "user", "content": "用中文写一份产品发布公告。"}]
  }'

Body parameters

FieldTypeRequiredDefaultNotes
modelstringyesglm-5-1
messagesarrayyesCJK accepted natively. Vision via image_url blocks.
max_tokensintegernomodel maxMax: 16384.
toolsarraynoFunction calling supported (parallel).
response_formatobjectnoJSON / structured output.
streambooleannofalseSSE streaming.

Response

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

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-1", "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

  • New Chinese-market projects with mixed text + vision input.
  • Tool-using agents in CJK languages.
  • For prior version (no vision), see GLM-5.
  • For longer context, see Kimi K2.6.
  • For Chinese code-heavy work, see DeepSeek V4 Pro.

Limits

LimitValue
Context window128K tokens
Max output16384 tokens
Supports tool useYes (parallel)
Supports visionYes
Supports streamingYes
Supports prompt cachingAutomatic