Prime mode
Prime mode provides higher TPS for scenarios sensitive to output speed.
Usage
Prime mode provides the following key features:
- High-speed output: TPS is increased to 1.5 to 2 times that of the standard API. This is suitable for AI coding assistants, multi-step Agent reasoning, real-time conversations, and other latency-sensitive scenarios.
- Token-based billing: The billing logic is the same as the standard API, with charges based on input and output tokens.
To enable Prime mode, set the model parameter to the model ID of Supported models. No additional parameters are required. The endpoint is in the format https://{workspace_id}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1, where {workspace_id} can be found on the Business Space Management page after you switch to the corresponding region.
Basic call example:
The model name for the prime mode of glm 5.2 is still glm-5.2-fast-preview.
curl -X POST https://{workspace_id}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.2-fast-preview",
"messages": [{"role": "user", "content": "你是谁"}],
"stream": false
}'
Supported models
The model capabilities and usage limits are the same as those of the original models.
wan3.0-video-prime bills both input and output videos by video seconds. The price is determined by the output video's resolution. Billable duration = input video duration + output video duration.
China (Beijing)
Text generation model | Pricing (per million tokens) | ||
|---|---|---|---|
Input unit price | Output unit price | Cache hit | |
glm-5.3-prime | ¥16 | ¥56 | ¥4 |
glm-5.2-fast-preview | ¥16 | ¥56 | ¥4 |
kimi-k3.1-pro-prime | ¥26 | ¥136 | ¥1.3 |
Video generation model | Pricing (CNY/second) | ||
480P | 720P | 1080P | |
wan3.0-video-prime | CNY 0.45/second | CNY 0.9/second | CNY 1.8/second |
Singapore
Text generation model | Pricing (per million tokens) | ||
|---|---|---|---|
Input unit price | Output unit price | Cache hit | |
glm-5.3-prime | ¥20.42 | ¥64.17 | ¥4.08 |
glm-5.2-fast-preview | ¥20.984 | ¥65.948 | ¥4.196 |
kimi-k3.1-pro-prime | ¥29.167 | ¥145.833 | ¥1.458 |
Video generation model | Pricing (CNY/second) | ||
480P | 720P | 1080P | |
wan3.0-video-prime | CNY 0.496/second | CNY 1.02/second | CNY 2.04/second |
Examples
The model capabilities and usage limits are the same as those of the original models.
Streaming call example:
from openai import OpenAI
import os
client = OpenAI(
api_key=os.environ.get("API_KEY"),
base_url=os.environ.get("BASE_URL"),
)
completion = client.chat.completions.create(
model="glm-5.2-fast-preview",
messages=[{"role": "user", "content": "你是谁"}],
stream=True,
)
# glm-5.2 默认返回 reasoning_content 思考字段;
# 流式输出时思考内容与回答内容分别通过 delta.reasoning_content 与 delta.content 推送。
for chunk in completion:
if not chunk.choices:
continue
delta = chunk.choices[0].delta
if hasattr(delta, "reasoning_content") and delta.reasoning_content:
print(delta.reasoning_content, end="", flush=True)
if hasattr(delta, "content") and delta.content:
print(delta.content, end="", flush=True)
Response example:
{
"id": "chatcmpl-xxx",
"object": "chat.completion",
"model": "glm-5.2-fast-preview",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"reasoning_content": "...",
"content": "..."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 14,
"completion_tokens": 137,
"total_tokens": 151,
"prompt_tokens_details": { "cached_tokens": 0 },
"completion_tokens_details": { "reasoning_tokens": 127 }
}
}
Billing
For the billing rules and pricing of Prime mode, see Model inference pricing.
Error codes
For the error codes that may occur when you call Prime mode and the corresponding solutions, see Error codes.