Every turn is metered, and every org has a budget. When a cap is hit, the API returns 402 Payment Required before running anything — no surprise bills.Documentation Index
Fetch the complete documentation index at: https://docs.karta.sh/llms.txt
Use this file to discover all available pages before exploring further.
How metering works
The data plane buffers usage and flushes idempotent batches to the control plane:- Idempotent ingestion — each event carries a
client_event_idunique per org; retries become no-ops. Metering never blocks a customer response. - Atomic aggregation — the raw usage event and its per-org/kind/period roll-up commit in the same transaction, so there’s no divergence window.
- Exact-integer money — pricing is stored in micro-cents-per-token, with
distinct
MicrosandCentstypes so a unit mix-up is aTypeError, not a silent billing error. Conversions round up — the platform never under-bills.
Budgets and caps
OrganizationBudget caps consumption across input tokens, output tokens,
total tokens, and cost (cents). Caps can be set per org, with optional
per-key sub-limits. Budget enforcement gates on two things:
- Subscription status — anything but
trialing/activeblocks consumption. - Caps — any configured limit being exceeded blocks consumption.
budget_ok: false at key
validation, and the data plane returns:
Reading current usage
No-billing mode
With Stripe unconfigured, everyone stays on the free plan, the billing UI shows a friendly banner, and the app is fully usable without payments wired. Budgets still enforce; only the paid tiers are inert.API keys
Per-key sub-limits and scopes.
Webhooks
Get notified on budget thresholds and billing events.