Skip to main content
Use the user billing endpoints to read your team’s credit balance and buy top-ups with a saved payment method. Both endpoints require authentication with your API key. Invalid keys return 402.

Check credit balance

GET /user/credits/info returns the authenticated team’s credit balance, a per-lot breakdown, active subscription details, and whether usage is allowed. Use this endpoint to power billing widgets, usage dashboards, or pre-flight checks before running large jobs. For API details see Get credit info.

Response

Each lot in breakdown has a purchase_kind of Subscription, Top-up, Manual, Setup, or Pending.

Purchase a top-up

POST /user/purchase-topup charges a saved card on Stripe and buys credits in one step. There is no Checkout redirect or embedded payment UI. Pass the credit amount in the request body:
Supported values: 10,000, 20,000, 80,000, and 100,000. For API details see Purchase top-up.

Requirements

  • The team must have a Stripe customer with at least one saved card.
  • Only one purchase attempt is allowed every 60 seconds per team. If you hit the cooldown, the response is 429 with a Retry-After header.

Responses

200 — payment succeeded:
202 — payment is still processing. Credits are added once Stripe confirms the payment:
Credits are issued by the Stripe webhook after payment confirmation, not directly from the HTTP response. Treat 200 as payment success; poll GET /user/credits/info if you need to confirm the updated balance.

Common errors