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/tokenizer",
"method": "POST",
"body": {
"model": "",
"messages": [
{
"role": "",
"content": [
{
"text": "",
"type": ""
}
]
}
]
}
}'
{
"success": true,
"data": {
"id": "202611210705151f242ed895c140ca",
"usage": { … },
"created": 1795215915,
"request_id": "202611210705151f242ed895c140ca"
}
}
A real response, recorded when Orthogonal checked this endpoint.
$0.000109per call
Every call costs the same.
You aren't charged for failed calls. A wallet payment for a failed call is refunded.
About this endpoint
Tokenizer is used to split text into tokens recognizable by the model and calculate the count. It receives user input text, processes it through the model for tokenization, and finally returns the corresponding token count. It is suitable for text length evaluation, model input estimation, dialogue context truncation, cost calculation, etc.
Body parameters
modelrequiredstringThe model code to be called.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. Note: The input must not consist of system or assistant messages only.toolsobjectList of tools the model can call. Supports up to 128 functions.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
createdintegeridThe task sequence number generated by the Zhipu AI Open Platform. Please use this number when calling the request result interface.stringrequest_idThe task number submitted by the client or generated by the platform when the request was initiated.stringMore 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
- Chat completionPOST/api/paas/v4/chat/completionsFrom $0.0327 per 1M tokens · varies by modelResponse-based · up to $2.228749
- 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
- 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