*_micro_usd, where 1 USD = 1,000,000 micro-USD).
Balance
GET /v1/credits/balance returns the current balance. Over MCP, credits_get_balance and organizations_get answer balance_credits in place of balance_micro_usd.
Ledger
GET /v1/credits/ledger lists metered entries, newest first. Cursor-paginated — see Pagination. Each inference debit carries a 5-tier token line-item breakdown of what was metered.
Filter the ledger with any combination of ?type=, ?session_id=, ?agent_id=, ?deployment_id=, ?from=, and ?to= (each from/to bound is a date like 2026-08-01 or a timestamp like 2026-08-01T00:00:00Z, an offset’s + sent as %2B; anything else is 400 validation_failed naming the parameter).
Response
Spend
GET /v1/credits/spend → 200 OK. What the matching debits spent, in positive micro-USD, summed over the whole range: the total, the split by tier, and the 50 dearest agents and sessions, dearest first. It takes the ledger’s ?session_id=, ?agent_id=, ?deployment_id=, ?from= and ?to=. Use it for any total or chart: a sum over one ledger page misses every debit past it.
?days= (1 to 90) adds by_day: the company’s spend per day for that many days, ending today, on ?timezone= (default the organization’s). It is the whole company’s spend, so it takes no other filter. With ?days=, spent_micro_usd is those days’ total and by_tier, by_agent and by_session are empty: read the splits with ?from= instead.
Response
Top up
POST /v1/credits/topups opens a hosted charge and returns a topup object describing it. It does not move the balance: credit is applied when the payment provider’s signed callback arrives and is verified, so poll the balance rather than reading the create response as settlement. Requires the billing:write scope.
A company being set up cannot top up: it runs on its one-time free credits (5,000 credits), and its next step is the plan. The call is refused with subscription_required (402) until the company is activated.
Optional app-relative path to preserve through the hosted checkout. Absolute and protocol-relative URLs are refused.
The topup object
Opaque top-up id. Store it as a string and do not parse it or rely on its format. When the charge settles, the
credits.topped_up audit row names it as resource_id.Lifecycle state. One of:
pending— the charge is being processed.requires_action— the payment needs additional authentication (e.g. 3-D Secure). Complete it viaaction_url, then poll.succeeded— the charge cleared and the balance was credited.failed— the charge was declined; the balance is unchanged.
Always
null on this response — the balance moves only when the provider callback settles the charge. Read the balance instead.Response
Confirming a charge that is not yet terminal
A charge can land inpending or requires_action, so the status on the create response is not always the final word.
Two ways to reach the terminal state:
- Poll the balance.
GET /v1/credits/balancereflects the credit as soon as the charge clears. This is the simplest check when you know the amount you expect. - Read the ledger.
GET /v1/credits/ledgerlists entries newest-first; the settled top-up appears as acreditentry. Match it bycreated_atandamount_micro_usd.
status comes back requires_action, send the payer to action_url first; the balance does not move until they complete authentication.
When the balance is too low to cover a call, the API returns
insufficient_credits (402); when a call would breach a configured per-agent or per-session cap it returns budget_exceeded (402). Top up (or raise the cap), then retry — see Errors and Agents. Successful top-ups are recorded in the audit log as credits.topped_up.The plan
Credits pay for what an agent does. The plan is separate: it is the right to use the organization at all. Every organization needs an active plan before any route outside billing will answer. Without one the API returnssubscription_required (402) with the message telling you exactly what to do.
Included credit is added to the prepaid balance and rolls over: it never expires. Creating an organization does not start a plan. Buy one, then the organization works.
Reading the plan
GET /v1/credits/subscription returns the current plan. Requires the billing:read scope, and is answerable whether or not a plan is active.
true adds payment_method, the card the plan bills. It is read from the payment provider at call time, so it is left out of the default read. It also needs the billing:write scope, and is refused (403 forbidden) without it and for any call an agent makes.One of:
none— no plan has ever started. Every gated route is refused.active— the organization can be used.past_due— the last payment did not go through. The organization keeps working untilgrace_until, then is refused.canceled— the plan ended. Every gated route is refused.
active too: there is no trialing status. trial_end says the trial is running. To know whether the organization can be used, read active and state below, not status.Whether the organization can be used right now: exactly what the API admits.
true during a free trial, a paid period, a cancelled plan’s last period, and a failed payment’s grace. false otherwise.The company’s state, worked out by the same rule as
active. One of:setting_up— not yet paid for. It runs on its free credits, every text model onvetta/auto.held— set up, with its crew chosen and waiting for the plan. Only the CEO runs.trialing— inside a free trial.canceling— usable untilcurrent_period_end, then it stops.active— paid and usable.grace— the last payment failed. Usable untilgrace_until.stale—statusreadsactive, but no renewal has been heard for more than three days pastcurrent_period_end. Refused, likelocked.locked— no plan, cancelled, or a failed payment past its grace. Refused.
active is true for trialing, canceling, active and grace. Treat state as a string: a state may be added later.While
past_due, the moment the organization stops working. null means no grace remains.true once a cancellation has been asked for. The organization stays usable until current_period_end and is refused after it.While the free trial is running, the moment it converts to a paid Standard month.
null otherwise.Whether
POST with {"plan": "standard"} from this caller would start the free trial. One trial per organization and one per person: an organization that already had a plan is not offered one, and neither is an organization whose caller, owners or creator — under any +tag or Gmail-dot spelling of their address — asked for a trial at another organization that started one (or one opened there in the last 24 hours), or belongs to or created an organization that used one. Leaving an organization does not reset it.A paid listing the company set up and has not paid for, as
{ name, price_micro_usd }. The next checkout charges it once, beside the first month, with no free trial. null when there is none.The plans this deployment sells:
["standard", "pro"], or ["standard"] where Pro is not offered. POST or PATCH with a plan not listed answers 501 feature_not_configured.Only with
include_payment_method=true. The card the plan bills, as {"last4": "4242"}, so a screen can name it before an upgrade charges it. null when the organization has no plan with a card, or the card could not be read.Each plan in
plans_available, in the same order, as { plan, price_micro_usd, included_credit_micro_usd }: its monthly list price and the credit each paid month adds. Present whether or not a plan is held, so the price can be shown before checkout.An
active plan whose current_period_end is more than three days in the past stops being honoured. Renewals reach us as signed callbacks, and a callback that never arrives must not become permanent free access. Any later callback moves the deadline forward again, so a plan that is genuinely paid heals itself the moment the next event lands.Response
Starting or renewing the plan
POST /v1/credits/subscription opens a hosted checkout page and returns its URL as action_url (201). The body is optional: {"plan": "standard"} (the default — an empty body is Standard) or {"plan": "pro"}. Requires the billing:write scope.
The free trial. When the plan is standard and trial_eligible is true, the checkout starts a 7-day free trial: a card is required on the page, 50,000 credits ($10) are granted when the trial starts (on an eligible card: see [Pricing](/platform/pricing)), and unless it is cancelled first the trial converts to $20 per month — with the full 100,000 credits — when it ends. Cancel during the trial (DELETE below, or the account page) and nothing is charged. A caller who is not eligible gets the same checkout without the trial, billed on the day. Pro has no trial.
Like a top-up, it changes nothing on its own: the organization becomes usable once the payment (or the trial) is confirmed, which is normally a second or two after the customer completes the page. Re-read GET /v1/credits/subscription until status is active.
An organization whose plan is already active is refused with state_conflict (409): a second checkout would be a second plan billed. Change the tier with PATCH below instead. A company being set up starts here: the payment that makes its plan active activates it (setting_up turns false), its free model lock lifts, and a paid listing it held is built (installs). When that crew is a paid listing, the same checkout charges its price once, beside the first month, with no free trial: one payment, both lines on the receipt (see listing above). A listing Naive has not checked answers state_conflict.
Response
Changing the plan
PATCH /v1/credits/subscription with {"plan": "pro"} or {"plan": "standard"} changes an active plan in place. Requires the billing:write scope; audited as subscription.plan_changed.
- Standard → Pro is immediate. The difference for the rest of the current month is charged at once on the card already on file, the billing date stays the same, and the answer reads
plan: "pro". Upgrading during the free trial ends the trial and charges $200 now. The proration invoice grants what it collected as credit, up to 1,000,000 credits. - Pro → Standard takes effect at the end of the period already paid for. Nothing is refunded and the Pro credit already granted is kept. Until then the plan reads
plan: "pro"withpending_plan: "standard"; asking forproagain before then takes the downgrade back, free. - Asking for the plan already held, with nothing pending, changes nothing and answers
200. - An organization with no
activeplan is refused withstate_conflict(409) namingPOST. - A plan set to cancel at the end of its period is refused with
state_conflict(409): there is no plan to change.
Response
Cancelling the plan
DELETE /v1/credits/subscription stops the plan at the end of the period already paid for — never immediately, and nothing is refunded or charged again. Requires the billing:write scope, and like the two routes above it answers whether or not the organization is currently usable: a recurring charge you can only stop by paying first is not one a customer can stop.
The organization keeps working until current_period_end, and is refused after it. Re-read GET /v1/credits/subscription to see cancel_at_period_end become true — the state follows the payment provider’s confirmation, so the read is the truth, not this response.
Response
trial_end with nothing charged. To restart after cancelling, POST /v1/credits/subscription again — without a second free trial.
Managing the payment method, invoices and cancellation
POST /v1/credits/billing_portal returns a link to the payment provider’s own hosted account page, where a customer can change the card on file, download past invoices, and cancel. It takes no body and requires the billing:write scope. The link is single-use and expires — follow it, do not store it.
Like every other route on this page it changes nothing by itself. Whatever the customer does on that page arrives back as the same confirmed events that already move the plan, so re-read GET /v1/credits/subscription afterwards rather than assuming an outcome.
Response
404 not_found rather than an empty page:
404
What stays open without a plan
An organization with no plan can still identify itself, read its own billing state, and pay. Everything else is refused withsubscription_required (402).
A company being set up (organizations) has no plan yet but is not locked: it chats, hires, drafts and renders pictures and songs on its one-time free credits, metered like a paid company. These rules hold until it is activated:
- Every text model is
vetta/auto. An agent saved with another is saved onvetta/auto. A run, a proxy call or a model pick on another issubscription_required(402). - A call is paid for before it starts. One its credits cannot hold is
subscription_required(402), notinsufficient_credits, and nothing is spent. - One paid call runs at a time. A second, while the first is open, is
rate_limited(429): “One thing at a time — this finishes in about a minute.” - What the plan pays for is
subscription_required(402), titled by the action: a video, a 3D model, a video edit, clips, a character’s training, a live voice call, a phone number, an identity check, a wallet, a phone device and a second email domain. - At most 50 emails go out in any 24 hours, whether a person or an agent sends them.
A session already running is never cut off mid-turn. The plan is checked when work is admitted — starting a session, sending it a message, or a schedule firing — not on every turn of a session already under way. A lapse stops new work; it does not kill a task in flight. Plan changes are recorded in the audit log as
subscription.updated, and a customer’s own cancellation as subscription.canceled.