---
title: "Billing state: the credit balance, the automatic top-up rule, caps, dunning, portal URL"
method: GET
path: "/preview/billing"
tags: ["billing"]
---

# Billing state: the credit balance, the automatic top-up rule, caps, dunning, portal URL

`GET /preview/billing`

## Request

- Base URL: `https://autoresearch.sfcompute.com`
- URL: `https://autoresearch.sfcompute.com/preview/billing`
- Auth: HTTP bearer

Your organization's billing posture, read-only: dunning state (why provisions might be refused), month-to-date spend - INCLUDING usage in progress, so it runs ahead of get_usage's `total_usd`, which counts only what has billed (get_usage's `spend_so_far_usd` is this same figure) - spend caps, and (for admin/billing roles) payment method status, collection method, credit balance with when each part of it expires (`credit_expiries`, soonest first; `expires_at: null` never expires), `available_to_spend_usd` (the credit left once usage in progress settles - the same figure the /usage page shows; never add it to the month's spend), `amount_due_usd` (the total of open, unpaid usage invoices, with `amount_due_oldest_due_date`), `payment.card_attached` (a verified card is on file - the same meaning as `payment_method_ok`) and whether the card actually paid: `payment.last_charge_succeeded`, `last_charge_at`, `last_charge_failure_code` and `consecutive_charge_failures` (failed charges since the last one that paid; only charges on the current card count), the newest credit grants with their kind and what became of each (`credit_grants`, `state`: active, expired, used, removed or revoked), per-member spend, any prepaid-contract balance with its expiry (distinct from pooled credits - the figure to track against a prepay deal), and cash received in every shape (usage invoices, contract invoices, wires). Members see the org's dunning state plus their own numbers; org-wide money is role-gated exactly like the /usage page. Card and invoice changes are ceremonies: they live in the billing portal (the response carries the link).

## Query parameters

- `workspace` string

## Request body

- object
  - `org` string, nullable: Organization: an org uuid or an org name from list_team's memberships; omitted = your active org.

## Response `200`

The capability's JSON result.

- Result: The capability's result: the same object the MCP tool returns as structuredContent. Resources carry an `object` type discriminator and an immutable id; money is integer micro-dollars in `*_usd_micros` fields.
  - `object` string: The resource type, when the result is one resource.

## Other responses

- `400`: Malformed request: bad JSON, a parameter that does not parse, or a value outside its range. Code `invalid`.
- `401`: No bearer token, or one this API cannot verify. Code `unauthenticated`.
- `403`: Authenticated, but the token's scopes or the account's role do not reach this operation. The message names the scope word to request. Code `forbidden`.
- `404`: No such route. Code `not_found`; the body names the OpenAPI document.
- `422`: A well-formed request the platform declined: no such node, a cap reached, a state that forbids the move. The message says which, and what to do instead. Code `refused`.
- `429`: Over this door's per-customer budget. Wait `Retry-After` seconds. Code `rate_limited`.
- `500`: Our fault. Retry; if it persists, quote the request-id. Code `internal`.

---

[API](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api.md) · [All operations](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/revisions/f88dcb70ac6c?raw)
