Skip to content
StartGLM API

GLM API

Two GLM 5.3 models, three native APIs, cache, web search, and exact billing.

GLM uses the same gd-… key and shared Guard balance. The public catalog contains exactly two models: GLM 5.3 (glm-5.3) and GLM 5.3 Flash (glm-5.3-flash); setup guides default to glm-5.3.

ModelInputFormat status
glm-5.3TextText contract
glm-5.3-flashText, images, PDF; MP4 in ChatPNG and PDF were read through all three protocols; MP4 video is confirmed through Chat only; native TXT, DOCX, and XLSX are not confirmed

Three APIs and two namespaces

APIShared routeFamily route
MessagesPOST /v1/messagesPOST /glm/v1/messages
Chat CompletionsPOST /v1/chat/completionsPOST /glm/v1/chat/completions
ResponsesPOST /v1/responsesPOST /glm/v1/responses
bash
curl https://api.guardrelay.ai/glm/v1/messages \
  -H "Authorization: Bearer $GUARD_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model":"glm-5.3","max_tokens":128,"messages":[{"role":"user","content":"Reply with OK"}]}'
bash
curl https://api.guardrelay.ai/glm/v1/chat/completions \
  -H "Authorization: Bearer $GUARD_API_KEY" \
  -H "content-type: application/json" \
  -d '{"model":"glm-5.3","messages":[{"role":"user","content":"Reply with OK"}],"stream":true}'
bash
curl https://api.guardrelay.ai/glm/v1/responses \
  -H "Authorization: Bearer $GUARD_API_KEY" \
  -H "content-type: application/json" \
  -d '{"model":"glm-5.3","input":"Reply with OK","max_output_tokens":128,"store":false}'

Rates

Model IDInput / 1MCache read / 1MOutput / 1MWeb search
glm-5.3$1.40$0.26$4.40$0.10 / confirmed call
glm-5.3-flash$0.15$0.03$0.50$0.10 / confirmed call

The multiplier is 1, including PRIVATE. An applied server prompt is part of actual billable input. Messages reports input excluding cache reads, while Chat and Responses include cache in total input; Guard normalizes these shapes without subtracting cache twice.

Free token counting

bash
curl https://api.guardrelay.ai/glm/v1/messages/count_tokens \
  -H "Authorization: Bearer $GUARD_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model":"glm-5.3","messages":[{"role":"user","content":"Count this text"}]}'

Responses and server prompt

  • Responses defaults to store: true and preserves explicit store: false.
  • previous_response_id continues only with the same Guard key and provider account. If that account is unavailable, Guard returns an explicit error before reserve and does not move state to another account.
  • The GLM server prompt is off by default. Applying it requires a separate entitlement, an enabled toggle, and an active server revision. Model replacement is also off by default and is limited to GLM requests with an applied prompt.

Documentation sections

On this page