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.

GEThttps://api.refabric.com/v1/account/balance
import 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/usage
  • POST /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

    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.