全部產品
Search
文件中心

Alibaba Cloud Model Studio:快速模式

更新時間:Jul 15, 2026

快速模式(Fast mode)為對輸出速度敏感的情境提供更高的 TPS。當前為 preview 階段。

使用方式

快速模式具備以下關鍵特性:

  • 高速輸出:TPS 提升至標準 API 的 1.5~2 倍,達 80~100 TPS;適用於 AI 編程助手、Agent 多步推理、即時對話等對輸出速度敏感的情境。

  • 按 token 計費:計費邏輯與標準 API 一致,按輸入與輸出 token 計費,具體價格見模型調用計費

  • 特殊限流:超出 TPM 額度不會立即實行限流,請求會進入排隊隊列。

  • preview 階段:當前為預覽階段,能力與規格可能隨版本調整。

調用時將 model 參數指定為支援的模型的model ID 即可開啟,無需額外參數。接入網域名稱 格式為 https://{workspace_id}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1 ,其中 workspace_id 可在 業務空間管理 頁面切換到對應地區後查看。

基礎調用樣本:

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
}'

支援的模型

華北2(北京)

模型名稱

模型計費(每百萬Token)

輸入單價

輸出單價

快取命中

glm-5.2-fast-preview

$2.75

$9.628

$0.688

新加坡

模型名稱

模型計費(每百萬Token)

輸入單價

輸出單價

快取命中

glm-5.2-fast-preview

$3.5

$11

$0.7

使用樣本

glm-5.2 預設返回 reasoning_content 思考欄位;流式輸出時思考內容與回答內容分別通過 delta.reasoning_contentdelta.content 推送。流式調用樣本:

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,
)

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)

返回樣本:

{
  "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 }
  }
}

計費說明

關於快速模式的計費規則與價格表,請參見 模型調用計費

錯誤碼

關於快速模式調用過程中可能出現的錯誤碼及對應的解決方案,請參見 錯誤碼