HYBRID-CHAINDEVELOPERS
DOCUMENTATIONv2
GET

Customer billing

Get billing account

/api/v2/billing/account
AUTHENTICATIONBearer token · billing:readAUTHORITATIVE OWNERbilling-serviceCONTRACT AUTHORITYGenerated Rust OpenAPISTATUSSource ready · production listed

PURPOSE + BUSINESS CONTEXT

Return the authenticated workspace's credit balance, allowance, current-period consumption, credit-pool expiry behavior, active subscriptions, and settlement posture.

WHEN THIS CALL IS USEFUL

Call this before presenting service availability or financial posture for a workspace so current credits, allowances, consumption, expiries, subscriptions, and settlement state are reconciled together.

OUTCOME · Discover

What changes

Read-only projection; it grants no mutation, settlement, traffic, or authority change.

WHY IT MATTERS

  • Gives people and agents a contract-backed way to discover billing account.
  • Lets clients distinguish commercial catalog terms, available credits, metered events, pending reconciliation, subscription state, and financial settlement before presenting spend or availability.

ISOLATION + AUTHORITY

Workspace, product, price, currency, credit grant, allowance, credit pool, subscription, usage event, pending event, invoice, payment, and settlement authorities remain distinct. A displayed balance or product does not reserve credits, purchase service, move money, settle an invoice, or authorize another domain action.

BEFORE YOU CALL

  • Authenticate at the documented boundary: bearer+scope.
  • Use the live OpenAPI schema as the authority for the exact request shape and response model.
  • Resolve the authenticated workspace, active billing period, product or subscription context, currency precision, credit-pool order, and pending reconciliation posture.

WHAT TO DO NEXT

  • Correlate credit pools, allowances, consumption, expiries, active subscriptions, and settlement posture for the same workspace and period.
  • Refresh billing account and usage after a purchase, expiry, reconciliation, or subscription change before making an availability decision.

AGENT GUIDANCE

  • Use billing account only for the purpose and lifecycle stage described by this operation; do not treat it as authority for an adjacent action.
  • Use the live OpenAPI schema as the authority for the exact request shape and response model.
  • Preserve credit quantities and minor-unit prices exactly; distinguish granted, available, committed, consumed, pending, expired, reconciled, invoiced, paid, and settled states.
  • Use response links and canonical identifiers instead of constructing internal service URLs or scraping the website.
MACHINE CONTRACT

The exact deployed parameters, schemas, responses, security requirements, and Hybrid-Chain agent metadata are authoritative at this operation's production OpenAPI JSON Pointer. The readable tables below add integration guidance; the deployed OpenAPI controls if guidance and the machine contract ever differ.

Open the authoritative production contract

EXTENDED INTEGRATION GUIDANCE

Readable request and response reference

Examples illustrate integration intent; the referenced OpenAPI operation and component schemas define the executable shape.

PARAMETERS

Headers, path, query, and body

NAMELOCATIONPRESENCETYPE / RULES / PURPOSE
AuthorizationheaderRequired

Bearer tokenCredential containing the billing:read scope.EXAMPLEBearer hc_live_…

RESPONSES

Status and payload examples

200Owner-scoped billing account, credit pools, subscription posture, and settlement capabilities.Read completed · JSON RESPONSE+
{
  "account_id": "7f15968f8eb94d59af7163bb2de6ef47",
  "status": "ACTIVE",
  "available_credits": "10875",
  "included_credits": "1000",
  "rated_usage_credits": "125",
  "usage_events": 25,
  "pending_usage_events": 0,
  "period": {
    "started_at": "2026-08-01T00:00:00Z",
    "ends_at": "2026-09-01T00:00:00Z"
  },
  "credit_pools": {
    "allowance": {
      "granted_credits": "1000",
      "remaining_credits": "875",
      "first_expires_at": "2026-09-01T00:00:00Z",
      "last_expires_at": "2026-09-01T00:00:00Z",
      "expires": true
    },
    "topups": {
      "granted_credits": "10000",
      "remaining_credits": "10000",
      "first_expires_at": null,
      "last_expires_at": null,
      "expires": false
    },
    "subscriptions": {
      "granted_credits": "0",
      "remaining_credits": "0",
      "first_expires_at": null,
      "last_expires_at": null,
      "expires": false
    },
    "adjustments": {
      "granted_credits": "0",
      "remaining_credits": "0",
      "first_expires_at": null,
      "last_expires_at": null,
      "expires": false
    }
  },
  "subscriptions": [],
  "settlement_methods": [
    "STRIPE",
    "HYBRID_BALANCE",
    "EXTERNAL_CRYPTO"
  ],
  "settlement_state": "FOUNDATION_READY"
}
INTEGRATION DECISION
CALLER ACTION
Accept the returned representation or receipt, then correlate credit pools, allowances, consumption, expiries, active subscriptions, and settlement posture for the same workspace and period.
RETRY SAFETY
Repeat only when the integration needs a fresher authoritative projection.
STATE RECONCILIATION
Use returned identifiers and versions as the comparison point for later reads. Refresh the billing account, subscription and entitlement versions, usage period, and invoice or provider reference before another billing-dependent action.
401The bearer credential is missing, expired, or invalid.Authentication required · JSON RESPONSE+
{
  "code": "invalid_credentials",
  "message": "The bearer credential is missing, expired, or invalid."
}
INTEGRATION DECISIONinvalid_credentials
CALLER ACTION
Discard the rejected credential, complete the documented authentication or reassertion flow, and rebuild any request signature with fresh timestamps and nonces.
RETRY SAFETY
Retry only with a newly valid credential and fresh replay-protection values. Do not replay an expired signature.
STATE RECONCILIATION
Authentication failed before an authoritative read was returned for workspace billing account, subscription, entitlement, invoice summary, and usage projections.
ESCALATE WHEN
Escalate when entitlement, subscription, invoice, usage, or provider evidence remains inconsistent after a fresh Core billing read.
403The credential lacks billing:read.Authority or policy denied · JSON RESPONSE+
{
  "code": "insufficient_scope",
  "message": "The credential lacks billing:read."
}
INTEGRATION DECISIONinsufficient_scope
CALLER ACTION
Verify the exact scope, tenant or workspace membership, owner boundary, step-up purpose, feature policy, and resource eligibility. Never broaden authority automatically.
RETRY SAFETY
Do not retry until the missing authority or policy condition has been deliberately resolved with least privilege.
STATE RECONCILIATION
Confirm the caller and resource resolve to the same authority boundary for workspace billing account, subscription, entitlement, invoice summary, and usage projections.
ESCALATE WHEN
Escalate when entitlement, subscription, invoice, usage, or provider evidence remains inconsistent after a fresh Core billing read.
503The authoritative Core billing projection is unavailable.Dependency unavailable or outcome uncertain · JSON RESPONSE+
{
  "code": "billing_unavailable",
  "message": "The authoritative Core billing projection is unavailable."
}
INTEGRATION DECISIONbilling_unavailable
CALLER ACTION
Treat the failure as transient and preserve the last known good representation without presenting it as fresh.
RETRY SAFETY
Retry with bounded exponential backoff and jitter; stop after the integration's failure budget is exhausted.
STATE RECONCILIATION
Refresh the billing account, subscription and entitlement versions, usage period, and invoice or provider reference before another billing-dependent action.
ESCALATE WHEN
Escalate when entitlement, subscription, invoice, usage, or provider evidence remains inconsistent after a fresh Core billing read.

OPERATIONAL NOTES

Security and lifecycle guarantees

  • Use this projection to decide whether the current workspace has usable credits and which settlement methods are configured. It is account state, not proof that an invoice or external settlement completed.
  • Credit quantities are decimal strings so JavaScript and agent runtimes cannot lose precision. usage_events and pending_usage_events are integer counts.
  • first_expires_at and last_expires_at are nullable RFC 3339 timestamps. subscriptions is always an array and is empty rather than null when no subscription exists.
  • The response deliberately omits workspace UUIDs, payment-processor customer identifiers, raw product metadata, webhook data, and administrative billing records. No query parameters or request body are accepted; responses are no-store.
DOCUMENTATION STATUS

This route is implemented in canonical gateway source and appears in the production OpenAPI snapshot observed 2026-09-11T06:35:11.572Z. Authentication, tenant, feature, venue, and market policy still apply.

Verify the exact production OpenAPI operation Return to the V2 directory