Credits live on the organization
Every billable resource, a serverless run, a VM hour, an inference replica hour, is billed against an organization. New accounts get an org created automatically at signup; credits granted to your account live on that org. If you belong to several orgs, each one has its own balance and history. The org a request bills against is resolved by:- The
org_idcarried by an API key created under/orgs/{slug}/api-keys. - The
X-Org-Slugheader on a JWT request. - Otherwise, your default org.
X-Org-Slug automatically based on the org switcher.
How charging works
Every billable action generates an entry in the org’s history with the credit cost attached. Charges are pulled against the org’s balance in real time, so you can watch your spend during long jobs and abort if needed. Two convenience views layer on top of the org ledger:- Activities, Combined timeline of debits and credit top-ups for the active org.
- History, Per-execution breakdown for runs that have been billed.
Topping up
POST /billing/checkout creates a Stripe Checkout session for the active org. The session metadata captures the org id at creation time, so the webhook routes the credits to the right org even if you switch the active org before the payment completes.
In the dashboard, the Billing page has both preset packages and a custom-amount input.
REST API
Top-level billing endpoints (active-org aware):| Method | Endpoint | Purpose |
|---|---|---|
GET | /billing/credits | Current credit balance for the active org |
GET | /billing/credits/details | Detailed breakdown (free vs purchased, total used) |
POST | /billing/checkout | Create a Stripe Checkout session for the active org |
GET | /billing/history | Per-execution billing history for the active org |
GET | /billing/activities | Combined timeline of charges and top-ups for the active org |
GET | /billing/invoices | Stripe invoices (still scoped to your user, not the org) |
| Method | Endpoint | Purpose |
|---|---|---|
GET | /orgs/{slug}/balance | Org balance and suspension status |
GET | /orgs/{slug}/transactions | Newest-first ledger with kind, source, cursor, and limit filters |
GET | /orgs/{slug}/transactions/aggregate | Group debits by vm_id, hardware_profile, execution_id, or deployment_id for a category |
group_by reference.
