在終端機查詢用量統計、管理限流與模型權限,以及 Token Plan 席位管理。
任意命令追加 --help 可查看完整參數說明,例如 bl usage stats --help。本文命令明細以 bl 2.2.1 為基準核實。
用量統計
bl usage free
查詢模型免費額度(省略 --model 時查詢全部模型)。
語法
bl usage free [--model <model>[,model2,...]] [flags]
| 參數 | 類型 | 必填 | 說明 |
|---|
--model <model> | string | 否 | 要查詢的模型名稱;多個名稱以逗號分隔,省略時查詢全部模型 |
--expiring <days> | string | 否 | 僅顯示將在 N 天內到期的額度 |
--sort <field> | string | 否 | 排序方式:remaining(剩餘額度升序)、expires(到期時間升序) |
--all | switch | 否 | 顯示全部模型,而不只顯示前幾行 |
範例:查詢指定模型的免費額度
bl usage free --model qwen3-max
bl usage stats
查詢模型用量統計。
語法
bl usage stats [--model <model>] [--days <days>] [flags]
| 參數 | 類型 | 必填 | 說明 |
|---|
--model <model> | string | 否 | 模型名稱,多個名稱以逗號分隔;省略時查看概覽 |
--days <days> | string | 否 | 天數(預設:7) |
--type <type> | string | 否 | 模型類型:Text、Vision、Multimodal、Audio、Embedding |
範例:查詢指定天數的模型用量統計
bl usage summary
顯示統一用量摘要:免費額度和近期用量概覽。
語法
bl usage summary [--days <days>] [flags]
| 參數 | 類型 | 必填 | 說明 |
|---|
--days <days> | string | 否 | 用量概覽的天數(預設:7) |
範例:預覽最近指定天數的用量摘要
bl usage summary --days 30
bl usage freetier
啟用或停用免費額度模型自動停止。預設啟用,使用 --off 停用。
語法
bl usage freetier <--model <model>[,model2,...] | --all> [--off] [flags]
| 參數 | 類型 | 必填 | 說明 |
|---|
--model <model> | string | 否 | 模型名稱,多個名稱以逗號分隔 |
--all | switch | 否 | 應用於全部免費額度模型 |
--on | switch | 否 | 啟用自動停止(預設行為) |
--off | switch | 否 | 停用自動停止 |
範例:預覽指定模型的免費額度自動停止設定
bl usage freetier --model qwen3-max
bl usage token-plan
檢視 Token Plan 配額使用情況。
語法
bl usage token-plan [flags]
該命令僅支援全域參數。
範例:檢視 Token Plan 配額使用情況並輸出 JSON
bl usage token-plan --output json
bl usage coding-plan
檢視 Coding Plan 配額使用情況。
語法
bl usage coding-plan [flags]
該命令僅支援全域參數。
範例:檢視 Coding Plan 配額使用情況並輸出 JSON
bl usage coding-plan --output json
限流管理
bl quota list
檢視模型限流配置(QPM/TPM,帳號級和 Workspace 級)。需要 API Key 鑑權。
語法
bl quota list [--model <model>] [--name <name>] [--page <n>] [--page-size <n>]
| 參數 | 類型 | 必填 | 說明 |
|---|
--model <model> | string | 否 | 模型名稱,多個以逗號分隔(精確匹配) |
--name <name> | string | 否 | 按模型名稱模糊搜尋 |
--page <n> | number | 否 | 頁碼(預設:1) |
--page-size <n> | number | 否 | 每頁結果數(預設:20) |
範例:檢視指定模型的限流配置
bl quota list --model qwen3-max
- 用量與限流壓力檢查位於
quota check(Console 鑑權)。
bl quota check
根據限流額度檢查當前用量。
語法
bl quota check [--model <model>] [flags]
| 參數 | 類型 | 必填 | 說明 |
|---|
--model <model> | string | 否 | 模型名稱,多個名稱以逗號分隔 |
--period <minutes> | string | 否 | 查詢最近 N 分鐘的用量(預設:2) |
範例:檢查指定模型的當前用量是否超出限流額度
bl quota check --model qwen3.6-plus
bl quota update
更新模型限流配置(QPM/TPM)。需要 API Key 鑑權。
語法
bl quota update --model <model> [--rpm <n>] [--tpm <n>]
| 參數 | 類型 | 必填 | 說明 |
|---|
--model <model> | string | 是 | 模型名稱 |
--rpm <n> | number | 否 | 每分鐘最大請求数(QPM) |
--tpm <n> | number | 否 | 每分鐘最大 Token 數(TPM) |
範例:確認執行指定模型的限流配置更新
bl quota update --model qwen-plus --rpm 60 --tpm 100000
- 未指定的欄位將保留目前值(服務端 OVERLAY 合併)。清除全部自訂限流配置請改用「quota delete」命令。
- 若目前沒有 QPM 限制,單獨設定 TPM 會被服務端拒絕——請先設定 --rpm,或同時傳入。
bl quota delete
清除模型的所有自訂限流設定(QPM/TPM)。需要 API Key 鑑權。
語法
bl quota delete --model <model>
| 參數 | 類型 | 必填 | 說明 |
|---|
--model <model> | string | 是 | 模型名稱 |
--yes | switch | 否 | 確認執行此高風險操作 |
此操作將永久清除指定模型的所有自訂 QPM/TPM 限流設定,且無法撤銷。
範例:確認執行指定模型的限流設定清除
bl quota delete --model qwen-plus
bl quota history
檢視額度變更歷史。
語法
| 參數 | 類型 | 必填 | 說明 |
|---|
--page <n> | string | 否 | 頁碼(預設:1) |
--page-size <n> | string | 否 | 每頁數量(預設:10) |
--model <model> | string | 否 | 按模型名稱篩選 |
範例:預覽第 2 頁的額度變更歷史
bl quota history --page 2
模型權限管理
bl permission grant
授予模型權限(推理 / 微調 / 部署)。需要 API Key 鑑權。
語法
bl permission grant --model <models> [--action <actions>] | --all
| 參數 | 類型 | 必填 | 說明 |
|---|
--model <models> | string | 否 | 模型 ID,多個以逗號分隔(最多 20 個) |
--action <actions> | string | 否 | 權限操作,多個以逗號分隔:inference、finetune、deploy(預設:inference) |
--all | switch | 否 | 一键授予 Workspace 中所有模型的推理權限(包括未來新增模型) |
範例:授予指定模型的權限
bl permission grant --model qwen-plus
- 授權將應用於 API Key 所屬的業務 Workspace。
- --all 對應服務端一鍵授權開關(access_all_entities: OPEN),僅涵蓋推理權限。
- 未指定的操作將保留目前授權狀態(服務端三態增量更新)。
bl permission list
列出 Workspace 中的模型權限(推理 / 微調 / 部署)。需要 API Key 鑑權。
語法
bl permission list [--scope <scope>] [--model <model>] [--name <name>] [--page <n>] [--page-size <n>]
| 參數 | 類型 | 必填 | 說明 |
|---|
--scope <scope> | string | 否 | 授權範圍:authorizable(預設,完整目錄)、authorized(已授權) |
--model <model> | string | 否 | 模型 ID(精確匹配) |
--name <name> | string | 否 | 按模型名稱或 ID 模糊搜尋 |
--page <n> | number | 否 | 頁碼(預設:1) |
--page-size <n> | number | 否 | 每頁結果數(預設:20) |
範例:列出指定模型的權限資訊
bl permission list --model qwen-plus
- 預設範圍為
authorizable(完整可授權目錄);使用 --scope authorized 僅查看已授權模型。
- 預設輸出 JSON;傳入
--output text 可檢視表格。權限值為三態:true / false / null(從未設定)。
- 這些值原樣反映 API Key 所綁定 Workspace 的服務端授權記錄。顯示 false/null 的模型仍可能可以呼叫(存取權限可能來自其他管道);準確語義請參閱阿里雲百煉模型授權文件。
bl permission revoke
撤銷模型權限(推理 / 微調 / 部署)。需要 API Key 鑑權。
語法
bl permission revoke --model <models> [--action <actions>] | --all [flags]
| 參數 | 類型 | 必填 | 說明 |
|---|
--model <models> | string | 否 | 模型 ID,多個以逗號分隔(最多 20 個) |
--action <actions> | string | 否 | 權限操作,多個以逗號分隔:inference、finetune、deploy(預設:inference) |
--all | switch | 否 | 關閉一鍵授權並清除所有歷史推理授權 |
--yes | switch | 否 | 確認執行此高風險操作 |
此操作會撤銷模型權限,可能導致推理、精調或部署任務中斷;使用 --all 時會清除全部歷史推理授權。
範例:確認執行撤銷模型權限
bl permission revoke --model qwen-plus --yes
- 授權將應用於 API Key 所屬的業務 Workspace。
- 所有撤權操作均需使用 --yes;可透過 --dry-run 免確認預覽請求。
- --all 對應服務端一鍵授權開關(access_all_entities: CLOSE):它會清除所有歷史推理授權且無法撤銷,因此必須同時傳入 --yes。
- 未指定的操作將保留目前授權狀態(服務端三態增量更新)。
Token Plan
bl token-plan list-seats
列出 Token Plan 訂閱席位詳情。
語法
bl token-plan list-seats [flags]
| 參數 | 類型 | 必填 | 說明 |
|---|
--page-no <n> | number | 否 | 頁碼(預設:1) |
--page-size <n> | number | 否 | 每頁數量(預設:10) |
--caller-uac-account-id <id> | string | 否 | 調用方 UAC 賬號 ID |
--namespace-id <id> | string | 否 | 產品 Namespace ID(Token Plan 預設:namespace-1) |
--status <status> | array | 否 | 席位狀態篩選(可重複):CREATING、NORMAL、LIMIT、RELEASE、STOP、REFUNDED |
--status-list-str <json> | string | 否 | JSON 字符串格式的 StatusList,例如 '["NORMAL"]' |
--seat-id <id> | string | 否 | 按席位 ID 篩選 |
--seat-type <type> | string | 否 | 席位檔位:standard、pro 或 max |
--query-assigned <bool> | string | 否 | 按分配狀態篩選:true=已分配,false=未分配 |
範例:列出 Token Plan 席位詳情
bl token-plan list-seats --page-size 20 --status NORMAL
bl token-plan add-member
向 Token Plan 組織添加成員。
語法
bl token-plan add-member --account-name <name> --org-id <id> [flags]
| 參數 | 類型 | 必填 | 說明 |
|---|
--account-name <name> | string | 是 | 成員顯示名稱 |
--org-id <id> | string | 是 | 組織 ID |
--org-role-code <code> | string | 否 | 組織角色:ORG_ADMIN 或 ORG_MEMBER(預設:ORG_MEMBER) |
--spec-type <type> | string | 否 | 建立時分配的席位檔位:standard、pro 或 max |
--caller-uac-account-id <id> | string | 否 | 調用方 UAC 賬號 ID |
--namespace-id <id> | string | 否 | 產品 Namespace ID(Token Plan 預設:namespace-1) |
範例:向組織添加成員
bl token-plan add-member --account-name dev_user --org-id org_123
bl token-plan assign-seats
批量向成員分配 Token Plan 席位。
語法
bl token-plan assign-seats --workspace-id <id> --seat-type <type> --account-id <id> [flags]
| 參數 | 類型 | 必填 | 說明 |
|---|
--workspace-id <id> | string | 否 | Workspace ID(環境變數:BAILIAN_WORKSPACE_ID,設定項:workspace_id) |
--seat-type <type> | string | 是 | 席位檔位:standard、pro 或 max |
--account-id <id> | array | 否 | 目標成員賬號 ID(可重複) |
--caller-uac-account-id <id> | string | 否 | 調用方 UAC 賬號 ID |
--namespace-id <id> | string | 否 | 產品 Namespace ID(Token Plan 預設:namespace-1) |
--locale <locale> | string | 否 | 語言:zh-CN 或 en-US |
範例:批量分配席位給成員
bl token-plan assign-seats --workspace-id ws_456 --seat-type standard --account-id acc_123
bl token-plan create-key
為席位建立 Token Plan API Key。
語法
bl token-plan create-key --account-id <id> --workspace-id <id> [flags]
| 參數 | 類型 | 必填 | 說明 |
|---|
--account-id <id> | string | 是 | 目標成員帳號 ID |
--workspace-id <id> | string | 否 | Workspace ID(環境變數:BAILIAN_WORKSPACE_ID,設定項目:workspace_id) |
--description <text> | string | 否 | API Key 描述 |
--caller-uac-account-id <id> | string | 否 | 呼叫方 UAC 帳號 ID |
--namespace-id <id> | string | 否 | 產品 Namespace ID(Token Plan 預設:namespace-1) |
範例:為席位建立 API Key
bl token-plan create-key --account-id acc_123 --workspace-id ws_456