Letting an automated production pipeline stall on an empty balance is preventable. The TokenLab Management API balance lookup provides automated workflows with a queryable balance total using a management token rather than an inference key.
This guide covers the GET /v1/management/balance endpoint contract, authentication requirements, currency handling, and how to verify response schemas directly against official documentation.
Key Takeaways
- The Management API balance endpoint (
GET /v1/management/balance) returns current workspace balance, total top-ups, and cumulative usage spend. - Authentication requires a management token (
mt-...) created in Dashboard → API → Management Tokens, keeping operational checks separated from model inference keys (sk-...). - All monetary values are returned in USD. Exact calculations should use the returned decimal strings (
balance_decimal,total_recharge_decimal,total_used_decimal). - The endpoint pairs with key-level reporting such as
/v1/management/api-keys/{keyId}/usageand/v1/management/api-keys/{keyId}/billing.
Management Tokens vs. Model Inference API Keys
Management tokens and model inference keys fulfill distinct operational roles in TokenLab:
- Model inference API keys (
sk-...): Used to call inference endpoints such asPOST /v1/chat/completions,POST /v1/responses, native Anthropic Messages onPOST /v1/messages, and Gemini on/v1beta/models/.... These keys execute generation requests but do not expose organization-level financial data. - Management tokens (
mt-...): Restricted to/v1/management/*routes. They allow backends to inspect workspace balances, list or edit API keys, and monitor usage without granting model generation access.
Separating these credentials ensures bookkeeping scripts and finance monitors cannot trigger billable inference calls, while model workers never gain access to account administration.
The Balance Endpoint Wire Contract
Send a GET request to https://api.tokenlab.sh/v1/management/balance authenticating with your management token in the Authorization header:
curl -X GET "https://api.tokenlab.sh/v1/management/balance" \
-H "Authorization: Bearer mt-your-management-token"
Response Schema
A successful request returns 200 OK with an organization_balance object:
{
"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"
}
Response Fields
object(string): Alwaysorganization_balance.organization_id(string): Organization associated with the current management token.balance(number): Current workspace balance in USD as a floating-point number for display.balance_decimal(string): Exact current workspace balance in USD formatted as a decimal string for financial reconciliation.total_recharge(number): Total successful workspace recharge amount in USD.total_recharge_decimal(string): Exact total successful workspace recharge amount in USD formatted as a decimal string.total_used(number): Total workspace usage spend in USD.total_used_decimal(string): Exact total workspace usage spend in USD formatted as a decimal string.
Monetary fields are strictly USD. When parsing balance programmatically for threshold checks or ledger reconciliation, parse balance_decimal with an arbitrary-precision decimal library rather than floating-point primitives to prevent precision loss.
Implementing Balance Checks
Common integration patterns include:
- Pre-Batch Guardrails: Before dispatching large workloads—such as high-volume generation on models like gpt-5.5 or glm-5.2—query
/v1/management/balance. Ifbalance_decimalfalls below the estimated batch cost, pause the job queue. - Low-Balance Alerts: While automated email notifications can be configured under Console → Settings, a scheduled monitoring cron can poll the endpoint and trigger internal Slack, PagerDuty, or webhook notifications.
- Billing Reconciliation: Combine the live workspace balance with individual key usage records (
/v1/management/api-keys/{keyId}/usage) to reconcile token expenditures against settled invoice lines.
For full endpoint specifications and key management methods, review the Get Workspace Balance API Reference and the Management API Overview.
Sources
- https://docs.tokenlab.sh/api-reference/management/get-balanceSources checked 2026-09-27
- https://docs.tokenlab.sh/api-reference/management/introductionSources checked 2026-09-27



