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
modelrequiredstringModel code. Text models: glm-5.3, glm-5.2, glm-5.1, glm-5, glm-4.7, glm-4.6. Vision models: glm-5.3-flash, glm-5.3-flashx, glm-5.3-flashx-legal.messagesrequiredobjectThe current conversation message list as the model’s prompt input, provided in JSON array format, e.g.,{“role”: “user”, “content”: “Hello”}. Possible message types include system messages, user messages, assistant messages, and tool messages. Note: The input must not consist of system messages or assistant messages only.do_samplebooleanWhen do_sample is true, sampling strategy is enabled; when do_sample is false, sampling strategy parameters such as temperature and top_p will not take effect. Default value is true.streambooleanThis parameter should be set to false or omitted when using synchronous call. It indicates that the model returns all content at once after generating all content. Default value is false. If set to true, the model will return the generated content in chunks via standard Event Stream. When the Event Stream ends, a data: [DONE] message will be returned.thinkingobjectOnly supported by GLM-4.6 series and higher models. This parameter is used to control whether the model enable the chain of thought.reasoning_effortstringControls the model's reasoning effort level, takes effect when thinking is enabled. Default is max, supported by GLM-5.2 and above. For the GLM-5.3 GLM-5.3-FLASH model, only the low / high / max levels are supported. For the GLM-5.2 model, for compatibility with other protocols, passing none or minimal will cause the model to skip thinking; low and medium will be mapped to high; xhigh will be mapped to max.temperaturenumberSampling temperature, controls the randomness of the output, must be a positive number within the range: [0.0, 1.0]. The GLM-5.3, GLM-5.2, GLM-5.1, GLM-5, GLM-4.7, GLM-4.6 series default value is 1.0top_pnumberAnother method of temperature sampling, value range is: [0.01, 1.0]. The GLM-5.3, GLM-5.2, GLM-5.1, GLM-5, GLM-4.7, GLM-4.6 series default value is 0.95.max_tokensintegerThe maximum number of tokens for model output, the GLM-5.3, GLM-5.2, GLM-5.1, GLM-5, GLM-4.7, GLM-4.6 series supports 128K maximum output.tool_streambooleanWhether to enable streaming response for Function Calls. Default value is false. Only supported by the GLM-5.3, GLM-5.2, GLM-5.1, GLM-5, GLM-4.7, and GLM-4.6 series. Refer to the [Stream Tool Call](/guides/tools/stream-tool)toolsobjectA list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.tool_choicestringUsed to control how the model selects which function to call. This is only applicable when the tool type is function. The default value is auto, and only auto is supported.stopstringStop word list. Generation stops when the model encounters any specified string. Currently, only one stop word is supported, in the format ["stop_word1"].response_formatobjectSpecifies the response format of the model. Defaults to text. Only text models support this field. type converges to three values: text (plain text output), json_object (JSON output).request_idstringPassed by the user side, needs to be unique; used to distinguish each request, 6–64 characters. If not provided by the user side, the platform will generate one by default.user_idstringUnique ID for the end user, 6–128 characters. Avoid using sensitive information.Response types
idTask IDstringrequest_idRequest IDstringcreatedRequest creation time, Unix timestamp in secondsintegermodelModel namestringMore from Z.ai
- Web page readerPOST/api/paas/v4/reader$0.0109 per callFixed
- Agent taskPOST/api/v1/agentsFrom $0.763 per 1M tokens · varies by agentResponse-based · up to $1.09
- Async image generationPOST/api/paas/v4/async/images/generations$0.01635 per callFixed
- Web searchPOST/api/paas/v4/web_search$0.0109 per callFixed
- Image/video job resultGET/api/paas/v4/async-result/{id}Free
- Token countPOST/api/paas/v4/tokenizer$0.000109 per callFixed
- Video generationPOST/api/paas/v4/videos/generations$0.218 per callFixed
- Agent job resultPOST/api/v1/agents/async-resultFree
- Speech to textPOST/api/paas/v4/audio/transcriptions$0.001308 per callFixed
- Document OCR parsingPOST/api/paas/v4/layout_parsing$0.0327 per 1M tokensResponse-based · up to $0.00981
- Slides conversation exportPOST/api/v1/agents/conversationFree
- Image generationPOST/api/paas/v4/images/generations$0.01635 per callFixed
Similar endpoints
- OpenRouter · Chat CompletionPOST/chat/completionsUp to $5.00 per callResponse-based
- Baseten · Chat CompletionsPOST/v1/chat/completions$0.60 per 1M tokensResponse-based · up to $0.20
- Perplexity · Chat CompletionsPOST/chat/completions$0.01 per callFixed
- Massive Web · AI CompletionGET/ai$0.0625 per callFixed