Chat completion

POST/api/paas/v4/chat/completions

Published by Z.aiPublisher docs
curl -X POST https://api.orthogonal.com/v1/run \
-H 'Authorization: Bearer orth_live_••••' \
-H 'Content-Type: application/json' \
-d '{
"api": "zai",
"path": "/api/paas/v4/chat/completions",
"method": "POST",
"body": {
"model": "",
"messages": [
{
"role": "",
"content": ""
}
],
"thinking": {
"type": ""
},
"max_tokens":
}
}'
{
"success": true,
"data": {
"id": "20261121070515d475d67bc6964129",
"model": "glm-4.6",
"usage": { … },
"object": "chat.completion",
"choices": [ 1 item ],
"created": 1795215916,
"request_id": "20261121070515d475d67bc6964129"
}
}
A real response, recorded when Orthogonal checked this endpoint.

The final charge depends on what comes back. It shows after Run.

from$0.0327per 1M tokens · varies by model

Response-basedYou pay for the prompt, cached and completion tokens the call uses at the model's rate, read from the response, never more than $2.228749 per call.

You aren't charged for failed calls. A wallet payment for a failed call is refunded.

About this endpoint

Create a chat completion with Z.ai's GLM models (text: glm-5.3, glm-5.2, glm-5.1, glm-5, glm-4.7, glm-4.6; vision: glm-5.3-flash, glm-5.3-flashx, glm-5.3-flashx-legal). Supports multimodal input on the vision models, function tools, thinking mode, JSON output and streaming. Priced per token at the model's official rate; the built-in web_search and retrieval tools are not offered.

Body parameters

Response types

More from Z.ai

  1. Web page readerPOST/api/paas/v4/reader$0.0109 per callFixed
  2. Agent taskPOST/api/v1/agentsFrom $0.763 per 1M tokens · varies by agentResponse-based · up to $1.09
  3. Async image generationPOST/api/paas/v4/async/images/generations$0.01635 per callFixed
  4. Web searchPOST/api/paas/v4/web_search$0.0109 per callFixed
  5. Image/video job resultGET/api/paas/v4/async-result/{id}Free
  6. Token countPOST/api/paas/v4/tokenizer$0.000109 per callFixed
  7. Video generationPOST/api/paas/v4/videos/generations$0.218 per callFixed
  8. Agent job resultPOST/api/v1/agents/async-resultFree
  9. Speech to textPOST/api/paas/v4/audio/transcriptions$0.001308 per callFixed
  10. Document OCR parsingPOST/api/paas/v4/layout_parsing$0.0327 per 1M tokensResponse-based · up to $0.00981
  11. Slides conversation exportPOST/api/v1/agents/conversationFree
  12. Image generationPOST/api/paas/v4/images/generations$0.01635 per callFixed
All 14 Z.ai endpoints

Similar endpoints

  1. OpenRouter · Chat CompletionPOST/chat/completionsUp to $5.00 per callResponse-based
  2. Baseten · Chat CompletionsPOST/v1/chat/completions$0.60 per 1M tokensResponse-based · up to $0.20
  3. Perplexity · Chat CompletionsPOST/chat/completions$0.01 per callFixed
  4. Massive Web · AI CompletionGET/ai$0.0625 per callFixed