Get credit balance
The workspace’s remaining credit allowance. Credits are consumed by paid actions such as content generation and technical site audits.
API calls do not consume credits. For API request volume see Usage. The two are kept separate deliberately so neither is mistaken for the other.
GET /v1/brands/{brand_id}/creditsAuthorization
| Header | Type | Required |
|---|---|---|
Authorization | Bearer asky_sk_… | required |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
brand_id | uuid | required | From List brands |
Query parameters
None.
Any parameter you pass returns 400 invalid_request naming the offending key, rather than being
ignored silently.
Request
cURL
curl --request GET \
--url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/credits' \
--header 'Authorization: Bearer <api-key>'Response
200
{
"data": {
"brand_id": "242546de-4cee-4a7d-952e-f6aa60c63ef8",
"has_data": true,
"included_credits_remaining": 1840,
"topup_credits_remaining": 500,
"total_credits_remaining": 2340,
"current_period_end": "2026-09-01T00:00:00.000Z"
},
"request_id": "req_cd5f81b03e7a49d2b6c7"
}Response fields
| Field | Type | Description |
|---|---|---|
data.brand_id | uuid | required |
data.has_data | boolean | required. false when the workspace has no billing record. Every other field is then absent |
data.included_credits_remaining | number | From the plan. Refills each billing period |
data.topup_credits_remaining | number | Purchased packs. Drained only after the included pool |
data.total_credits_remaining | number | The two above, summed |
data.current_period_end | timestamptz | null | When the included pool refills |
request_id | string | required. Also returned as the x-request-id header. Quote it when contacting support |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | A parameter is unknown or malformed. The message names it |
| 401 | invalid_token | The key is missing, malformed, or does not exist |
| 401 | token_expired | The key passed its expiry date |
| 401 | token_revoked | The key was revoked |
| 404 | not_found | The brand does not exist, or this key is not allowed to reach it. The two are deliberately indistinguishable |
| 429 | rate_limited | Over 300 requests per minute. See the Retry-After header |
Notes
Credits belong to the workspace, not the brand. The brand in the path is how the request is authorized, not how the balance is scoped — two brands in one workspace return the same numbers.
Check has_data before reading any figure. When it is false the balance fields are absent
rather than zero, because “no billing record” and “nothing left” are different states.