GET /api/agent/status
Exempt from daily quota counting. Call this on session start (or before a billing-sensitive op) to fetch full subscription, quota, key, and environment in one place.
Auth
- Required scope: any authenticated key
- Header:
Authorization: Bearer cr_live_<prefix>_<secret>
Responses
200 — Context object
Body: StatusResponse
| Field | Type | Required | Notes |
|---|---|---|---|
subscription | object | yes | |
quota | object | yes | Legacy per-org daily quota bucket (retained for backwards-compat). For the query-credit model — credits remaining AND minutes until they free up — read the usage block instead. |
usage | object | no | Rolling-5h query-credit window for the key's (user, billing-account-of-target-org). remaining is credits left; nextCreditInMinutes is the wait until the FIRST credit frees (0 when under cap — a credit is available now); fullResetInMinutes is the wait until EVERY credit returns (0 for an empty window); windowResetAt is the ISO instant the window fully empties. The same nextCreditInMinutes value is mirrored on the X-CashRunway-Reset-Minutes response header. null when the key has no billable seat or the target org has no owning billing account (a status probe still succeeds; usage is simply unresolvable). |
key | object | yes | |
environment | string · one of dev prod | yes | |
billingAlert | BillingAlert | no | |
xeroAlert | XeroAlert | no |
401 — Missing / invalid bearer
Body: ErrorResponse
| Field | Type | Required | Notes |
|---|---|---|---|
error | string | yes |
Response headers
Every successful response carries X-CashRunway-Subscription, X-CashRunway-Plan, X-CashRunway-Quota-Remaining, and X-CashRunway-Quota-Reset. Trialing subscriptions also include X-CashRunway-Trial-Days-Remaining. See the overview for details.