Skip to main content

Credits and billing

The platform meters what every team holds and charges it in credits (consumption currency, distinct from concurrent resource quotas). It is not connected to a payment system: credits are granted by administrators, plan-owned cron credit schedules, or legacy policy allowances, and spending can be capped per period.

Permissions​

Billing and quota capabilities are separated by permission rather than bundled into full team administration (team:manage):

PermissionGrants
billing:readInspect plans (and their scheduled credit grants), pending and historical requests, and every team’s billing view (GET /v1/teams?all=true, GET /v1/teams/{team_id}, GET /v1/teams/{team_id}/ledger).
billing:creditManually grant or claw back credits on any team (POST /v1/teams/{team_id}/credits).
billing:quotaDirectly set or clear a team’s baseline quota, max_owned_teams, and credit policy (PATCH /v1/teams/{team_id}), and manage temporary quota overrides (PUT/DELETE /v1/teams/{team_id}/quota-override), without gaining team:manage workspace or membership control.
billing:manageCreate, update and delete plans (including embedded recurring cron credit grant rules), assign plans permanently or temporarily to teams, and approve or reject team requests.

The built-in billing_admin and admin roles hold all four billing permissions; custom roles may grant any subset.

Prices​

billing.prices sets the price of each resource in credits per unit and hour:

PriceUnitCharged
cpu_corevCPUWhile the workspace runs: from when it is ready until it stops.
memory_gibGiB of memorySame.
gpudeviceSame, for devices of a class without a price of its own.
accelerators.<class>device of the classSame. See GPU tiers.
storage_gibGiB of volumeAlways, attached or not.
archive_gibGiB an archived volume's archive holds, compressedWhile it is archived, instead of storage_gib.
network_gibGiB a workspace sends or receivesAs its worker measures it, every minute, from the traffic of its pod. Charged at the rate of the last sample while it is fresh, so a worker that stops telling charges no more.

Compute is charged only while a workspace actually runs. A workspace waiting to be scheduled, for example for a free GPU, pulling its image or failing to start is not charged, although it holds its quota from the moment it is asked to run.

The team.meter job runs every minute. It samples what each team holds and charges it for the time since it was last metered, at most 15 minutes, so an outage of the platform is not charged. Charges of one day are summed in a single ledger entry with a breakdown per resource. Because holdings are sampled, a change is charged from the previous metering on: the error is at most one interval per change.

GPU tiers​

Devices are priced by their accelerator class, so a fleet with several kinds of GPU or NPU charges each kind at its own rate:

billing:
prices:
gpu: 1 # any class not listed below
accelerators:
t4: 0.5
a100: 8
h100: 20

The usage entries of the ledger break devices down by class, as gpu:<class>. Templates may offer several classes for users to choose from; together with per-class quotas, tiers let an installation give everyone cheap devices and keep the expensive ones for some teams.

Credit​

A team's balance is the sum of its ledger: grants, allowances, usage and expirations.

  • Grants. billing.initial_credits is granted once when a team is created. Holders of billing:credit grant more, or take credits back with a negative amount, on the team's Credits tab or with POST /v1/teams/{team_id}/credits.
  • Validity and expiration. Positive grants default to permanent and may instead specify either a relative duration (expires_in, supporting common presets such as 24h, 7d, 14d, 30d, 90d, 1y or any <N><h|d|w|m|y> duration) or an exact future RFC 3339 timestamp (expires_at). expires_in and expires_at are mutually exclusive and are not accepted on negative clawbacks. When a team has a negative balance (accrued debt), a new grant pays that debt off first before expiring balance remains. Usage debits and negative clawbacks consume active expiring grants in first-expiring, first-out (FEFO) order before deducting permanent credit. The team.expire_credits job runs every minute, zeroes any expired lots, writes an expire ledger entry for the unused amount, and applies enforcement if the team's balance drops to zero or below.
  • Policy allowances. Granted at the start of every day, week (Monday) or month, in UTC, by team.allowances. Unspent credit carries over; each allowance has a key per period, so it is never granted twice.
  • Limits cap what a team may spend in a day, week or month, whatever its balance.

Allowances and limits form the credit policy. billing.personal_policy and billing.team_policy are the defaults; a team may have its own on its Credits tab (billing:quota or team:manage):

{"credit_policy": {"allowances": [{"period": "week", "credits": 50}], "limits": [{"period": "day", "credits": 20}]}}

Plans​

A plan is a unified preset of a quota (including per-class GPU limits), spending limits (credit_policy.limits), unlimited recurring cron scheduled credit grants (credit_schedules), and (for personal or general plans) an optional limit on how many shared teams an account may own (max_owned_teams). Billing administrators (billing:manage) create and edit plans on dedicated full-page forms under Billing → Plans (/billing/plans/new and /billing/plans/:id/edit). A plan that leaves quota or spending limits unset inherits the default for the team's kind.

Plan scheduled credit grants​

Each plan may define any number of recurring cron credit grant rules directly in its credit_schedules list:

  • Automatic effective-plan targeting: every active team whose effective plan is this plan — whether permanently assigned, on an active temporary plan override, or inheriting it via default_for (personal or shared) — receives the grant. While a team holds a temporary plan override, it receives only the temporary plan's schedules (never double-granted by its baseline plan).
  • Cadence & timezone: any standard 5-field cron expression (or @hourly, @daily, @weekly, @monthly, @yearly; @every is rejected) evaluated in an IANA timezone such as UTC or Asia/Shanghai. GET /v1/billing/schedules/preview validates an expression and returns upcoming runs.
  • Per-lot expiration: each rule grants permanent credits or attaches a relative validity_spec (such as 24h, 7d, 30d, 3m, 1y) to every lot it creates.
  • Multi-replica idempotency: team.credit_schedules runs every minute, claims due rules with FOR UPDATE SKIP LOCKED, advances next_run_at past the current time (skipping missed slots after an outage rather than backfilling), and enqueues team.credit_schedule_run keyed per (schedule_id, slot). Each team grant re-verifies the team's effective plan under the team lock and writes ledger key sched:<schedule_id>:<slot_unix> with ON CONFLICT DO NOTHING, so retries or plan switches never double-grant.
  • Lifecycle: editing a plan's non-schedule fields or a rule's note/amount preserves the rule's ID, next_run_at, and run history; deleting an unused plan cascades and removes its credit schedules automatically.

Precedence and temporary plan assignment​

A team's effective plan is resolved in order: any active temporary plan override (team_plan_overrides), its permanently assigned baseline plan (teams.plan_id), or the default plan of its kind (personal or shared). One plan at most is the default of each kind. Changing a plan changes what every team inheriting from it has at once.

A team's effective quota is resolved in order: any active temporary quota override; its own permanent baseline quota (billing:quota or team:manage); that of its effective plan; and finally teams.personal_quota or teams.team_quota. Credit policies follow the same precedence (own policy, effective plan, billing.personal_policy/billing.team_policy), and max_owned_teams follows active temporary quota override, own baseline override, effective plan, default personal plan, and teams.max_owned_teams.

Billing administrators assign a plan on the team's Quota & Plan tab, or with PUT /v1/teams/{team_id}/plan:

  • Permanent assignment: omit expires_in and expires_at (pass plan_id: null to return to the kind's default). Any active temporary plan override is revoked so the new baseline plan takes effect immediately.
  • Temporary assignment: specify a non-null plan_id together with expires_in or expires_at (and optional note). The team's permanent baseline plan stays intact; the temporary plan governs quota, max_owned_teams, credit policy, and plan cron credit schedules until expires_at.
  • Reverting & expiry: DELETE /v1/teams/{team_id}/plan-override revokes an active temporary plan immediately. Expiration is enforced live, and the periodic team.expire_plan_overrides job runs every minute to mark due overrides expired and notify the team's owners (team.plan_override_expired). Existing workspaces, volumes, and owned teams are never stopped or deleted on revert.

A plan assigned to any team (permanently or via an active temporary override) cannot be deleted (plan_in_use) until those teams have another.

Requests​

Admins of a team submit requests from its Quota & Plan tab (or click Request credits on the Credits tab): another plan, a larger quota (including a higher max_owned_teams limit on a personal team), or credits, saying why. Requesters do not pick validity — only the approver sets expiration when approving. A team has one request waiting at a time.

Billing administrators decide on Billing → Requests:

  • Credit requests: leave expiration as Permanent, or pick any preset/custom duration (expires_in) or exact timestamp (expires_at).
  • Quota requests: leave expiration as Permanent to update the team's permanent baseline quota, or pick an expiration (expires_in or expires_at) to approve it as a temporary quota override that automatically reverts when it expires.
  • Plan requests: leave expiration as Permanent to change the team's permanent baseline plan, or pick an expiration (expires_in or expires_at) to grant the plan temporarily and revert automatically to the baseline plan when it expires.

Whoever asked, or an admin of the team, may withdraw a request still waiting.

Endpoint
GET /v1/plans, GET /v1/plans/{plan_id}List or inspect plans and their recurring credit schedules.
POST /v1/plans, PUT, DELETE /v1/plans/{plan_id}Create, update (including embedded credit_schedules), and delete plans (billing:manage).
GET /v1/billing/schedules/previewValidate a cron expression and timezone and preview upcoming runs (billing:read, billing:manage, or billing:credit).
PUT /v1/teams/{team_id}/plan, DELETE /v1/teams/{team_id}/plan-overrideAssign a permanent or temporary plan, or revoke an active temporary plan (billing:manage).
POST /v1/teams/{team_id}/requestsAsk, as an admin of the team.
GET /v1/requests?status=pendingWhat waits for a decision (billing:read or billing:manage).
POST /v1/requests/{request_id}/approve, .../rejectDecide (billing:manage).
POST /v1/requests/{request_id}/withdrawWithdraw.

Plans, temporary plan overrides, and requests are audited as team.plan_*, team.plan_override_*, and team.request*.

Enforcement​

With billing.enforce on, a team whose balance is zero or below, or that spent one of its limits:

  • cannot create a running workspace, start one, or grow a running one: the request fails with 402 and the code insufficient_credit;
  • has its running workspaces stopped by the next team.meter run.

Volumes are kept and still charged, so nobody loses data for lack of credit, and the balance goes on falling below zero: a later grant first pays that off. With enforcement off, usage is still metered and shown.

As a team's credit runs out, its owners are told, once each time, and its page says how it fares:

StateWhenWhat changes
LowIts credit lasts less than billing.warn_hours (24 by default) at what it spends now.Nothing yet.
ExhaustedIts balance is zero or below, or it spent one of its limits.Its compute is stopped and none starts.
FrozenIts balance has been zero or below for billing.storage_grace_days (14 by default; 0 never).No volume of it is created or grown (storage_frozen); they are kept and charged.

A team with credit again is fine at the next metering, within a minute.