Skip to main content
Run and Scale

Prime Mode

Prime Mode delivers higher TPS for latency-sensitive scenarios such as AI coding assistants, multi-step agent reasoning, and real-time conversations.

Prime Mode delivers higher TPS for latency-sensitive scenarios.

How it works

Prime Mode provides the following key features:
  • High-speed output: TPS is 1.5~2x that of the standard API; ideal for AI coding assistants, multi-step agent reasoning, real-time conversations, and other latency-sensitive use cases.
  • Per-token billing: Same billing logic as the standard API — billed separately for input and output tokens.
  • Flexible rate limiting: When your usage reaches the rate limit, requests will still be processed if the platform has available capacity, so actual usable TPS is no less than the stated rate limit.
To enable Prime Mode, set the model parameter to the model ID of a supported model. No additional parameters are needed. Basic usage example:
The Prime Mode model name for GLM 5.2 remains glm-5.2-fast-preview.
curl -X POST https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "glm-5.2-fast-preview",
  "messages": [{"role": "user", "content": "Who are you?"}],
  "stream": false
}'
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}
  }
}

Supported models

Text generation

ModelInput (per million tokens)Output (per million tokens)Cache hit (per million tokens)
glm-5.2-fast-preview$2.91$9.15$0.58

Video generation

Model480P (per second)720P (per second)1080P (per second)
wan3.0-video-prime$0.069$0.141$0.283
For the latest pricing, see Pricing.

Usage example

GLM-5.2 returns a reasoning_content field by default. In streaming mode, reasoning and response content are delivered separately via delta.reasoning_content and delta.content:
import os
from openai import OpenAI

client = OpenAI(
  api_key=os.environ.get("DASHSCOPE_API_KEY"),
  base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
)

completion = client.chat.completions.create(
  model="glm-5.2-fast-preview",
  messages=[{"role": "user", "content": "Who are you?"}],
  stream=True,
)
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)

Billing

Prime Mode uses per-token billing with the same logic as the standard API. See Pricing for details.