Skip to main content

Usage and budgets

Use Usage to see the estimated cost of requests. Use a budget to limit the traffic assigned to that budget.

For your first gateway test, set a small API-token budget on a dedicated test token. This limits requests that use that token and is easier to verify than an organization-wide billing threshold. The quickstart budget test shows a test that uses all the token budget.

Your model provider bills you directly. Verdictan cost figures are estimates for routing, limits, and analysis.

Before you start​

  • Console access to Usage and the budget or API token you want to manage.
  • For the CLI steps, an API token or session. Set VERDICTAN_API_TOKEN, or sign in with verdictan auth login.
  • A price for each model that you use through the gateway. Verdictan uses an active administrator price override or the imported model catalog price. If neither price is available, the gateway refuses the request with 503.

Select the budget control​

Which "policy"?

A budget limits spend. It is not a policy, which is the runtime AI policy that a configuration enforces, and not a permission policy (IAM). See Which "policy" is which.

The word budget shows on more than one surface. Each surface stores a different record and acts on a different request path. Do not use a value in one budget view as proof about a different request path.

InformationSurface
Current cost, tokens, and request volumeUsage
Spend alerts and blocking limitsUsage → Budgets
Provider headroom limitsverdictan spend provider-budget
API-token and scope budget limitsAPI tokens or verdictan spend budget
Actual provider chargesYour provider invoice
ControlConfigure it inRequest-path boundary
Budget that blocksUsage → Budgets in the Console, with When reached set to BlockHourly, daily, weekly, or monthly limits for a member, a team, or the organization. The control plane checks each window before it authorizes a connected gateway request, and refuses a request that would exceed a window. The client receives HTTP 402 with usage_authorization_budget_exceeded. Retry-After may be present
Model access rule per-minute limitlimits.rpm_per_token and limits.tpm_per_token in /v1/access-policiesRequests and tokens for each token in a sliding 60-second window. When more than one allow policy matches, the lowest value applies. The control plane checks the window before it authorizes a connected gateway request. Each request counts toward the request limit. A released request does not count tokens. The client receives HTTP 503 with usage_authorization_rate_limited. Retry-After may be present
Budget that alertsUsage → Budgets in the Console, with When reached set to AlertTracks spend against one limit and sends an alert at a threshold. It does not block requests
Scope spend budgetverdictan spend budget or /v1/budgetsTracks organization, team, user, or key spend. The gateway does not load scope budgets for routing
Provider budgetverdictan spend provider-budgetUsed in the provider-headroom check for configured gateway traffic. The target must have pricing metadata
Governed API-token budgetAPI tokens or verdictan token create --max-budgetThe API checks depletion for each request that uses the token

A Verdictan budget limits traffic that goes through Verdictan. It does not limit spend at the provider. If you must have a financial limit, set it in the provider console.

Read cost in Usage​

  1. Open Usage.
  2. In Time, select a listed period or set the report time range.
  3. In Granularity, select Daily or Weekly.
  4. In Group by, select Model, Provider, Agent, User, API key, Workflow, or Cache outcome.
  5. Add Filters to limit the results.
  6. Compare the trend with the rollout dates from Configurations to find cost increases after a change.
  7. To give the results to a different team, use Exports.

Usage page with example cost, token, and request totals and the cost trend for the selected period.

Cost amounts in Usage come from token counts and the unit prices that Verdictan freezes for each request. They are estimates, not invoices. Verdictan calculates each estimate in this sequence:

  1. The gateway estimates the token count before dispatch.
  2. Verdictan selects the unit prices. An active administrator price override has priority. If there is no override, Verdictan uses the imported model catalog price for the same provider and model.
  3. Verdictan freezes the unit prices in a pricing snapshot. Each snapshot has an identifier. A snapshot with a catalog price records the source catalog and the catalog version.
  4. If neither price is available, the control plane refuses the usage authorization with the error code usage_authorization_budget_estimate_unavailable. The gateway then refuses the request with 503.
  5. Verdictan calculates the estimated cost for the usage authorization.
  6. After the response, Verdictan records the token counts. If the provider returns no usage, Verdictan records an estimate of the input and output tokens and marks the record usage_estimated. With gateway 0.1.26 or later, this also applies when an output policy blocks or escalates the response. After a block in a stream, the gateway reads the remaining provider stream for a maximum of 30 seconds to get the provider usage.
  7. Verdictan writes one spend log row with the calculated cost, the provider, the model, the token counts, and the attribution.

Cache reads use the cached-input price. Anthropic cache writes use the cache-write price. If a cache price is not available, Verdictan uses the input price. Verdictan rounds each cost component to 9 decimal places. Verdictan does not apply reasoning, audio, batch, service-tier, or regional prices.

Verdictan calculates each cost in USD. Usage shows the cost in the organization currency with the current USD exchange rate, not the rate on the request date. If no exchange rate is available, Usage shows USD.

New spend log rows record byok as the credential origin. Rows from the retired platform-managed access mode keep their initial label. Use the pricing snapshot identifier to identify the cause of a historical estimate.

Set a budget in the Console​

Usage → Budgets lists all Console budgets in one table. When spend reaches the limit, a budget does one of these:

  • Alert: Verdictan records an alert and lets spending continue.
  • Block: The gateway refuses requests above the limit until the period resets.

The When reached column shows Alert at and the threshold, Track only, or Block. To show only one kind, use the When reached filter. The table also shows Name, Scope, Limit, Spend, Description, and Status.

Budgets list with example budgets that alert and budgets that block, the When reached filter, their scope, limit, and spend, and the Create budget button.

To see budgets that alert, you need budgets:read. To create one, you need budgets:create. To create a budget that blocks, you need cost_governance:write.

  1. Open Usage → Budgets and select Create budget.
  2. In When spend reaches the limit, select Send an alert or Block spending.
  3. Do the steps for the budget that you selected. See Create a budget that alerts or Create a budget that blocks.

Create a budget that alerts​

A budget that alerts tracks spend against one limit. It does not block requests.

  1. Enter a Name and the Spending limit, and select the Currency: USD, EUR, or GBP.
  2. Select the Reset schedule: Daily, Weekly, Monthly, or Never. Scheduled resets use UTC.
  3. In Applies to, select Organization, Team, Member, or API token, and then the team, member, or token.
  4. In Alert threshold, enter the percentage of the limit (1 to 100) that sends an alert.
  5. Select Create budget.

When spend reaches the threshold, Verdictan records a Budget threshold breached event in Organization → Trail. To get the alert outside the Console, stream Trail to your SIEM.

These steps store the budget and its alert. They do not verify notification delivery. See Notifications.

To change a budget that alerts, select its actions menu, and then select Edit or Delete. Edit changes the name, the limit, the reset schedule, and the alert threshold.

Budgets that block​

A budget that blocks stops spending above hourly, daily, weekly, or monthly limits for one member, one team, or the organization. The API calls it a budget policy. The gateway checks the enabled budgets that block before it sends each request on a connected gateway. A request that would go above a limit gets HTTP 402 with usage_authorization_budget_exceeded and a Retry-After header.

To see and manage budgets that block, you need costs:read and cost_governance:write. Without them, Usage → Budgets does not show budgets that block, and it tells you which permission you need.

Create a budget that blocks​

  1. Open Usage → Budgets, select Create budget, and then select Block spending.
  2. Enter a Name, for example Monthly team budget, and an optional Description.
  3. In Applies to, select Organization, Team, or Member, and then the team or member.
  4. Set at least one of Hourly limit (USD), Daily limit (USD), Weekly limit (USD), and Monthly limit (USD). Leave a period empty for no limit. Limits are in USD only.
  5. Select Create budget.

Periods use UTC. A week starts on Monday.

Change, disable, or delete a budget that blocks​

Select the actions menu of the budget, and then select one of these:

  • Edit changes only the name and the description. To change the limits or the scope, create a new budget and delete the old one.
  • Disable stops the budget from blocking requests until you enable it again. The Console asks you to confirm, and then shows Undo for a short time.
  • Delete removes the budget.

For a budget that blocks, the Limit column shows each period limit, or No limit. The Spend column shows Not reported, because the API does not report spend for budgets that block.

The hourly and daily budgets of a model access rule use the same windows. The lowest limit that applies to a request wins.

Set a provider budget or a scope budget with the CLI​

To limit the provider headroom for configured gateway traffic, create a provider budget:

verdictan spend provider-budget create --provider openai --limit-usd 5000 --reset-schedule monthly
verdictan spend provider-budget list --json

To track spend for an organization, a team, a user, or a key, create a scope budget:

verdictan spend budget create \
  --name "Support Team" \
  --max-budget 2000 \
  --target-type team \
  --target-id <team-id> \
  --alert-threshold-pct 70

See Spend, budgets, and API tokens for each option and for the token budget flag --max-budget.

Reset a budget on a schedule​

A scope budget and a provider budget accept a reset schedule of never, daily, weekly, or monthly. The API rejects any other value with 422. A budget without a schedule does not reset.

  • Periods are in UTC. A daily period starts at 00:00 UTC, a weekly period on Monday, and a monthly period on the first day of the month.
  • A provider budget can set reset_at in /v1/provider-budgets. That time is the next reset and the anchor for later periods. A monthly anchor on a day that a month does not have, such as the 31st, ends that month's period on its last day.
  • When a period ends, the budget shows zero spend immediately.

Verify​

  1. In Usage, make sure that the provider, model, and attribution match the test request.
  2. In Usage → Budgets, make sure that Scope, Limit, and When reached show the values that you set.
  3. For a provider budget, send one allowed request through the gateway.
  4. In a test environment, send a request that exceeds the provider budget.
  5. Make sure that the gateway blocks the request.
  6. For an API token, run verdictan token get <id> --json.
  7. Examine the budget binding.
  8. With a test token that has a small limit, send a request that exceeds the token budget.
  9. Make sure that the gateway blocks the request.

A saved budget record does not verify enforcement. Do these tests before you use a budget to protect traffic.

Use the provider invoice for accounting. Use Verdictan values for engineering attribution, budget control, and trend analysis. A Verdictan amount can be different from the provider amount because the estimate excludes provider discounts, committed-use contracts, taxes, and rounding.

Troubleshooting​

SymptomCauseAction
A request fails with a spend or budget errorA token limit, a budget that blocks, a scope budget, a provider headroom limit, or an authorization policy stopped it. A budget that blocks or a token allowance returns HTTP 402 with usage_authorization_budget_exceededPreserve the response code, the error code, the request ID, the token ID, the provider, and the model. Find the owning control before you send the request again
A request fails with 503 and usage_authorization_rate_limitedThe token reached a per-minute request or token limit of a model access ruleWait for the time in Retry-After when it is present, then send the request again. To allow more traffic, raise the lowest rpm_per_token or tpm_per_token among the matching model access rules
A request fails with 503 and the gateway log shows usage_authorization_budget_estimate_unavailableVerdictan has no price override and no catalog price for the provider and modelAsk a platform administrator to add a price override for the model. You can also use a model that has a catalog price
A scope budget does not stop connected gateway trafficA connected gateway does not load scope budgets for routingUse a provider budget, an API token limit, or usage authorization for that path
The Verdictan amount is different from the invoiceThe estimate excludes discounts, contracts, taxes, and roundingReconcile with an exported spend log slice and the invoice

Next steps​