Skip to content

Budget and quota enforcement

Tenant-level spend is governed by the tenant wallet (a single running USD balance); beside it, the gateway tracks cumulative spend per token and per gateway and blocks requests once a configured cap is exhausted. Together these provide hard cost caps on individual clients, gateways, and the tenant as a whole.

Budget hierarchy

A request must pass every applicable check before reaching the provider:

  1. Tenant wallet — the tenant may make a request only while its wallet holds spendable balance and is not frozen. The wallet is the tenant-level spend authority; there is no separate per-tenant budget field. Operators top it up with a funding grant; the tenant can set its own spend cap on top.
  2. Per-token budget — tracks spend for one specific auth token (auth_token.budget_usd). If the token budget is exhausted, the request is blocked regardless of the other levels.
  3. Per-gateway budget — tracks aggregate spend across all tokens on one gateway (the gateway's config budget_usd). Acts as a hard cap for that gateway as a whole.

All of these are independent and the most restrictive wins.

A fourth, optional level caps one member: the per-user budget. It sits under the workspace budget and never replaces it.

null and 0 are opposites. Leaving a budget field empty (null) disables enforcement at that level — spend is unlimited. Setting it to 0 is a real cap of zero, so every request at that level is refused immediately, starting with the first one. Zero is accepted on purpose: it is how you freeze a gateway or a workspace without deleting it.

Because 0 is a deliberate state rather than an error, it is reported as one everywhere it has an effect, not only where it is typed:

  • the budget field warns as you type it, saying that 0 blocks every request and that an empty field is what means unlimited;
  • the gateway and workspace lists, and the gateway page, show a Frozen marker instead of $0.00, so an operator who did not set it can still see why nothing works;
  • the refusal itself says the budget is 0 and that resetting the spend will not lift it — see A frozen budget below.

Where you set each budget in the admin UI

Each budget field is labelled by its scope so it is clear which spend it caps:

  • Tenant spend cap (spend_cap_usd) — on the organisation edit form (Tenants → select a tenant → Edit). A tenant admin's own optional monthly USD self-limit, on top of the wallet. See Tenant spend cap.
  • Gateway Budget (USD) — on the gateway create/edit form (Gateways → select a gateway → Edit). Applies to that one gateway only.
  • Spend cap — on an individual auth token (a gateway's Auth Tokens → Create/Edit). Caps spend for that single token.

Topping up the tenant wallet (operator funding), the platform ceiling, and freezing are described in Funding a tenant.

💡 Note: The tenant fields budget_usd, budget_period, budget_amount, budget_currency and budget_four_eyes_required are retired. A POST or PATCH /admin/v1/tenants request that sends one of them with a value is rejected with 400 field_retired; null or an empty string is ignored. Use the wallet, spend_cap_usd, or a gateway budget instead.

Tenant spend cap

spend_cap_usd is an optional, tenant-admin-settable monthly USD ceiling on the whole organisation's spend, applied on top of the wallet. It is independent of the wallet balance (the wallet gate stops a frozen or empty wallet first) and resets on the monthly window — there is no configurable tenant period. Clearing it (null) means no cap (spend is bounded only by the wallet). Setting it to 0 is a deliberate freeze-all, exactly like a 0 gateway budget.

Funding a tenant: grants, ceiling, and freeze

Tenant spend draws on the wallet, so funding a tenant means adding to its wallet, not setting a budget number:

  • Add funds (grant). An operator funds an Enterprise tenant's wallet with a one-shot, additive grant (grant_usd, USD) — PATCH /admin/v1/tenants/{id}. It credits the wallet exactly once (idempotent on the grant_nonce the client sends and reuses on retry, so a retried request never double-credits; two deliberate grants each credit). No payment is taken. A grant on a non-Enterprise tenant is skipped (it funds through Stripe instead). Only a platform administrator can send a grant; a tenant admin receives 403. A grant is not held for four-eyes approval.
  • Platform ceiling (platform_cap_usd). A platform-admin-set ceiling that bounds a single grant: a grant larger than the ceiling is rejected. It no longer caps cumulative spend — an operator can grant again — so it relies on the platform-admin restriction and the audit trail for governance.
  • Freeze (frozen). A platform admin can freeze or unfreeze a tenant's wallet directly. A freeze is an explicit operator brake: it takes effect immediately and survives a plan tier switch, a trial→paid conversion, and payment; it is cleared only by an explicit operator unfreeze, never automatically. A tenant admin cannot freeze or unfreeze their own tenant.

Low-balance notice for Enterprise wallets

An Enterprise wallet is refilled by an operator, not by the customer's card, so the platform tells Myra's operators before it runs dry. The notice goes to the operator channels only (the [platform_alert] log line, the operator alert email address, the ops alert webhook and Mattermost, when configured); the customer receives nothing.

  • When: once when the wallet's spendable balance falls below 20 % of the balance it had right after its most recent funding grant (signal wallet_low_balance), and once more when it is empty — less than $1 spendable (signal wallet_empty). Requests already start failing before $0: each model call first reserves its minimum cost from the wallet and is refused when the wallet cannot cover it — usually a few cents, more for very large prompts or calls whose output cannot be capped — so a wallet can sit at a few cents with every request refused. $1 is the line the platform reports; a tenant sending very large requests can be refused while slightly more than $1 is left. The 20 % notice only exists when the balance after the grant was above $5 (below that, its line is under $1 and the empty notice comes first). Every funding grant counts, including the $9 opening credit a new tenant receives; a tenant with no funding grant on record at all gets only the empty notice.
  • What sets the line: only a funding grant. A redeemed voucher never moves the line; any credit that lifts the balance back above the line (a grant or a voucher) re-arms the notice, so the next fall is reported again. While the wallet is empty the earlier 20 % notice of the same grant stays remembered, so a small credit that lifts it just out of "empty" is not reported as a new fall below 20 %. Each funding grant starts a new line; if the wallet is still empty after it, or falls below the new line before the next check, it is reported again.
  • Not reported: a frozen wallet (a deliberate operator freeze) and a wallet under a payment dispute — both are refused regardless of their balance, and adding funds would not help. Once the freeze is lifted or the dispute settled, a wallet that is still low or empty is reported again. Tenants on other plans fund themselves and are never reported.
  • Timing: the platform checks every Enterprise wallet every 5 minutes; a notice is sent within about 1–2 minutes after it is detected, once for the whole deployment. A wallet that stays low or empty without a new grant is reported again about every 40 days.
  • Off unless switched on: the platform setting wallet_low_alert_enabled turns the notice on; it defaults to off. Switching it off stops new notices within one check (about 5 minutes). Notices already sent are remembered while it is off, so a wallet that recovers and runs low again during that time is reported only after the setting is back on and the old notice has cleared (or after the 40-day reminder). Switch it on only once every gateway node runs a release that includes this notice.

Self-serve plans — and Standard — fund through Stripe, not an operator grant: a self-serve tier's allowance is set by the platform from the plan's USD price, and the workspace tops up its own wallet through Checkout.

Wallet (prepaid credit)

A self-serve workspace (free trial or the paid Custom plan) — and a workspace on the manual Standard plan — can hold prepaid credit in a wallet, bought as a one-off top-up through Stripe Checkout or charged automatically to a saved card when the balance runs low. (The free trial sees its balance but cannot top up; on Standard only the workspace owner tops up.) There is one wallet per workspace; every gateway of the workspace draws on it — the trial's two pre-configured gateways included.

Starting credit and one display currency. Every new workspace is credited a one-off $9 starting credit (non-refundable, included with every new workspace); it appears in the wallet Activity list as a Starting credit row, so the activity credits add up to the balance. The Wallet page shows the Activity list to the free-trial owner too (a trial member sees the balance only). A card top-up shows the amount that was charged, in the currency it was charged in; every other credit row is the difference between the rounded running balance before and after it, so the rows add up to the balance card to the cent (a short note under the list says that usage is not listed there and that only the 20 most recent entries are shown; outside USD a second note says card payments are shown at the amount charged and other rows are converted at today's rate, so the rows can differ from the balance after a rate change, or by a cent of rounding on refunds). Every balance figure in the admin UI (Your plan, the Wallet page, the Activity amounts) is shown in the same currency: your display currency preference converted at the live rate, or - for a workspace whose wallet was pinned to euro at a fixed rate - that euro rate. On the free trial, the money area shows the workspace wallet balance plus any active admin spend limit that binds (the lowest of the tenant spend cap, a gateway cap, a department/team cap or a per-user cap); there is no separate per-user trial-credit figure.

Voucher codes. A voucher code can only be entered during sign-up: on the paid plan's confirmation step, or on the trial's email step when you came through a campaign link. An existing workspace has no field to enter a code.

The wallet is the workspace's spend bound. Every turn's cost is debited from the wallet after the turn (the spend ledger still meters everything, so usage views stay complete), with the plan's full model entitlement — there is no reduced-model/efficient-model window. A turn is admitted only while the wallet holds spendable balance and is not frozen; when the wallet reaches zero, requests are refused with 429 quota_exceeded — a hard stop, no model swap — until it is topped up. When the balance cannot be read (a database fault), the request is refused too — never admitted on an unknown balance — but with the retryable 503 spend_unverified (nothing is used up; sending again may work). On a free trial, spend is bounded by the one workspace wallet (there is no separate per-seat credit); any admin spend limit applies on top of it, and the trial UI names whichever is lowest. An operator freeze stays in force with a funded wallet (the wallet gate stops a frozen tenant first, regardless of balance), and a spend cap of 0 likewise freezes spending even with a funded wallet.

Each model call reserves its share first (per-call holds). Every model call of a self-serve request — the answer, each tool-use round, a continuation, automatic compaction, the inner call of an agentic web fetch, a delegated sub-agent's calls — first reserves what it can cost at most from the wallet's free balance (the balance minus what running requests have already reserved), before it is sent. Reservations are first come, first served, so concurrent requests can never together spend more than the balance:

  • The balance covers the call → it is sent unchanged.
  • The free balance covers only part of it → the call is sent with its answer length capped to the longest answer the reservation fully pays for. The answer ends early (an API client sees finish_reason: "length"; the chat shows an "Answer shortened" notice naming the remedy for the viewer: the owner of a paid workspace and a member whose role grants Buy plans and add budget top up the wallet, everyone on a free trial upgrades to a paid plan, other members of a paid workspace ask the workspace owner — or, when other running requests held the balance, "try again in a moment"; see Chat). A shortened answer is never automatically continued, and the request makes no further paid call after it. When a delegated sub-agent's answer is shortened, the calling agent is told its result is incomplete and answers with what it has (its own calls reserve as usual), and the reply shows the Answer shortened notice.
  • The free balance cannot pay even a minimal useful answer (about 500 output tokens, or a reasoning model's visible-answer reserve) → the call is refused before it is sent, nothing is charged:
    • 402 wallet_insufficient on the paid plan (top up to continue); a free trial gets 402 trial_budget_exhausted; with the platform wallet switched off, the ordinary over-cap answer (429 quota_exceeded);
    • 429 wallet_funds_reserved when the balance itself would pay but other running requests have reserved it — retryable, retry in a moment.
    • In the web app every place that runs a model shows these refusals in your language with the remedy for your role and plan — the chat, an agent's Try it and Preview, and the workflow Copilot and Test step: the owner of a paid workspace and a member with Buy plans and add budget get Add budget, a free trial the upgrade, other members of a paid workspace who to ask (nothing to do for the retryable reserved case but try again shortly). On an agent's Try it and Preview and the workflow Test step, an answer cut short at its length limit is marked as such (it may be incomplete), and a run whose later model call is refused (after a tool, for example) keeps what was already answered, with the reason and the same remedy beneath it. The workflow Copilot cannot use a partial result: a refused run is shown as a failure with the reason and the remedy, a proposal cut short at its length limit is reported as cut short, and a cut-short explanation is marked as such.
  • Compaction and the agentic-fetch inner call are all or nothing — they are never shortened: either their full cost is reserved or they are refused, and a refused one refuses the rest of the request with the same answer (the conversation is never quietly summarised away to make room).
  • The reservation cannot be confirmed as a valid amount (a storage fault, not something you can cause) → the call is not sent and the request is refused the same way as an empty balance; it is never sent uncapped.

After the call, its actual cost is charged against its own reservation exactly once (a charge that fails on a transient database fault is held and repeated until it is written, still once) and the rest of the reservation is released; a call that fails, or never produces a billable answer, releases its reservation without charge. A reservation that is never settled (a server lost mid-call) lapses on its own after its lease (one to 24 hours, by the call's size).

What is not reserved. A call made with the workspace's own provider key reserves nothing and is not charged to the wallet: the provider bills the workspace directly, and Myra adds no platform markup on top. Our own work on the same request is still charged as usual, for example an answer step that runs on a Myra-hosted model. Budget limits do not count it either: the gateway, workspace, department (team), user and token budgets add nothing for it, because cost control on your own key is between you and the provider. A budget that is already used up by other spend (for example Myra-hosted models) still refuses new requests, own-key requests included. The per-agent monthly spend cap is the one exception: it still counts the provider's price of the agent's calls. The wallet must still hold money for the request to be admitted: an empty or frozen wallet refuses requests on the workspace's own key too. Requests to the endpoints that generate no answer (embeddings, the model list, token counting) reserve nothing; their cost, if any, is taken from the free balance after the request. Legacy text completions are answer calls like chat and reserve the same way. A call on a native provider endpoint whose answer length the gateway does not set (for example the OpenAI Responses API) is never shortened: its full maximum is reserved, or it is refused.

Bounded remainder, stated plainly. The reservation is sized from the request as sent (its input estimated, its output capped), so a call can occasionally cost a little more than it reserved (for example when the provider counts more input than the estimate). That remainder, and the cost of the endpoints above that reserve nothing, are taken from the free balance after the turn — never from another request's reservation. If the free balance cannot cover it, the uncovered part is logged as a shortfall and never charged to anyone; the balance never goes negative. A refund or charge-back debits the balance directly and ignores running reservations (a running call may then settle against a smaller balance; it is never overdrawn).

Currency. The balance is held in USD and shown in the workspace's currency. A EUR top-up is converted once, at the workspace's pinned reference rate when it has one, else the platform's current reference rate, and the rate used is recorded on the movement — the credited figure never drifts afterwards.

Top-up amounts. The owner — or a member whose role grants Buy plans and add budget — tops up any whole amount within the range the platform configures (currently 1 € – 1 000 € per top-up, with 50 / 100 / 250 / 500 € offered as shortcuts); the amount is charged in the top-up currency. There is no ceiling on the balance itself (the former platform balance cap was retired). In the Other amount field (on Add budget and in a member's Request budget) the decimal part may be written with a comma or a point (50,50 / 50.50), and thousands may be grouped the way the field's hint writes its limits (1.000 / 1,000, 1.000,50 / 1,000.50); an amount that mixes the two in another way is marked invalid. Changing the amount after a refused attempt clears that message (a refusal that named different limits keeps them for the field until the page is reloaded).

Automatic top-up. The workspace owner — or a member with Buy plans and add budget — sets a threshold, a top-up amount and a monthly cap; one automatic top-up must fit within the monthly cap. Once a minute the platform checks funded wallets below their threshold and charges the saved card off-session (always the owner's saved card — the card the owner paid the subscription with, or the one the owner's manual top-up saved, whichever came first: a top-up by a member with Buy plans and add budget pays once and saves no card); consecutive charges are spaced ten minutes apart and the monthly cap is enforced before every charge. A decline pauses automatic top-up and emails the owner once with the card network's reason; saving the setting again re-arms it. If the platform changes the top-up range or currency so the saved amount no longer fits, automatic top-up pauses (nothing is charged) until a new amount is saved. A charge whose outcome could not be learned is replayed under the same Stripe idempotency key — never charged twice — and escalated to an operator after 24 hours. If Stripe no longer has the saved card, or it was detached from the workspace's Stripe customer, the owner's Wallet page shows no saved card, the platform forgets it and switches automatic top-up off (the audit log records it); save a card again with a top-up, or the subscription's card is used again. The setting belongs to the workspace, not to whoever saved it: an automatic top-up switched on by a member who later loses Buy plans and add budget keeps charging the owner's card until the owner (or another member with the permission) switches it off; the audit log names who switched it on.

Refunds and charge-backs. A refund issued in Stripe debits the wallet by the refunded share of what was credited (never below zero; a shortfall is alerted to ops); a charge-back also flags the wallet so it funds nothing and accepts no top-up until an operator clears it. Owner-facing detail: Wallet API.

Who sees the wallet. The workspace owner manages it (top-ups, automatic top-up, the card). A member whose role grants Buy plans and add budget (a workspace admin can grant it through a custom role) also tops up and sets the automatic top-up, but cannot save, replace or remove the card, and their top-up leaves the workspace's billing address and VAT ID unchanged (see Billing — holder rules). On a paid workspace finance (and a holder of Manage billing settings) sees it read-only under Organisation › Billing › Wallet, and every other member — member, viewer, AI manager — sees the balance read-only on Account › Usage, next to Request more budget; the read-only Wallet shows the balance, the automatic top-up status and the payments, without any way to add budget or change the settings; card details and the Stripe payment reference stay with the owner (a holder of Buy plans and add budget sees the payments the same way). Such a member can Request budget instead: the request (an amount and an optional note) is e-mailed to the owner and every holder of Buy plans and add budget, who add the budget as usual (their Add budget on the request opens the top-up page with the requested amount already chosen, and the request is approved once that payment is confirmed) or Reject it; the member sees the decision and has one open request at a time — nothing is charged by the request itself (see Billing — budget requests). On a Standard workspace (a plan managed by Myra) only the owner adds budget and sets the automatic top-up — a member with Buy plans and add budget does not; every other role sees the wallet read-only, as above, but cannot request budget (there are no budget requests on Standard — ask the owner directly); their Your plan tab shows Your plan is managed by Myra. Ask your workspace owner if you need a change. with the balance and a link to the Wallet.

Budget periods

The gateway and token budgets each have a configurable period — the window over which spend is accumulated. For daily, weekly and monthly, spend resets automatically at the start of each new period with no manual action required. A total period is a lifetime cap and never resets on its own; only a manual reset clears it. The tenant spend cap is not configurable here — it always uses the monthly window — and the wallet is a running balance, not a resetting period.

Config field Scope Default Options
budget_period Gateway monthly daily, weekly, monthly, total
token_budget_period Token (auth token) monthly daily, monthly, total
Value Resets Use case
daily Each calendar day at midnight UTC Per-day spend caps for high-volume tenants
weekly Each Monday at 00:00 UTC (ISO week) Weekly spend caps, e.g. per-team sprint budgets
monthly First day of each calendar month, 00:00 UTC Standard billing-period enforcement (default)
total Never — lifetime accumulation One-time spend allowances, trial accounts

💡 Note: Automatic period reset is distinct from a manual budget reset, which clears accumulated spend immediately. Manual resets are available for one-off corrections — see Resetting a budget (the gateway and tenant resets are platform-admin only).

Free-trial two-gateway split

A free-trial workspace (the self_serve_trial plan) is provisioned with two pre-configured gateways instead of one, so internal (Myra-hosted, near-zero cost) usage and external (real Anthropic vendor spend) usage are bounded separately:

Gateway Models Per-gateway cap
internal the Myra EU fleet only (provider_allowlist: ["myra"]) none — bounded only by the workspace wallet balance
external Anthropic Haiku only (provider_allowlist: ["anthropic"]; the trial plan entitles only Haiku, so Sonnet/others are blocked) a flat $3.00 lifetime cap (period total)

The external (real-vendor-cost) gateway carries the only per-gateway cap; the internal gateway has none. The cap is a per-GATEWAY cap (not a tenant budget — the tenant itself is funded by its wallet) and is enforced in USD. While the workspace is on the trial plan this budget and the model restrictions are locked (see the gateway edit lock in Tenants & gateways). On upgrade to a paid plan both gateways are reset in place — the per-gateway caps and provider restrictions are cleared so the workspace is bound only by its wallet (and any spend cap it sets) and can set its own per-gateway allowances from there; the gateways are never deleted or re-created. Because the restriction is cleared, the former external gateway can from then on also run Myra-hosted models — for example the automatic conversation title, which prefers a local Myra model — and that spend is booked to external, where its per-model breakdown shows it.

On the gateway settings page the budget amount and period are read-only during the free trial; the page explains why and links to Upgrade. After a voucher has been redeemed the budget amount (not the period) becomes editable for members who may manage gateways, as long as all of the workspace's gateway budgets together stay within the wallet's spendable balance (the gateway's own current cap is always kept, if that is higher); the page shows the amount still available to this gateway, and a larger value is refused with that ceiling shown. When a trial gateway's cap is reached, the chat banner then points those members to Gateways to raise it, and everyone else to ask an administrator.

Cost calculation

Cost is computed from the token usage returned in the provider response (prompt tokens + completion tokens) combined with per-model pricing data maintained by the gateway.

Background tasks on the gateway budget card

The per-model lines on a gateway's budget card sometimes include spend you did not trigger directly: the chat interface makes small helper calls of its own, such as the automatic conversation title and the follow-up suggestions. They count against the budget like any other call. Under the model name the card says so: a line whose spend is only helper calls reads Background tasks (e.g. conversation titles), and a line that mixes them with ordinary requests reads of which background tasks: <amount>. Lines without helper calls show no note. This is unrelated to the image tool "Remove background".

Spend is incremented after each successful inference response. Streaming responses increment spend when the final chunk is processed and usage data is available.

💡 Note: Cost data depends on the internal model pricing table of the gateway. If the price of a model is not known, spend may not be tracked for that model. Check the model list endpoint to confirm pricing coverage.

quota_exceeded response

When a budget is exhausted, the gateway returns HTTP 429. The message names the scope that ran out, the cap, the spend, whether the limit resets on its own, and who can lift it. It is written for the person hitting it — an application developer or an end user — so it does not quote admin API routes.

Token (API key) budget exhausted

{
  "error": {
    "code": "quota_exceeded",
    "budget_scope": "api_key",
    "message": "This API key has used its budget of $10.00 (spent $10.00). It resets at the start of the next monthly period. An administrator can raise this API key's spend limit without issuing a new key — the same key keeps working. See Budgets & quotas in the documentation."
  }
}

The budget_scope field tells a client which cap was hit, so it can offer the right remedy (a wallet top-up lifts none of these caps): api_key (ask the workspace administrator to raise the key's limit), workspace (a workspace administrator, not a platform administrator, raises or removes the cap in the organisation settings; everyone else asks the administrator), gateway (raise the gateway budget in the gateway settings) and team (the department's combined cap — a workspace administrator raises it in the department settings). In the web app an API-key cap refusal shows the ask-your-administrator hint for everyone: personal keys have no in-place edit, and tenant administrators edit gateway keys under the gateway's API keys. The wallet-empty refusal below carries no scope. A cap refusal of the model call that follows a tool call keeps the same budget_scope: the scope rides the provider_error event of a first-party stream (top-level budget_scope), the error frame's error.budget_scope for plain streaming clients, and the error body of a buffered (Privacy mode) or non-streaming response, under the message "The model call after tool execution failed: Budget quota exceeded". Absent means unscoped; the scope is not stored on the conversation's failure record.

A per-token spend cap is editable in place (a gateway's Auth Tokens → Edit, or PATCH the token). Raising it does not require issuing a new key, and the existing key keeps working.

Workspace (tenant) wallet empty

{
  "error": {
    "code": "quota_exceeded",
    "message": "This workspace has no remaining balance, so every request is refused. It does not reset on its own — an administrator can add funds to the workspace wallet to continue. See Budgets & quotas in the documentation."
  }
}

Workspace (tenant) wallet frozen

{
  "error": {
    "code": "quota_exceeded",
    "message": "This workspace is frozen, so every request is refused. This is a deliberate freeze set by an administrator, not an exhausted balance — adding funds does not lift it; an administrator unfreezes the workspace. See Budgets & quotas in the documentation."
  }
}

Both wallet refusals carry no budget_scope and no budget or spend figures. Raising or resetting a budget does not help; the wallet itself has to be topped up (empty) or unfrozen (frozen). The step-by-step is in When requests are refused: wallet, budget and voucher codes.

Gateway budget exhausted

{
  "error": {
    "code": "quota_exceeded",
    "budget_scope": "gateway",
    "message": "This gateway has used its budget of $200.00 (spent $200.00). It resets at the start of the next monthly period. A workspace administrator can raise this gateway's budget in the gateway settings. If you are not an administrator, ask your workspace administrator. See Budgets & quotas in the documentation."
  }
}

The reset sentence follows the scope's budget_period: a daily, weekly or monthly period resets on its own, while total states plainly that it does not.

A frozen budget (0)

A budget of 0 produces a different message, because it is a different situation with a different remedy. It is not an exhausted allowance: nothing was spent, waiting does not help, and resetting the spend changes nothing (0 is still not below 0 on the next request).

{
  "error": {
    "code": "quota_exceeded",
    "message": "This gateway has a budget of $0.00, so every request is refused. This is a deliberate freeze, not an exhausted allowance — resetting the spend does not lift it. An administrator can set a budget above zero, or clear the budget entirely for no limit. See Budgets & quotas in the documentation."
  }
}

The same wording is used for a frozen API key and a frozen workspace, with the scope named accordingly; a frozen API key or workspace carries budget_scope api_key / workspace like the exhausted case. A negative budget left behind by bad data is treated as frozen too. A workspace spend cap that is not a positive number (for example text) is treated as frozen as well, never as "no limit"; only a missing budget means unlimited. This holds on every path that checks the workspace cap, including the managed pool and fleet guard and the summarize side call. A frozen workspace answers this same message everywhere — also for work the assistant delegates to sub-agents and for conversation summaries — and never as a wallet or trial-allowance error, because adding funds does not lift a freeze.

A platform administrator resets accumulated spend with DELETE /admin/v1/gateways/{id}/budget or DELETE /admin/v1/tenants/{id}/budget — both are platform-admin only: resetting a gateway or tenant ledger re-opens its cap and the platform-set platform_cap_usd ceiling, so a tenant admin receives 403 and the reset is audited (gateway.budget_reset / tenant.budget_reset). Resetting every token of one user via DELETE /admin/v1/users/{id}/budget is a token-scoped action and is unaffected by that gate.

Deleting a gateway removes its spend rows with it — the gateway scope and its API keys' token scope, every period, in the same transaction as the delete — so a deleted gateway does not linger in ledger-wide reporting (the tenant's and users' own spend is unaffected). The sweep removes each key's rows with its own point statement, so it never waits on another tenant's in-flight spend writes. Two windows are inherent: a request that was still running when the gateway was deleted books its cost after it finishes, and on a multi-site deployment a sibling site keeps accepting the gateway's API keys for its configuration / key cache lifetime (minutes) and books those requests. Rows from either window are reporting noise, never an enforcement input (the gateway and its keys are gone); the next boot's orphan pass reaps them, together with anything stranded by deletes that pre-date this behaviour ([ledger_orphan_sweep] pass done … in the gateway log).

Soft-threshold alerts (before the hard stop)

The hard stop above only fires at 100% of a budget. To warn before spend runs out, the gateway also emits a proactive soft alert when current-period spend crosses a configurable fraction of any budget (token, tenant, or gateway) without yet being over it.

  • Threshold: budget_alert_pct in the gateway config — a fraction in (0, 1), default 0.8 (80%). Set to 0 to disable the soft alert; any out-of-range or non-number value falls back to 0.8.
  • Advisory only: the request is not blocked when the soft threshold is crossed. Blocking still happens only at 100%.
  • Delivery: the alert fires two independent signals, both named budget_threshold:
    • the gateway's own configured webhook (if webhooks is set and its events filter includes budget_threshold, or has no filter) — see Webhook payload. In the web app a new webhook (gateway Edit popup, Notifications section, Webhook) has All events, including future ones ticked, which includes it; with that box unticked it is the budget_threshold checkbox. A webhook saved before that checkbox existed does not include it until you tick All events, including future ones or budget_threshold;
    • an operator notification through the shared notifier: the operator alert email address, the ops alert webhook, and Mattermost, when those are configured. It names whom the budget belongs to: the subject leads with the tenant slug (looked up from the tenant id, spaces shown as -; for example [PROD] e2e-synthetic · token b246d46b-… at 96% of its $50.0000/2026-10 budget), the structured fields carry tenant_id, gateway_id, for a token budget token_id, and tenant_slug when the lookup succeeded, and the e-mail / Mattermost body lists the tenant, the gateway (slug and id) and the token (id and label). The gateway slug and the token label, which customers set inside their workspace, appear only in that body, never in the subject, the log line or the webhook; they are reduced to ASCII letters, digits, space, ., _ and - (anything else, including accented letters, becomes a space; at most 64 / 80 characters), and the label is marked as user-set. For a token or gateway budget the body states what happens at 100% (further requests are refused with HTTP 429 quota_exceeded).
  • Once across all gateway nodes: the crossing is recorded in the database — one record per (scope, entity, period, cap) — and each of the two signals is sent once for the whole deployment, however many gateway nodes (and sites) serve the budget's traffic. The node whose request records the crossing first sends both signals; a request on any other node finds the record and sends nothing. Before sending, a signal is marked as sent in that record, and only the one sender whose mark succeeds sends it — so it is never sent twice. A new budget period, or a change to the budget amount, re-arms the alert (a new record). Records are deleted after 40 days, so a lifetime (total) budget that stays above its threshold is reminded about once every 40 days. A gateway node checks the database for a crossing only when a request is at or above the threshold, and then at most once an hour per budget — not on every request.
  • Sent a little later when it could not be sent at once: if the gateway cannot send a signal right away (for example during a restart or deploy, or when the database has a brief fault), the signal is kept and a background check sends it about a minute after the crossing — usually within about 1.5 minutes — instead of losing it. The two signals are sent independently: sending one never resends the other. A late operator notification is marked: its subject starts with [late], its fields carry late: true and recorded_at (when the crossing was recorded), and its body names the tenant and gateway by id only. A late webhook carries data.late: true and data.recorded_at; its spent_usd is the spend at the crossing and its ts the time it was sent. The late webhook goes to the gateway's current webhook configuration: if the webhook was removed, its events filter no longer includes budget_threshold, or the gateway was deleted, it is not sent; the operator notification is still sent. A signal still not sent 24 hours after the crossing is given up.
  • Suspended tenant: while the tenant is suspended neither the customer webhook nor the member mail is sent, and a signal still owed expires unsent; the operator notification is still sent. If the tenant's state cannot be read, the signal waits and is sent once it reads active, but expires after 24 hours. See Messages while suspended.
  • Customer webhook — one attempt only: the budget_threshold webhook is POSTed to your endpoint once. If your endpoint is down, slow (a 5-second timeout applies to each step — connecting, sending, reading the answer — and the answer must arrive within 10 seconds overall, after the destination's name lookup) or answers with a non-2xx status, it is not retried — not by the request, not by the background check, not by another node. The failure is logged. A webhook that cannot be sent at all (no webhook configured, an invalid webhooks configuration, a URL outside the webhook destination policy) owes nothing; a destination refused at send time (its host now resolves to an internal address, or cannot be looked up) counts as that one attempt and is not retried either.
  • When the database is unavailable at the crossing: nothing is sent yet — sending without the record could send it twice across nodes. The gateway logs the failure and that node tries again on a request at least 60 seconds later (at most one attempt and one error line per node per minute). If no request at or above the threshold arrives while the database is down, that crossing is not signalled. (If the record was written and only the answer was lost, a background check sends it.)
  • The remaining ways a signal is lost (it is never sent twice): the gateway process dies in the instant between marking a signal sent and sending it, or the mark reaches the database but its answer does not (the node then does not send, and the record already reads as sent). Each is a short window around one database write.
  • Spend-read failure (fail-open, but observable): budgets are enforced on a positive spend signal — never on its absence. If a scope's spend query cannot reach the database, that read is treated as unknown (not as 0): that scope's hard stop fails open — the request is allowed and that cap is not enforced for it (a database blip must not block all traffic) — and its soft alert is skipped for that request. Each scope fails open independently: a scope whose own read succeeds (or is served from the 5-second cache) is still enforced and can still block. Metering is independent of enforcement: the turn's cost is still debited at the end of the turn, and a debit that fails on a transient database fault is held in memory and written again until the database accepts it, counted exactly once even if the first attempt had in fact been written (each debit carries its request id as a duplicate guard, kept 7 days; a debit without a request id cannot be held and is lost, logged at ERR) (see Wallet and budget writes); it is lost only if it cannot be held or the container stops while it is held (logged at ERR). A transient database conflict on the gateway, per-token or per-user counter (for example two turns of the same member finishing at once) is re-run automatically — at most four attempts, never double-counted (a lock-wait timeout is not re-waited) — so a conflict that persists, or a database that cannot be reached, delays a debit until the database recovers rather than losing it; a per-token budget's recording on a request that was admitted with a hold is additionally retried once when the request ends — so an outage can leave spend under-counted, never over-counted. Unlike before, this is not silent: the request log's meta object carries spend_read_degraded: true (queryable via JSON_EXTRACT(meta, '$.spend_read_degraded')), the flag is forwarded to the SIEM feed, and a [budget_degraded] … log line is emitted — so a sustained outage that suppresses budget enforcement is visible to log-based alerting. Metering resumes automatically the instant the database recovers.
  • Optional: refuse instead of fail open (spend_fail_closed). A tenant admin (permission TENANT_SETTINGS_MANAGE) or a platform admin can switch a tenant to fail closed (Tenants → Edit → "Refuse requests when spend cannot be verified"; PATCH /admin/v1/tenants/:id with spend_fail_closed). The default is off, which keeps the fail-open behaviour above. With it on, a request whose token, tenant, gateway, user or department spend read cannot be completed is refused with 429 spend_read_failed (with a Retry-After) instead of being admitted uncapped; the request log records blocked_by = quota and meta.spend_read_degraded, and a [budget_fail_closed] log line is emitted. A healthy read is never refused by the switch. Limitations: the switch covers the admission-time check only. The per-scope holds taken during a turn, side-call metering (summaries, compaction and similar) and Myra guards are not covered. With the switch on, a member or department with no personal or team cap is also refused when its spend read faults, since the read cannot show that no cap applies. A partner-billed tenant always fails closed on such a fault, as 503 spend_unverified instead, whatever the switch says; its request log carries meta.spend_unverified (the scope) and meta.spend_read_degraded, and no blocked_by (see Partner-billed tenants). See Error codes — spend_read_failed.
  • Exception — the free trial fails closed: a self-serve free-trial workspace is bounded like any other self-serve workspace — by its wallet balance (the trial seeds the wallet; see concepts · the tenant wallet). There is no per-user trial credit and no tenant (seats × credit) backstop: a trial's spend is bounded by the wallet, plus the per-gateway cap below. The external trial gateway (requests served with Myra's own Anthropic keys, i.e. real vendor spend) carries a flat $3.00 per-gateway budget cap; the internal trial gateway (Myra-hosted models) has no per-gateway cap — it is bounded by the wallet alone. Because the wallet funds real Myra-hosted capacity, it fails closed: when the wallet balance cannot be read, the request is refused with HTTP 503 spend_unverified — retryable (the balance is unknown, not known-exceeded; retry shortly). The wallet is checked when each run starts, not only for the incoming request: also for every delegated sub-agent run of an agent (on any model) and for an agent run started with a service token (workflows, email triggers, chat bridges), which runs as the agent's owner. The model calls inside one run — tool-use rounds, failover retries, automatic compaction, web search — are admitted by that run's check. The external gateway's $3.00 cap keeps the per-gateway behaviour (fail-open on an unreadable spend, like every per-gateway budget) and is checked on the incoming request only (not on delegated sub-agent runs); the wallet still binds on top. Every spend_unverified refusal — here, the Myra-provided-model spend check that already refused on an unreadable balance for any workspace, and the wallet gate when the workspace wallet's balance cannot be read (any plan, on /v1 and the summarize route) — is logged, recorded in the model-error triage queue (class spend_unverified, category gateway_fault, so an outage of the spend ledger is visible to ops), and marked on the inference request log as meta.spend_unverified (the scope that could not be read: user, tenant, pool, fleet, price or wallet; a partner-billed tenant refused at /v1 admission can also carry token, gateway or team) — it is an outage, not a policy block, so it does not set blocked_by. Paid self-serve and administrator-provisioned workspaces otherwise keep the fail-open behaviour above — except a request the prepaid wallet carried past the allowance: when its per-call reservation cannot be placed, it is refused (503 spend_unverified, retryable) rather than run unreserved on the prepaid balance. The conversation summarize (compaction) route applies the same rules — for a trial, bounded by the wallet (fail-closed) exactly like /v1 — before any provider call; its spend_unverified refusals are recorded for triage (its 402 / 500 refusals are logged), and like every summarize refusal they write no inference request-log row.
  • Paid self-serve: delegated sub-agent runs on Myra models. An agent's delegated sub-agent run never passes the incoming-request budget check (it is started inside the parent request). When such a run of a paid self-serve workspace uses a Myra-hosted model, the prepaid wallet is the bound (wallet-only enforcement — there is no allowance and no reduced-model/efficient-model window): the run is admitted while the wallet holds spendable balance and is not frozen, and each model call reserves its share against it; a wallet that is empty or frozen refuses the run with 429 quota_exceeded — the parent agent sees the sub-agent fail and does not retry it. Because the run spends Myra's own capacity, an unreadable wallet refuses it with 503 spend_unverified (scope fleet), and — like every wallet-funded dial — a run whose per-call reservation cannot be placed is refused 503 spend_unverified (retryable) rather than dispatched unreserved; a Myra model without a billable price is refused at dispatch exactly as on any other request. The incoming request itself keeps the behaviour above.

The SPA's "Spend cap warnings" badge in the analytics view is fixed at 80% and is independent of budget_alert_pct; changing the knob moves the webhook/notification timing, not the badge.

Dashboard banner and notifications center

Administrators and tenant administrators see budget alerts for gateway budgets, token budgets and, in a self-serve workspace, the plan allowance.

  • Tiers: approaching (80 % or more, below the cap), reached (100 %) and exceeded (over 100 %). Reached and exceeded mean that requests are already refused. The 80 % floor is fixed and does not follow budget_alert_pct.
  • Who sees a token alert: a personal token's alert is shown only to its owner and links to the Profile page. A service token without an owner is shown to administrators and links to the gateway's auth tokens.
  • Dismissal: an approaching banner can be dismissed. The dismissal is stored on the server, and the banner shows again when the set of alerts changes. A reached or exceeded banner cannot be dismissed.
  • Notifications center: the bell in the sidebar lists the same alerts. It also lists rate_limit alerts with the number of throttled requests of the day; these do not appear in the dashboard banner and do not reset a dismissal.

Self-serve allowance emails (customer-facing)

Self-serve (self-signup) tenants additionally receive customer-facing allowance emails to the account owner (the tenant_admin seeded at signup, resolved owner-first) — separate from, and in addition to, the operator soft alert and the budget webhook above (both of which are unchanged):

  • 80% email — sent once when the tenant's spend first reaches 80% of its monthly self-imposed spend cap (spend_cap_usd). Informational; the request is not blocked. (A workspace that has set no spend cap is bounded only by its wallet balance, which has no fixed percentage to cross.)
  • 100% email — sent once when the spend cap is first fully used, stating that the hard stop applies (there is no over-cap soft-degrade). It is sent once per allowance period — never repeated on subsequent over-cap requests.
  • Locale: the email is rendered in the account owner's stored locale (en / de).
  • De-duplication: each email fires at most once per tenant per allowance period. The period is the monthly allowance cycle (anchored on the last allowance reset, ~30 days — not the Stripe invoice cadence), so on an annual subscription both emails re-arm every month, when the allowance actually resets. The date in the email is that reset; when no reset is scheduled — grace, inactive, or cancelling at the period end with no allowance reset before it — the e-mail names no reset at all (only the upgrade path).
  • Manual (non-self-serve) tenants never receive these emails — they use the operator soft alert / webhook path only.

Best practices

Scenario Recommendation
Absolute cost cap for the gateway Set gateway.budget_usd; reset monthly.
Per-client spend limit Set budget_usd on each client's token.
Development / internal use Leave budget null; rely on rate limiting instead.
Stop a gateway spending without deleting it Set its budget to 0. It shows as Frozen and refuses every request until the budget is raised or cleared.
Multi-tenant with shared cap Use gateway budget as the shared ceiling; per-token for individual client limits.

💡 Note: The budget of the gateway and the per-token budget are not linked. Exhausting the budget of the gateway blocks all requests even if individual token budgets have remaining balance.


Configuring a gateway budget

Before you begin, ensure the following conditions are met:

  • ☑ You are signed in with the role tenant admin or admin.

Gateway Budget (USD) field on the gateway settings page The Gateway Budget (USD) field on the gateway settings page.

Proceed as follows to configure a gateway budget:

  1. Open Organisation › AI setup › Gateways.
  2. Click on the Open → button of the gateway.
    • The gateway page opens on the Endpoint & keys tab.
  3. Click on the Edit button in the Gateway card header.
    • The gateway settings page opens (…/gateways/<gateway>/settings).
  4. Enter the spend cap in the Gateway Budget (USD) text field. See Entering an amount for what the field accepts.
  5. Select Daily, Monthly, or Lifetime in the Budget Period drop-down list.
  6. Click on the Save Changes button in the bar at the bottom of the page.

-> The gateway enforces the budget on every subsequent request. Requests are blocked once the configured spend cap is reached. Leaving the field empty means no limit; entering 0 freezes the gateway so that every request is refused.


Configuring a per-token budget

Before you begin, ensure the following conditions are met:

  • ☑ You are signed in with the role tenant admin or admin.

Screenshot: New Token or Edit Token dialog with Budget (USD) field The Budget (USD) field in the token dialog.

Proceed as follows to configure a per-token budget:

  1. Open Organisation in the user-block menu, then People → Members.
    • The member list opens.
  2. Click the user's name (or the open action icon on the row).
    • The person's page opens (/org/<organisation>/people/members/<user>).
  3. Select the Tokens tab and click on the New Token button.
    • The New Token for <email> dialog opens.
  4. Select the gateway, then enter the spend cap in the Budget (USD) field. See Entering an amount for what the field accepts.
  5. Click on the Create Token button.
    • The new token appears in the list with the configured budget.

-> The token budget is active immediately. Requests using that token are blocked once the spend cap is reached.

Concurrent requests on one budget

The cost of a request is known only when it finishes, so every spend cap — the API key (token) budget, the gateway budget, the workspace spend cap, and a member's per-user and department caps — holds a small amount ($0.01 by default) for every request that is still running. A request is admitted only while the cap's recorded spend plus the amounts held for its running requests is below the cap — so many requests sent at the same moment cannot all slip past a nearly used-up budget. Near a cap the requests are admitted one after the other: with headroom H left, at most about H / $0.01 requests start together, so a burst can exceed the cap by at most the cost of the requests admitted in it. When a request finishes, its hold is replaced by what it actually cost — recorded at most once, also when the database acknowledgement is lost and the write is retried; a request that is served from the cache, blocked after it was admitted, fails upstream or is aborted simply gives its hold back (a request refused by the budget never takes one). A request that passes several caps holds on each of them. If the cost cannot be recorded at once (the database stays unreachable through the retry), the recording is held in memory and repeated until the database accepts it — as for any debit that fails while the database is down (see the spend-read failure note above) — and it is lost only if it cannot be held or the container stops meanwhile (logged as an error); the request's hold is given back, or, if the database is still unreachable, stops counting at the latest one hour after the request started.

For the API key, gateway and workspace caps, a request is refused with 429 quota_exceeded in one of two ways. If the recorded spend has reached the cap, the answer says the budget is exhausted, carries a Retry-After for the next reset period, and the budget_exceeded webhook fires. If the recorded spend is still below the cap but running requests hold the rest, the answer says the limit is fully committed by requests that are still running and to try again in a moment, carries Retry-After: 5, and fires no webhook — the cap is not exceeded, and a retry succeeds as soon as those requests finish. Both carry the same budget_scope. For a member's user or department cap, an exhausted cap answers user_budget_exceeded / team_budget_exceeded with x-should-retry: false (no budget_exceeded webhook); a cap fully committed by running requests answers quota_exceeded with Retry-After: 5 and no budget_scope. The reservation is sized per model call: before a call is sent it is grown to the call's own maximum cost (input estimate plus the longest answer it may produce, on top of what the request already spent in earlier calls), never above the cap. A burst of parallel requests under a small cap therefore admits only as many as the cap can cover at their full size; the others get the fully committed answer above and can retry in a moment. This applies to every model call of a request: the answer, each tool-use round, a continuation, compaction and the inner call of an agentic web fetch. If the spend ledger cannot be reached while a reservation is grown, the call is sent (the cap fails open, as before) and the degradation is logged.

If the database cannot be reached — or the budget is so contended that the hold cannot be taken within a few seconds — the check for that cap fails open like any unreadable budget (see the spend-read failure note above); a contended hold is logged separately from a database fault so a hot budget is visible.

If a gateway process dies in the middle of a request (a crash or a restart during a deploy), that request's hold is given back automatically at most one hour after the request started. Until then the token can run slightly fewer requests in parallel than its remaining budget would allow — it never overspends. The hold is tracked per request, so this never affects another request's hold, also when the token is busy.

A turn whose computed cost is not a finite amount (a broken usage count from a provider, or a broken price) is not recorded on any budget or wallet — it is logged as an error instead — so a single corrupt response can never exhaust a budget.

A token-budget reset clears the recorded spend; the holds of requests still running on that token stay in place until those requests finish (they are still running, so they still count).


Per-user budgets

A workspace admin (anyone holding the Manage tenant settings permission, TENANT_SETTINGS_MANAGE, which also sets the workspace budget) can give one member an optional personal budget: Organisation › People › Members → open a member → Personal budget card on the Overview tab. Each member is set to one of three choices: Inherit (follow the default that applies to them; with no default, share the workspace budget as before), No limit (no personal budget, whatever a default says) or an Amount. Members start on Inherit.

  • Period. On a self-serve plan the personal budget renews together with the workspace allowance (the calendar month when no allowance renewal is scheduled). On any other plan it is the calendar month, the same window as the tenant spend cap. There is no daily or lifetime period for a personal budget.
  • Inheritance order. The cap is taken from the first level that is not Inherit: the member, then their groups (teams), then their department, then the workspace. Until a default is set, Inherit means no personal budget. A department or workspace default that is stored in an unreadable form refuses the member's requests instead of lifting the limit.
  • Group (team) limits. A group can carry a per-member limit in the same three choices (Inherit, No limit, Amount), set with PUT /admin/v1/groups/{id}/member-budget (Groups API). Membership drives the budget: a member who joins or leaves the group is bound by (or freed from) that limit from their next request. A member of several groups with a limit gets the highest amount among them; a group set to No limit dominates every amount. An amount of 0 freezes the members only if every limiting group of theirs is 0. A personal setting still beats the group; the group beats the department. Because moving a person into or out of such a group changes their limit, adding or removing a member of a group that carries a limit, or deleting such a group, also needs the Manage tenant settings permission (a manager with only the group permission is refused with 403). Free-trial workspaces have no group limits.
  • The workspace budget still applies on top. A member under their own budget is still refused once the workspace budget is used up.
  • Agent rows. Below the personal budget the card lists the member's agents that have a monthly spending limit, with the spend so far and a Change the cap action (an agent limit is a separate cap; see Agents API). Agent limits count raw provider cost, while personal and workspace budgets count the charged amount, so the two figures are not directly comparable. A top-up does not lift an agent limit. The rows are hidden on a free trial, although agent limits are still enforced there.
  • Over-allocation is allowed. The members' budgets may add up to more than the workspace budget. The card shows the workspace budget, the sum of the active members' budgets ("allocated") and the difference ("unallocated") for information only.
  • What it counts. Every model call a member's work causes: their chats, their API tokens, and the scheduled tasks, workflows, chat-bridge and e-mail runs of agents they own (those runs are billed to the agent's owner, so they count against the owner's budget — including the public documentation assistant's owner), sub-agents, and conversation compaction. Spend made earlier in the period counts too, so a budget set mid-period starts from what the member already spent.
  • When it is used up the member's requests are refused with 429 user_budget_exceeded ("Your personal budget for this period is used up…"), Retry-After set to the next period start when there is one (none for a lifetime period, or on a self-serve plan with no allowance renewal scheduled), and x-should-retry: false. No webhook is sent for a personal budget. Instead the gateway records the 80% crossing and the used-up state once per cap and period (raising the cap starts a new record) and e-mails them: the member and every active workspace admin each get one mail at 80% and one when the limit is reached, in their own language (en / de). A person who is both member and admin gets one mail, worded for the member. At most 50 people are mailed per crossing. The mail is sent right after the crossing; when that is not possible (restart, brief database fault) a background check sends it within about 1.5 minutes, marked as delayed, and gives up after 24 hours. Delivery is at most once per crossing: if the gateway stops or the mail server refuses part-way through a crossing's recipients, the remaining recipients of that crossing are not mailed. A prepaid wallet top-up does not lift a personal budget — only an admin raising or removing it does.
  • 0 freezes the member (every request refused); removing the budget lifts the cap.
  • Free trial: not available — every trial member already has their own trial credit.
  • Precision. A run is admitted through a hold, like the workspace and gateway budgets: it is refused when recorded spend plus the holds of running requests leave no room. The hold is grown before each model call, so runs started at the same moment cannot all pass. A single request can still cost slightly more than it held (the provider may count more input than estimated); the ledger records the true cost. A delegated sub-agent's child run takes its own hold against the same per-user and per-department cap, so a tree of children cannot spend past the cap beyond the holds granted; a child that does not fit is refused like any request (a child can be refused while its parent still holds the estimate of its last call, and the parent's agent is told not to retry that sub-agent in the same turn). Side calls (summaries, plan proposals, instruction tidying, Copilot) are checked against the cap but take no reservation.
  • Unreadable stored budget. If a member's stored budget cannot be read as a valid amount, their requests are refused (500 configuration_error) rather than run without a cap; save a new budget or remove it. If the spend cannot be read (a database fault), the request runs and is still counted, like the other paid budget levels.
  • Resets. A platform-admin workspace spend reset (DELETE /admin/v1/tenants/{id}/budget) also resets the members' personal-budget counters for that period. Moving a member to another workspace removes their personal budget and its counter.

The API is in Users & Tokens API → Per-user budgets. All amounts are USD.


Personal limit requests

A member who hits their personal limit can use Request more (My limits, or the chat notice) to ask for a permanent or period raise. Tenant admins and BUDGETS_MANAGE holders decide it in Approvals > Limit requests (never their own request; the rank rule of user budgets applies). A permanent raise sets the person's own amount to the limit in effect plus the raise; a period raise applies on top of the winning cap until the personal period ends, and a freeze (0) cancels it. See Personal limit requests.

Per-team budgets

A workspace admin (anyone holding the Manage departments permission, DEPARTMENTS_MANAGE) can cap a whole department (team): Organisation › People › Departments → open a department → Limits tab → set Spend limit (USD) and choose the period next to it (per day, per month or total). The cap applies to the combined spend of every member of that department; members in no department have no team cap.

  • Who may change it. A delegated holder below tenant admin cannot set, change or clear the limit of a department that has a tenant administrator (or platform admin) as a member (403 department_target_outranks); only a tenant administrator (or platform admin) can. Renaming such a department is still allowed.

  • Period. monthly (the default when none is set), daily or total (lifetime) — the same period model as the other budgets. The counter resets at the start of each period; total never resets on its own.

  • The workspace and per-user budgets still apply on top. A member is refused once any applicable cap — the workspace wallet, their personal budget, their gateway's budget, or their team's budget — is used up. The most restrictive one wins.
  • What it counts. Every model call the department's members cause in the active period, the same spend the per-user budget counts, aggregated across the whole team. Spend made earlier in the period counts too, so a cap set mid-period starts from what the team already spent.
  • Also on side calls and the Copilot lane. The team cap covers a member's /v1 model calls and the calls the product makes on their behalf: conversation summarize (compaction), the agent plan proposal, the agent instruction tidy, and the Copilot (Office add-in) lane. A team that is over its cap, or frozen at 0, is refused on these with 429 team_budget_exceeded, and what they cost is counted into the team's spend. Unlike /v1, a side call never runs on an unknown team state: a department binding that cannot be read is refused with a retryable 503 spend_unverified, and one that is malformed or points to a department that no longer exists is refused with 500 configuration_error.
  • When it is used up the member's requests are refused with 429 team_budget_exceeded ("Your department's budget for this period is used up…"), Retry-After set to the next period start when there is one (none for a total period), and x-should-retry: false. No webhook is sent for a team budget either: the 80% crossing and the used-up state are recorded once per cap and period (raising the cap starts a new record) for an e-mail notification. A prepaid wallet top-up does not lift a team budget — only a workspace admin raising or removing it does. Chat and the playground name the team budget in the message — there is no rate-limit countdown and no Add budget action, since a top-up would not help.
  • null means no cap; 0 freezes the team (every request from a member of that department refused). A stored cap that is neither absent nor a usable number, or a department row that cannot be found, refuses the member with 500 configuration_error (fail closed) rather than running without a cap.
  • Enforcement. The team cap is compared against spend at the same shared chokepoint as the per-user and per-gateway caps, so the three stay consistent. If the team spend cannot be read (a database fault), the request runs and is still counted — fail-open — like the other paid budget levels, unless the tenant fails closed (the spend_fail_closed switch, or a partner-billed tenant, see the spend-read failure notes above); the stored cap being unreadable, by contrast, fails closed.
  • Precision. A run is admitted through a hold, like the workspace, gateway and per-user budgets: it is refused when recorded spend plus the holds of running requests leave no room. The hold is grown before each model call, so runs started at the same moment cannot all pass. A single request can still cost slightly more than it held (the provider may count more input than estimated); the ledger records the true cost. A delegated sub-agent's child run takes its own hold against the same per-user and per-department cap, so a tree of children cannot spend past the cap beyond the holds granted; a child that does not fit is refused like any request (a child can be refused while its parent still holds the estimate of its last call, and the parent's agent is told not to retry that sub-agent in the same turn). Side calls (summaries, plan proposals, instruction tidying, Copilot) are checked against the cap but take no reservation.

Requesting more, and approving limit requests

A department member whose team budget is used up can ask for more instead of waiting for the next period. The Request more button is on the department row of Account › Usage → My limits and on the chat refusal. Where the refusal is shown inside a dialog (for example Test this step in the workflow builder, the workflow copilot, or a Tidy wording preview), Request more is a link to Account › Usage, where the request is made — a second dialog never opens on top of the first. The dialog takes an Amount in USD ($0.01 to $1,000,000.00; a decimal comma such as 20,50 is read as 20.50), For: Until <last day of the department's period> (e.g. Until October 31; Until the current period ends when the date is not known or already past) or Permanent, and a Why (up to 500 characters; it may be left empty). It says where the request goes (the workspace admins, who are e-mailed; you get an e-mail with the answer). Only one request per department can be open at a time; the dialog says so when you already have one. Accounts that are not in a department, impersonation sessions, and the approvers themselves (tenant admins and members with the billing-purchase permission, who cannot approve their own request) do not see the button.

Tenant admins, members with the billing-purchase permission (and platform admins acting in a workspace) decide the requests on the Limit requests tab of the Approvals page in the workspace sidebar (/approvals?view=limit-requests, see Approvals). Approve takes the amount to grant (it defaults to the amount asked for and may be lower); Decline needs a reason of up to 500 characters, which the requester sees. A period raise adds to the effective cap until the period ends; a permanent raise adds to the stored cap. The requester's status line reads waiting, approved $15 until <date>, approved $15 (permanent; a period raise whose end date is missing reads approved $15 without a date), approved $15, ended <date> once a period raise has run out, or declined with the reason. Nothing ever reads as "active" after its end date.

  • No self-approval. A tenant admin who belongs to the department cannot approve or decline their own request (403 self_approval). The queue does not hide the buttons on your own row; the refusal is shown in place on the page, and another purchaser has to decide it.
  • Department budgets only. Personal, gateway and workspace limits cannot be requested here.
  • The endpoints are under /admin/v1/limit-requests (create, GET /mine, the tenant queue, approve, decline).

The input shape and error codes are in Departments API → Input rules. All amounts are USD.


Resetting a budget

Use the reset action to clear accumulated spend so that requests can resume. Resetting is useful when correcting an over-run or starting a new billing period manually.

🔒 Platform-admin only. Resetting a gateway or tenant spend counter is reserved for platform administrators (it re-opens the cap and the platform_cap_usd ceiling); a tenant admin receives 403. Resetting a user token budget is unaffected. Every gateway/tenant reset is audited.

⚠️ Caution: Budget resets are immediate and irreversible. The Reset Spend button asks for confirmation first; an API call resets at once. Automate resets with care.

Resetting a gateway budget

Reset Spend button on the gateway page

The Reset Spend button is shown to platform administrators only.

Proceed as follows to reset a gateway budget:

  1. Open Organisation › AI setup › Gateways.
  2. Click on the Open → button of the gateway.
    • The gateway page opens on the Endpoint & keys tab.
  3. Locate the Budget card in the Gateway section.
  4. Click on the Reset Spend button in the card header, next to the Budget label, and confirm.

-> The gateway's accumulated spend is cleared for all periods. Requests are accepted again up to the configured budget cap. To reset a single period only, use the API with ?period= (see Tenants & Gateways API).

Resetting a user token budget

There is no reset control for a user's tokens in the admin UI; reset them through the API. DELETE /admin/v1/users/{id}/budget clears the accumulated spend of every token of that user (see Users & Tokens API).

-> The spend counters of the user's tokens reset to zero. Requests authenticated with those tokens are accepted again up to their configured budget caps.


API

Budget fields and reset endpoints are part of the gateway and user APIs. See Tenants & Gateways API and Users & Tokens API for examples.

See also