管理
取得 Workspace 餘額
取得當前 Workspace 的餘額、儲值總額與使用支出。
GEThttps://api.tokenlab.sh/v1/management/balance
概覽
回傳與管理 token 關聯之 Workspace 的餘額、儲值總額與使用支出總額。
注意事項
-
金額欄位僅以 USD 為單位。
-
金額以 USD 回傳。請使用
balance_decimal、total_recharge_decimal與total_used_decimal進行精確計算。
請求
curl -X GET "https://api.tokenlab.sh/v1/management/balance" \
-H "Authorization: Bearer mt-your-management-token"請求 / 回應
本頁面提供 OpenAPI 架構與可複製的請求範例。請使用 Management Token 從您的終端機或客戶端發送管理請求;本頁面不支援直接發送請求。
回應
{
"object": "organization_balance",
"organization_id": "org_123",
"balance": 42.5,
"balance_decimal": "42.50",
"total_recharge": 100,
"total_recharge_decimal": "100",
"total_used": 57.5,
"total_used_decimal": "57.50"
}重要欄位
objectstring
固定為
organization_balance。organization_idstring
與當前管理 token 關聯的組織 ID。
balancenumber
當前組織餘額(USD),以 JSON 數字格式呈現,供顯示使用。
balance_decimalstring
當前組織餘額(USD)的精確數值,以十進位字串格式呈現,供對帳使用。
total_rechargenumber
組織儲值總額(USD),以 JSON 數字格式呈現,供顯示使用。
total_recharge_decimalstring
組織儲值總額(USD)的精確數值,以十進位字串格式呈現,供對帳使用。
total_usednumber
組織使用支出總額(USD),以 JSON 數字格式呈現,供顯示使用。
total_used_decimalstring
組織使用支出總額(USD)的精確數值,以十進位字串格式呈現,供對帳使用。
授權
ManagementTokenAuth AuthorizationBearer <token>
管理權杖驗證。請在 Dashboard > API > Management Tokens 建立或管理管理權杖。
位置: header
回應
application/json
application/json
application/json
application/json