For AI agents: this page is also available as Markdown at https://docs.refabric.com/api-reference/platform/account/read-your-balance.md, and the index of every page is https://docs.refabric.com/llms.txt.
Platform API › Account
Read your balance
The credits you can spend now and when they run out, per credit type, read live — the whole account, not one key.
https://api.refabric.com/v1/account/balanceimport os
import requests
url = "https://api.refabric.com/v1/account/balance"
headers = {"Authorization": f"Key {os.environ['REFABRIC_API_KEY']}"}
response = requests.get(url, headers=headers)
print(response.json()){
"balances": [
{
"credit_type": "refabric_credits",
"expiring": [
{
"at": "2026-10-31T23:59:59Z",
"credits": 400
}
],
"remaining": 1200
},
{
"credit_type": "model_credits",
"expiring": [],
"remaining": 0
}
],
"as_of": "2026-10-05T12:00:00Z"
}Authentication. A key with account:read: the balance is your account's.
Common use cases
- Check your balance before you start a batch.
See also
GET /v1/account/usagePOST /v1/tasks/{name}/estimate
Authorization
Authorization: Key $REFABRIC_API_KEYScope: account:read
Parameters
Header parameters
- stringoptional
The contract version you wrote against (a date). Absent: the current version.
format: date
- stringoptional
Your own id for this request; we answer it back under X-Client-Request-ID.
max length 128
Response
200 — Done: the answer is in the body.
- array<object>required
One entry per credit type.
Example:
[{"credit_type":"refabric_credits","expiring":[{"at":"2026-10-31T23:59:59Z","credits":400}],"remaining":1200},{"credit_type":"model_credits","expiring":[],"remaining":0}]- stringrequired
Which kind of credit an amount is counted in.
Values
refabric_credits— Spent by tasks.model_credits— Credits for model training.
Example:
refabric_credits - integerrequired
What you can spend now: a job asking for more than this is refused.
Example:
1200 - array<object>required
When your credits run out, one entry per batch, in the order they are spent. The entries need not add up to
remaining.Example:
[{"at":"2026-10-31T23:59:59Z","credits":400}]- integerrequired
The credits left in this batch.
Example:
400 - stringrequirednullable
When they run out (UTC). A plan's credits are used within their billing period; a pack's run to its own date.
Example:
2026-10-31T23:59:59Z
- stringrequired
The moment these figures were read (UTC, ISO-8601).
Example:
2026-10-05T12:00:00Z
- 401 — No valid API key was sent.
- 403 — Your key or your plan does not allow this.
- 429 — Too many requests: wait for the number of seconds in the Retry-After header.
- 500 — Something went wrong on our side; retry, and quote the request id if it keeps happening.