Account
Get balance API
Read the workspace's USD balance, recent top-ups and current discount.
GET
https://serastudio.app/api/v1/balanceUsage notes
- The key needs the read permission.
- Funds are added in the console, not through the API. See Billing.
Response
{
"object": "balance",
"currency": "usd",
"balance_usd": 48,
"topped_up_28d_usd": 50,
"discount_pct": 5,
"top_up_url": "https://serastudio.app/developers/billing"
}balance_usdnumberAvailable balance, after current holds.
topped_up_28d_usdnumberFunds added in the last 28 days.
discount_pctnumberThe discount applied to new generations.
top_up_urlstringThe console page where funds are added.
Errors
| Status | Code | When it happens | Retry |
|---|---|---|---|
401 | api_key_missing | No Bearer key was sent in the Authorization header. | No |
401 | api_key_invalid | The key is malformed or unknown. | No |
401 | api_key_revoked | The key was deleted in the console. | No |
401 | api_key_disabled | The key is disabled in the console. | No |
401 | api_key_expired | The key is past its expiration date. | No |
403 | insufficient_scope | The key lacks the read permission. Keys created in the console have it. | No |
403 | workspace_forbidden | The account that owns the workspace is suspended or scheduled for deletion. | No |
503 | temporarily_unavailable | The request could not be completed just now. | Yes |
500 | internal_error | Something failed on our side. The request_id identifies the request. | Yes |
503 | api_unavailable | The API is turned off. | No |