Skip to main content
Version: 1.14.0

Cost Management

Enterprise only

Not included in DVARA Open Source.

The Open Source runtime does not serve budget caps, pricing management, chargeback, forecasting, or POST /v1/budget/estimate.

The sidebar's Cost section groups the FinOps surfaces: the live cost dashboard, token usage telemetry, model pricing, the token calculator (from 1.10.0), the Cost Advisor (from 1.12.0), budget caps, and chargeback reports. Compliance reports are under Governance → Compliance; they are described at the end of this page.

Cost dashboard​

Open Cost → Cost Dashboard in the sidebar.

Cost dashboard with summary cards, charts, budget status, and cost recordsCost dashboard with summary cards, charts, budget status, and cost records
Figure 1. Cost dashboard with summary cards, charts, budget status, and cost records

Cost records​

A table of cost records with timestamp, workspace, model, provider, tags, input / output tokens, input / output cost, and total cost. DVARA also stores the opaque API-key ID on each record, but this table does not display it; use the Token Usage tab of Cost → Cost Dashboard when you need per-key attribution. Auto-refreshes every 5 seconds.

Filters: narrow by workspace, model, provider, and date range.

From 1.8.4 a From or To date the page cannot read, such as not-a-date or 08/17/2026, is refused on that field, and the message stays under it. No rows are listed and no totals, charts or tag spend are shown until you fix the date. The 5-second refresh keeps the date as typed, so it cannot bring the rows back. The Spend by tag CSV answers such a date with a 400 that names it. Before 1.8.4 the page dropped an unreadable date and listed and totalled the whole history.

Summary cards​

Aggregated totals at the top of the page: total cost, total requests, total input tokens, total output tokens. From 1.8.5 the page also shows how many of the input tokens were cached reads and cache writes, and how many of the output tokens were reasoning. See Price cached and reasoning tokens.

Charts​

Three interactive visualizations:

  • Cost by Provider — donut chart breaking down total spend by provider
  • Cost by Model — horizontal bar chart showing spend per model
  • Cost by API — bar chart showing spend by the API each call came in on
Cost dashboard with cost-by-provider donut and cost-by-model bar chartCost dashboard with cost-by-provider donut and cost-by-model bar chart
Figure 2. Cost dashboard with cost-by-provider donut and cost-by-model bar chart

What a soft-limit crossing actually does​

Crossing a soft limit writes a BUDGET_CAP_SOFT audit event. That is the whole delivery mechanism, and the rest follows from it:

  • Flightdeck raises a notification. When Flightdeck receives a BUDGET_CAP_SOFT, BUDGET_CAP_WARNING or BUDGET_CAP_HARD event from a gateway, it raises a notification for the people who manage budgets in that workspace (owner, billing-admin, workspace admin). It is a WARNING for a soft limit or warning and CRITICAL for a hard cap. It shows in the notification bell and is emailed to each of those users who has email turned on, when email is configured. Repeats for the same budget group into one notification whose count goes up.
  • A webhook also works. Subscribe a webhook to BUDGET_CAP_SOFT — it is a supported webhook event type — and the webhook retry and delivery-log behaviour then applies, the same as any other event.
  • Deduplication is a per-budget cooldown, dvara.llm-gateway.finops.soft-alert-cooldown-minutes, default 60. Inside the window the crossing is silently skipped rather than re-emitted.
The cooldown is per pod, not fleet-wide

It is held in memory in the enforcer, so each replica keeps its own. A fleet of N pods can emit up to N alerts per cooldown window for one budget, and a restart clears the memory — so a rolling deploy can produce another. Size an on-call rule for that, or dedupe on budget_id downstream.

BUDGET_CAP_HARD is emitted the same way and is likewise a subscribable webhook event.

Budget status panel​

Lists budget caps with their scope, period, limit, and whether each is enabled. It does not show spend. To see spend against each cap, open Cost → Budget Caps.

Forecast cards​

Shows 7-day trailing cost forecasts per model with projected month-end spend and trend indicators (increasing / decreasing / stable).

Anomaly alerts​

Lists detected cost anomalies. Each line shows the model, its current daily rate, that rate as a percentage of the baseline, and the baseline daily rate. The threshold is configurable globally via dvara.llm-gateway.finops.anomaly-threshold-pct and per-workspace by setting cost.anomaly-threshold-pct in the workspace metadata.

Cost dashboard with KPI summary, cost-by-provider donut, cost-by-model bar chart, and records table — when forecasts and anomalies are present they render as additional cards above the records tableCost dashboard with KPI summary, cost-by-provider donut, cost-by-model bar chart, and records table — when forecasts and anomalies are present they render as additional cards above the records table
Figure 3. Cost dashboard view. Forecast cards and anomaly alerts render above the records table when forecasting and anomaly detection return non-empty results — both require 7+ days of trailing cost data. With no forecasts/anomalies the page falls back to the KPI summary + chart + records layout shown here.

Spend grouped by tag​

The chargeback question — which team spent this — answered from the cost dashboard's tagKey filter. Supply a tag key and the page groups spend by that tag's values.

Opt-in by key, with no default, because tags are workspace-defined: there is no key DVARA can guess, so there is no panel until you name one. The grouping respects the page's workspace filter, so a scoped view reports that workspace's spend rather than the fleet's.

Each tag value also shows Tool calls and Agent hops: the MCP tool calls and A2A agent calls that carried the same tag (see Follow one customer across model, tool and agent calls). They are counted as billing counts them, so a call a policy refused, or an agent call refused before it reached the agent, is left out. A value seen only on tool or agent calls still has its row, at $0. The CSV export adds tool_calls and agent_hops after the model columns, and a tag value's own page shows both counts.

Credential Forensics​

Open /token-usage/by-credential (owner only; no menu item links to it, so type the URL). It answers the reverse lookup: which workspaces sent traffic under this provider credential.

This is the page an abuse report sends you to. A provider tells you a key of yours is generating traffic they object to; on a shared or BYOK-mixed install, this is what turns that key back into a list of workspaces. Owner-only because it deliberately crosses workspace boundaries.

Token Usage page​

Export the billing-grade monthly true-up with an owner or billing-admin Flightdeck session:

curl --fail --location --cookie "$DVARA_FLIGHTDECK_COOKIE" \
"https://<flightdeck-host>/token-usage/export?workspace_id=<workspace-id>&month=2026-09&format=csv" \
--output token-usage-2026-09.csv

month uses YYYY-MM; format is csv or json. workspace_id scopes the export to one workspace.

From 1.8.5 the export adds cached_input_tokens, cache_write_tokens and reasoning_tokens: after its old totals, and as the last three columns of each model row. A reader keyed on column position keeps working.

From 1.8.6 it also gives governed_calls: LLM requests, MCP tool calls and A2A hops added together for the month, the number a licence agreement's volume and over-use are measured against. It is the last summary line of the CSV, and governedCalls in the JSON. Every install counts, with or without a licence.

For per-request token detail — the raw records underneath the dollar aggregates — open Cost → Cost Dashboard in the sidebar and choose the Token Usage tab. The page carries a filter form (workspace, API key, model, date range) that drives a summary KPI card (input / output / total tokens, request count, average tokens-per-request; from 1.8.5 also cached-input, cache-write and reasoning tokens) and a records table (newest first, key name and public prefix, plus an estimated-flag tooltip on rows where the upstream didn't return exact counts). Each page shows 20 records by default; the limit parameter raises it to at most 1000.

The persisted value behind that label is the key's opaque ID, not its bearer secret or display prefix. The same ID connects token usage, cost records, per-key budgets, access logs, audit evidence, analytics, and chargeback exports. An unauthenticated request is attributed to anonymous. You can filter Token Usage with the visible prefix when it belongs to exactly one key in the selected workspace; Flightdeck resolves that prefix to the ID before it searches.

Usage and spend per API (from 1.10.0)​

Every usage row and cost record names the API the call came in on: Chat Completions, Completions, Responses, Messages, Gemini, Cursor, Embeddings, Batches, or Other. It is one of a fixed list, never the request path. Because each coding agent uses its own API (Codex the Responses API, Claude Code the Messages API, Gemini CLI the Gemini API, Cursor its own path), this is also spend per coding agent.

  • Token Usage has an API filter, an API column on each row and a Usage by API card with requests and tokens per API.
  • Cost has a Cost by API chart.
  • The monthly usage export ends with a line per API, with its requests, tokens and cost.

Calls from before the upgrade have no API and are shown as Unknown.

See where the tokens go (from 1.14.0)​

The Token Usage page has a Where the tokens go section with three panels. They answer three questions: how much input was served from the provider's prompt cache, how many counts the gateway had to estimate, and how full the model's context window was.

PanelWhat it shows
Token mixInput split into Cached reads, Cache writes and Fresh input, and output split into Reasoning and Answer. Each part shows its count and its share, as a bar.
Estimated countsThe share of calls whose token counts the gateway estimated because the provider sent none, and the share of tokens those calls make up.
Context window useA histogram of each call's input as a share of the model's context window: under 10%, 10% to 25%, 25% to 50%, 50% to 75%, 75% to 90%, and 90% or more. A table below gives the same counts.

The panels follow the page's filters: workspace, model, API and dates. With no From date they cover the last 30 days. A workspace role sees only its own workspace, as on the rest of the page. When no provider served a call in the period, each panel says so instead of showing zeros. When a date cannot be read, no panels are shown.

Some calls are left out on purpose:

  • Gateway cache hits. No provider served them, and their counts describe the call they replay.
  • Calls to a model with no known window, in the context panel only. The window comes from the model catalogue, matched on the provider and the exact model id. When the catalogue gives a lower input limit, that limit is used. DVARA never guesses a window. The panel says how many calls it left out.

When the Cost Advisor has open findings on the same tokens, a panel links to them:

  • The Token mix panel links to open findings on caching and model choice: an uncached repeated prefix, a large system prompt, a prompt-cache marker that does not pay, and a cheaper model.
  • The Context window use panel links to open findings on max_tokens reservations that are much larger than the output calls produce.

The link opens the Cost Advisor narrowed to those kinds of finding and, for a platform role, to the chosen workspace. Only roles that can open the Cost Advisor get the links: the owner, a billing-admin and a workspace admin. A developer or viewer sees the panels without links. A workspace's own Cost → Usage page shows the same three panels; see Read this month's usage and cost.

Token Usage records for the Billing workspace, showing the billing-production key by name and safe public prefix beside model, provider, cache, and token countsToken Usage records for the Billing workspace, showing the billing-production key by name and safe public prefix beside model, provider, cache, and token counts
Figure 4. Per-request attribution uses an opaque key ID underneath, while Flightdeck resolves it to a key name and public prefix an operator can recognize.

The Cost Dashboard is the dollar lens of the same data — tokens rolled up with pricing into spend figures grouped by workspace / model / provider / time range. Use the Cost Dashboard for spend visibility and budgets; use the Token Usage page for pricing audits, cost-per-token analysis, or reconciling a disputed workspace invoice.

Use the visible workspace, API-key, model, and date filters on this page to narrow the list and summary. From 1.8.4 an unreadable From or To date is refused on the field, and nothing is listed or totalled; before, the page silently showed the whole history. The monthly export takes a month and already refused a bad one. The former Automation API was removed in 1.7.0; there is no supported administrative REST endpoint for these reports.

Model pricing​

Open Cost → Model Pricing in the sidebar.

Use the model catalogue guide for catalogue price precedence, the operator catalogue URL, validation and refresh behavior, and the switch that disables catalogue prices.

Pricing list​

Lists every pricing entry with model pattern (glob), provider, input price per million tokens, output price per million tokens, effective date, and row actions. From 1.8.4, a cached, cache-write or reasoning rate that is set shows in small text under the input or output price.

Model pricing list with seeded entriesModel pricing list with seeded entries
Figure 5. Model pricing list with seeded entries

Create pricing and add revisions​

Click Add Pricing to create an entry with:

  • Model Pattern — glob pattern (e.g. gpt-4o*, claude-3-sonnet*)
  • Provider — the provider this price applies to (required)
  • Input Price ($/1M tokens) — USD per 1 M input tokens
  • Output Price ($/1M tokens) — USD per 1 M output tokens
  • Cached Input Price, Cache Write Price, Reasoning Price (from 1.8.4, optional) — USD per 1 M input tokens read from the provider's prompt cache, input tokens written to it, and output tokens the model spends reasoning
  • Effective Date — when this pricing takes effect
The Add Pricing Entry form, taking a glob model pattern, a provider, input and output prices per million tokens, and an optional effective date that defaults to immediateThe Add Pricing Entry form, taking a glob model pattern, a provider, input and output prices per million tokens, and an optional effective date that defaults to immediate
Figure 6. Create-pricing form

A price is never edited in place. Click New revision on a row to open the same form. Saving writes a new entry and keeps the old one, so the history of what calls cost stays intact.

A price that has taken effect cannot be deleted. Flightdeck answers "Historical or active pricing cannot be deleted. Create a new revision instead." Only an entry with an effective date in the future shows Cancel scheduled, which removes it after you confirm.

Price cached and reasoning tokens​

From 1.8.4 the gateway reads how many input tokens came from the provider's prompt cache, how many were written to it, and how many output tokens went to reasoning. See the usage block. Providers price these differently: a cache read costs about a tenth of the input price, a cache write costs more than the input price, and a reasoning token costs the output price.

A call is priced in parts. Cached input tokens use the Cached Input Price, cache-write tokens use the Cache Write Price, and the rest of the input uses the Input Price. Reasoning tokens use the Reasoning Price, and the rest of the output uses the Output Price. An empty field charges those tokens at the plain input or output price, so an existing price row costs exactly what it did before 1.8.4. The rates reach gateways with the rest of the configuration, and a pricing change records the new rates in its audit event.

Usage and cost records store the cached-input, cache-write and reasoning counts. Records from before 1.8.4 read as zero. From 1.8.5 the reports show them: the Token Usage summary card, the Cost Dashboard, the monthly usage export, the chargeback model summary and its CSV, and the workspace Usage and chargeback pages. Each part is inside its input or output total, so no total changes. The pages say the parts cover only calls since the upgrade to 1.8.4. The per-model breakdown leaves out gateway cache hits, whose tokens are already counted once as cache-hit tokens. Before 1.8.5 the reports showed only the input and output totals.

From 1.10.0 a cost record also says whether its spend was estimated. A stream whose provider sends no usage block, such as every Anthropic stream, is priced from token counts the gateway estimates. The usage record already said so; now the cost record does too, and the monthly usage report splits its cost into exact_cost_usd, estimated_cost_usd and unknown_cost_usd. Records written before the upgrade count as unknown: they are not backfilled as exact.

Anthropic and Bedrock report cache reads and writes outside their input count, and Gemini did not count thinking tokens. From 1.8.4 these are included, so a call that uses prompt caching or thinking records more tokens than it did before. That matches what the provider bills.

How a price is chosen​

DVARA considers only prices whose effective date is today or earlier. An exact model name beats a glob; among globs, the more specific pattern wins; a tie uses the later effective date. For example, a future gpt-4o* price remains dormant until its date while today's exact gpt-4o-mini price continues to apply. A new effective price is visible within dvara.llm-gateway.finops.pricing-cache-ttl-seconds (default 60). Existing cost records are not recalculated.

Models served with no price​

A model with no price writes no cost record, so its calls are missing from cost reports, budgets and chargeback. The Pricing and Costs pages list such models. From 1.10.0 Flightdeck also tells the people who manage prices:

  • Every hour it looks for models served in the last 30 days that have no price, neither one entered here nor one from the model catalogue.
  • For each one it raises a notification for the owner and billing admins, in the notification center, by email and to webhooks subscribed to NOTIFICATION. It gives the model, the provider and the number of calls, and links to the price form filled in for that model.
  • A model still unpriced at the next check adds to its open notification instead of raising another. Once it has a price, nothing more is raised.
  • MODEL_SERVED_UNPRICED is audited the first time a model is found.

Change the schedule with dvara.flightdeck.pricing.unpriced-model-cron (default 0 23 * * * *, at 23 minutes past every hour).

Token calculator​

From 1.10.0, Cost → Token Calculator shows what a prompt costs before anyone sends it. Paste a system prompt, a user message and, if you like, tool definitions as JSON. Pick up to six models and set the output allowance (max_tokens). For each model the page shows, side by side:

  • The input tokens, and how they split between the system prompt, the tools, the user message and the fixed overhead per message. It names the vocabulary used and whether it is the model's own or an estimate.
  • The share of the model's context window the prompt takes, against the gateway's warning and hard thresholds, and whether the prompt and the output allowance together would not fit.
  • The price: the input cost and the most the call could cost with the output allowance. Prices come from the pricing list above, else the model catalogue. A model with neither shows "No price", never $0.

The counts update as you type. Flightdeck counts the prompt itself: nothing is sent to a provider, nothing is stored, and the page works with the Playground turned off.

Who sees it: the owner and billing admins, and in a workspace its admin, developers and viewers. Anyone who can read cost can use it. A workspace user sees their own workspace's context-window thresholds.

An application asks the same question through the gateway with POST /v1/tokens/count; see how to count tokens before a call.

Cost Advisor​

From 1.12.0, Cost → Cost Advisor lists ways to spend less. Each suggestion says what it would save a month and why. The figures come from the last 30 days of billed calls, priced the way billing prices a call: on the tokens each call used, at the price on the pricing list, else the model catalogue. Calls the Gateway makes for itself, such as a judge grading an answer, are left out. A suggestion that saves less than $5 a month is not shown, except Lower max_tokens, which saves nothing on the bill, and Route a model by tier shown without a price.

There are seven kinds:

SuggestionWhat it foundHow it is applied
Use a cheaper modelA workspace spends at least $50 a month on a model, and a model from the same provider can do what it does (tools, structured output, reasoning, images, enough context) for at most 70% of the cost on the same tokens. The advisor picks the closest step down, not the cheapest.Change the model your application asks for. The suggestion links to the workspace's downgrade rules.
Turn on the response cacheThe workspace's cache is off, and some of its requests repeated one the cache would have answered within its time to live. The saving is what those repeated calls cost.Apply turns the cache on for that workspace, keeping its other cache settings.
Route a model by tierFleet-wide, for a model whose calls the free heuristic classifier puts in tiers. Priced at the tier map of an intelligent route you already have. With no such route, the suggestion is shown without a price when much of the traffic is simple.Add or change an intelligent route on Traffic → Routes.
Large system promptOne API key sends a system prompt of 2,000 tokens or more on average, over at least 100 calls. Not shown for a key and model that already have Prompt and tools re-sent without the cache. The saving is what provider prompt caching would save, or half the prompt's cost where the model has no cached price.A flag only. DVARA never changes a prompt.
Prompt and tools re-sent without the cacheFrom 1.14.0. One API key sends, on average, 1,024 tokens or more of system prompt and tools per call to one model, over at least 100 calls, and less than 20% of its input is read from the provider's cache. Shown only for a model whose cached-input price is below its input price. The saving is the uncached part priced at the cached rate.On Anthropic or Bedrock, when the workspace's prompt-cache marker is off, Apply turns it on (see Mark prompts for the provider's cache). If the calls send their own Anthropic body, it says to mark the stable part with cache_control in the client. For other providers it says to keep the start of the prompt and the tool list the same on every call. If the marker is already on, it says the advisor is checking that the marker pays.
Lower max_tokensFrom 1.14.0. One API key, on one model over at least 100 calls, reserves a median max_tokens at least 10 times its 99th-percentile output and at least 1,000 tokens above the suggested value. The suggested value is twice the 99th-percentile output or the largest output, whichever is larger, rounded up to a multiple of 1,024. Not shown when more than 0.5% of the calls stopped at the limit.A flag only, with no saving: providers bill only the output produced. The reservation still counts against context and budget checks, and the suggestion shows how much it raises each call's cost estimate. Change max_tokens in your application.
Turn the prompt-cache marker offFrom 1.14.0. The workspace's prompt-cache marker has been on for at least 7 days, and in the last 7 days (at least 100 calls) cache writes cost more above plain input than cache reads saved. Priced on those 7 days and shown as a month. With no cache-write price on the pricing list, a write is priced at 1.25 times the input price.Apply turns the marker off for that workspace.

Quality. A cheaper model is checked on the workspace's own traffic before it is called validated, but only if the workspace admin turns checking on (see Check cheaper models). Until then the suggestion shows Not checked. While checks come in it shows Checking. After 30 checks it shows Validated when quality held in at least 90% of them, else Quality dropped, and the advisor stops trying that model.

Dismiss asks for a reason. A dismissed suggestion stays dismissed for 90 days, unless its saving doubles. A dismissed Lower max_tokens comes back sooner when its excess tokens double. The Applied and Dismissed tabs keep each decision with who made it. Flightdeck recomputes the list every day at 03:15 UTC (dvara.flightdeck.advisor.sweep-cron; - turns it off), and Recompute now runs it at once.

Who sees it: the owner and billing admins see every workspace's suggestions and the fleet-wide ones. Both can dismiss. Apply changes how a workspace's traffic is served, so on this page it is for the owner. A workspace admin sees, applies and dismisses their own workspace's suggestions on Cost → Cost Advisor. Applying there changes only that workspace's own settings. The admin can also turn on checking cheaper models there.

Narrow the list. From 1.14.0 the page takes a kind parameter, such as /advisor?kind=UNCACHED_PREFIX&kind=PROMPT_BLOAT, and on this page a workspace parameter with a workspace id. Give kind more than once or as a comma-separated list, in any case. An unknown kind is ignored. The page then shows only those suggestions, with a Show all link; the totals at the top still cover the whole list. The token panels on the usage pages link here this way. The kinds are CHEAPER_MODEL, ENABLE_CACHE, INTELLIGENT_ROUTING, PROMPT_BLOAT, UNCACHED_PREFIX, OVER_RESERVED_MAX_TOKENS and CACHE_MARKER_NOT_PAYING.

Saved by context compression. From 1.14.0 this page also shows what context compression saved in the last 30 days, for every workspace that uses it, and how many workspaces have it on. It is read only here: each workspace's admin turns compression on.

ActionAudit event
Apply a suggestionADVISOR_APPLIED, and WORKSPACE_CACHE_CONFIG_UPDATED for a cache change or WORKSPACE_ADVISOR_CONFIG_UPDATED for a prompt-cache marker change
Dismiss a suggestionADVISOR_DISMISSED, with the reason

Budget caps​

Open Cost → Budget Caps in the sidebar.

Budget caps govern spend in dollars. The Enterprise tier catalogue separately defines monthly LLM, MCP, and A2A governed-call quotas and whether a tier blocks at its hard cap.

Budget list​

Lists every budget cap with name, scope (workspace, API key, tag, or Global), period (Daily / Weekly / Monthly / Lifetime), limit (USD), soft limit percentage, utilization, and enabled status. Auto-refreshes every 10 seconds. A Summary row at the top shows total budgets, enabled count, and disabled count. Use the Workspace dropdown filter to narrow the list.

Workspace self-service budgets

Workspaces can create their own caps from the Cost → Budget Caps page. These are stored with managedBy=TENANT and must sit at or below the effective platform ceiling: the tightest enabled PLATFORM cap that governs them. Flightdeck lists both kinds. Authorized platform operators can edit either provenance; workspace roles see operator-created caps as read-only. Budget evaluation is tightest-wins across every applicable cap.

Budget Caps list with workspace ceilings, a daily production-key cap, and a workspace-managed monthly capBudget Caps list with workspace ceilings, a daily production-key cap, and a workspace-managed monthly cap
Figure 7. Platform, workspace, and per-key caps share one tightest-wins view without displaying a bearer credential.

Create / edit budget​

Click Add Budget to create a budget cap with:

  • Name — descriptive name
  • Workspace — a dropdown to scope the cap to a workspace (Global (all workspaces) = a global cap: a fleet-wide cap on total spend across all workspaces, evaluated on every request)
  • API Key ID — scope to a specific API key (blank = workspace-wide)
  • Tag key and Tag value — scope to calls that carry that tag (optional). A tag cap only limits callers that send the tag. The caller sets its own tags, so a call that leaves the tag out, or sends another value, is not counted against it. For a limit no caller can get around, use an API key cap or a workspace cap. The budget list marks each tag cap Set by the caller.
  • Period — Daily, Weekly, Monthly, or Lifetime (tag caps only). Daily, weekly and monthly caps reset at midnight UTC. A lifetime cap never resets and counts from the cap's creation.
  • Budget Limit (USD) — hard spending limit
  • Soft Alert Threshold (%) — percentage of the limit at which soft alerts trigger, from 1 to 99 (default: 80%)

Creating or deleting a cap requires approval from a different budget manager. Approval is also required when you change the period, hard limit, or enabled state. A name or soft-limit-only edit is not treated as a material change.

For a protected change, submit the values and a reason, then ask the second manager to review them under Governance → Approvals. After approval, return to the budget action and execute those exact values before the 15-minute window expires. If the cap or submitted values changed in the meantime, Flightdeck refuses the approval and asks you to start again.

All applicable budgets are evaluated on each request and the tightest limit wins — a global cap, the workspace's cap, and an API-key cap can all apply at once, and the first to breach blocks (hard limit) or alerts (soft limit).

Enter the opaque api_key_id from that key's API_KEY_CREATED audit event, not the plaintext gw_... credential or its public prefix. The current budget form does not resolve a key name or prefix for you. A per-key cap and that key's usage records use the same ID, so spend is charged to the cap without storing the secret.

The Add Budget Cap form, taking a name, a Daily, Weekly or Monthly period, an optional workspace and API key scope, a USD limit, and a soft alert threshold defaulting to 80 percentThe Add Budget Cap form, taking a name, a Daily, Weekly or Monthly period, an optional workspace and API key scope, a USD limit, and a soft alert threshold defaulting to 80 percent
Figure 8. Create-budget form

Per-call cost ceiling​

Budget caps limit accumulated spend over a period. A separate, optional per-call ceiling limits the estimated cost of any single request — useful when you want a hard stop on one runaway call regardless of how much budget remains. It is off by default and set in configuration, not Flightdeck:

# application.yml
dvara:
llm-gateway:
finops:
per-call-max-cost-usd: 0.50 # reject any single request estimated above $0.50

A request whose estimated cost exceeds the ceiling is rejected before it reaches the provider with 402 Payment Required (PER_CALL_COST_EXCEEDED) and an audit event. The estimate is the declared output plus the input: max_tokens × the model's output price (the worst case the client declared), plus the estimated input × the input price. The input count covers the text, tool definitions and tool calls, plus an allowance per image (dvara.llm-gateway.finops.image-token-estimate, default 765; image-token-estimate-low, default 85, for an image sent at detail: low). A request with no max_tokens is priced on its input only. A model with no pricing row cannot be priced, and the call passes through. From 1.10.0 a reasoning model's output allowance is priced at the higher of its output rate and its reasoning rate, because the output limit bounds reasoning too; a soft-limit downgrade rule that would move to a model whose output costs more is skipped with a WARN. Also from 1.10.0, for a request this ceiling will check, Claude and Gemini count the input themselves (Anthropic count_tokens, Gemini countTokens); every other request is counted locally, and the local count for Claude is corrected from a measurement against what Anthropic billed (×1.05, and +540 tokens for a request with tools). dvara.llm-gateway.token-count.vendor.enabled (DVARA_LLM_GATEWAY_TOKEN_COUNT_VENDOR_ENABLED) is selected by default; true asks the provider for every request and false for none. Override the ceiling for one workspace with cost.per-call-max-usd in the workspace's metadata — a positive value there enables the gate for that workspace even when the global ceiling is 0. This complements, and runs alongside, the accumulated-spend budget caps above.

Check a budget before sending a model request​

Use POST /v1/budget/estimate when an application needs to warn a user before it sends a potentially expensive model request. The endpoint reads the current budget for the workspace and API key, but it does not call a provider or create a usage or cost record.

Send the model and the maximum output tokens. From 1.10.0 you can also send the prompt as messages, with tools, exactly as for /v1/chat/completions, and the estimate prices the input too. Replace the host and key with values from your Enterprise deployment:

curl -s https://dvara.internal.example.com/v1/budget/estimate \
-H 'Authorization: Bearer <your-dvara-api-key>' \
-H 'Content-Type: application/json' \
-d '{
"model": "gpt-4o-mini",
"max_tokens": 500
}'

A priced request with room under its tightest applicable budget returns:

{
"estimated_cost_usd": 0.0003,
"budget_remaining_usd": 42.18,
"budget_remaining_tokens": 112480000,
"budget_remaining_pct": 84,
"would_exceed_budget": false,
"pricing_known": true
}

Without a prompt, the estimate covers output only: max_tokens multiplied by the model's output price. From 1.10.0, a request that sends messages (and tools) is also priced on its input: the counted input tokens multiplied by the input price. To see the count itself, and where the tokens go, use POST /v1/tokens/count. budget_remaining_tokens is a separate approximation based on the average of the configured input and output prices.

Treat pricing_known as part of the decision. When it is false, no exact or glob price matched the model and estimated_cost_usd: 0.0 does not mean the request is free. Add a pricing entry before relying on the estimate. If the current hard cap is already exhausted, would_exceed_budget remains true even when pricing is unknown.

When no budget applies, the three budget_remaining_* values are null and would_exceed_budget is false. An omitted, zero, or negative max_tokens also produces a zero estimate, so send the same positive limit your model request will use.

A scoped key needs completions:write; an unscoped key is unrestricted. The endpoint returns the current decision rather than reserving funds. Spend can change between this check and the model call, so the actual request still runs the normal budget enforcement.

A newly-set override takes up to a minute to apply

The per-workspace override is cached in the gate, so a ceiling you have just set keeps serving 200 for around a minute before it starts rejecting. Measured on 1.7.0: a $0.0001 ceiling on a request estimated at $1.00 served normally at first and returned 402 on a later attempt with nothing else changed.

The failure mode is the misleading direction — you set a ceiling, send the request that should breach it, get 200, and conclude the feature is broken. Wait a minute and retry before diagnosing anything. Same shape as the poll delay on policy activation.

Budget status​

The Utilization column of the budget list shows each cap's spend in the current period as "$spend of $limit · N%" with a bar. The bar is green under the soft limit, amber at or above it, and red at the hard limit. The column refreshes every 10 seconds. A tag cap that applies to each tag value has no single spend; its cell links to that tag's spend on the Cost Dashboard instead.

Budget usage panel with spend vs limit progressBudget usage panel with spend vs limit progress
Figure 9. Budget usage panel with spend vs limit progress

Click Delete to remove a budget cap. Requires confirmation.

Which calls get a cost record​

A cost record is written when the provider reported usage and a matching price row exists. Per path:

pathusage rowcost record
ordinary callyesyes
streamingyes — exact where the provider returns a usage block, otherwise estimatedyes
cache hityes, marked HITno — no upstream call was made, so it books $0
blocked before dispatch (policy, guardrail, budget, per-call ceiling)nono
failed call — no usage returnednono
model with no price rowyesno

Served volume and upstream cost are therefore deliberately different numbers. A cache hit counts toward what you served and toward nothing you were charged; the monthly usage report splits them for exactly that reason.

Retries and provider fallback are not separate rows: a request produces at most one usage row and one cost record, attributed to the provider that actually answered.

Chargeback reports​

Open Cost → Chargeback Reports in the sidebar.

Report list​

Lists every generated chargeback report with ID, workspace, period (from–to), generated date, and generated by. Auto-refreshes every 10 seconds.

The Chargeback Reports page in its empty state — a Generate Report panel with workspace and date-range pickers above a table reading “No chargeback reports found.”The Chargeback Reports page in its empty state — a Generate Report panel with workspace and date-range pickers above a table reading “No chargeback reports found.”
Figure 10. Chargeback reports list

Generate report​

Click Generate to create a new chargeback report:

  • Workspace (optional) — a dropdown to scope the report to one workspace (All Workspaces = every workspace)
  • From / To — reporting period date range

The report includes these sections: workspace summary, API key summary, model summary, provider summary, daily breakdown, internal spend (the gateway's own calls, such as the evaluation judge, which are left out of every other figure), forecast, anomalies, and an audit drain watermark that says how complete the audit data for the period is.

From 1.8.5 the model summary, and its CSV, add input, output, cached-input, cache-write and reasoning tokens as trailing columns, so a reader keyed on column position keeps working.

Download​

  • PDF — click the PDF icon to download a formatted PDF report
  • CSV — click the CSV icon to download raw data as CSV
Chargeback report PDF — Workspace Summary, Model Breakdown, Provider Breakdown, and Daily Cost TrendChargeback report PDF — Workspace Summary, Model Breakdown, Provider Breakdown, and Daily Cost Trend
Figure 11. Generated chargeback PDF (first page). Header carries the report ID, workspace ID, period, and generation timestamp; the body lays out Workspace Summary (total cost / requests / top model), Model Breakdown (per-model cost split with avg/request), Provider Breakdown, Daily Cost Trend (one row per day in the period), and on subsequent pages the Cost Forecast (7-day + 30-day trailing) and Cost Anomalies sections. The CSV download has the same data in a flat schema.

Click Delete to remove a report. Requires confirmation.

Each report row shows its generation state, creation time, expiry time, and workspace scope. By default a report stays downloadable until you delete it. To keep reports for a set time, set dvara.flightdeck.reports.retention-days on Flightdeck (default 0, which keeps them until deleted). After that many days, PDF or CSV download returns 410 Gone, the row shows Expired, and Flightdeck deletes the report. Generate a new report for the same dates instead of reusing the expired ID. Download filenames contain safe report, workspace, date, and extension parts.

Invoice reconciliation​

From 1.14.0, Cost → Invoice Reconciliation sets a provider's bill for one month against the spend DVARA worked out for that provider and month. It shows how far apart the two are, what explains the gap, and each workspace's share of the real bill. Finance can then charge each workspace what the provider actually billed.

Only the owner and billing-admin roles can open the page. Other roles get 403. The page needs Flightdeck's database; without it, the page says so and reconciles nothing.

DVARA does not call a provider's billing API. That would need the provider's admin key, which DVARA does not hold. You upload the provider's cost export instead.

Upload a bill​

  1. Open Cost → Invoice Reconciliation. The page shows this month's computed spend by provider, and which file format each provider likely uses. Change DVARA's spend by provider in to see another month.
  2. Choose the Provider and the Month (UTC). The provider list holds the providers DVARA recorded spend for in the chosen month.
  3. Leave File format on Match the provider, or choose one yourself.
  4. Choose the Cost export (CSV) file and click Reconcile.

Flightdeck reads the whole file, keeps the rows dated in that month, saves the report and opens it.

File formatWhat to exportColumns DVARA reads
OpenAI cost exportThe usage dashboard's cost export as CSV, grouped by line item, one day at a timeA date (start_time_iso), line_item (such as gpt-4o-2024-08-06, cached input) and amount_value
Anthropic cost exportThe Console's cost export as CSVA date (usage_date_utc), model, token_type, service_tier, cost_type and the cost in dollars (cost_usd)
Generic CSVAny other bill, rewritten as four columnsdate,model,line_item,amount

Columns are found by their header name, in any order. A line's words decide what it charges for: input, cached input, cache writes, output or other. A line that says "batch", or a service_tier of batch, counts as a Batch API charge. Model names are matched without case, without a provider/ prefix and without a trailing date, so gpt-4o-2024-08-06 on the bill meets gpt-4o in DVARA.

File limits​

The file is read whole or refused whole. If any row is wrong, nothing is saved and nothing is audited, and the page names up to five bad rows by line number.

LimitValue
File size5 MB
Rows100,000
Columns64
Characters in one field1,000
Decimal places in an amount10
EncodingUTF-8 (a byte-order mark is allowed)
CurrencyUS dollars only. A currency column must say USD
DatesAn ISO date, an ISO date-time (an offset is moved to UTC), yyyy-MM-dd HH:mm or yyyy-MM-dd HH:mm:ss, or epoch seconds

Rows dated outside the chosen month are left out and counted in the report. A file with no row in the month is refused.

Read the report​

The report shows four figures at the top: Billed, DVARA computed (with the number of calls), Variance (billed minus computed) and Variance of computed as a percentage. For example, a bill of $13.90 against $13.10 computed is a variance of $0.80, which is 6.11% of computed.

Every amount is worked out exactly and shown in cents, rounded half to even. Below the totals:

  • By what is charged for. Billed, computed and variance for input, cached input, cache writes, output (reasoning included), Batch API and other charges. The rows add up exactly to both totals.
  • What explains the variance. The findings below. They overlap, so they do not add up to the variance.
  • By model. Calls, billed, computed and variance per model. A model priced at more than one price during the month is marked changed this month.
  • Each workspace's share. The true-up, described below.
FindingWhat it means
Cached input priced at the input priceThe model's price row has no cached-input rate, so DVARA priced cached tokens at the full input price. Providers charge much less for them. Add the rate on the pricing page.
Cache writes priced at the input priceThe price row has no cache-write rate, so DVARA priced cache writes at the plain input price. Providers charge more for them.
Reasoning tokensThe calls used reasoning tokens. Providers bill them as output, so they are in the output row. When the reasoning price differs from the output price, the finding says what they would cost at the output price.
Batch discountCalls went through the Batch API, or the bill has batch lines. DVARA prices batch calls at the normal rate; the finding shows the difference from the bill's batch rates.
Price changesA model was priced at more than one rate in the month. The finding also says what the month would cost at today's price table.
Estimated streamsSome calls were priced on token counts the gateway estimated: streams cut off before the provider sent usage. The bill has the true counts.
Billed, not seen by DVARAThe bill charges models DVARA has no calls for. Those calls did not go through DVARA, or the model names do not match.
Seen by DVARA, not billedDVARA computed spend for models the bill does not name.
Charges that are not tokensThe bill charges for things other than tokens, such as web search, tools or storage. DVARA does not price these.

A served call with no price writes no cost record, so it shows only as variance. See Models served with no price.

Share the bill over workspaces​

The true-up splits the real bill over the workspaces that caused it:

  • Each model's billed amount is shared over the workspaces that used that model, by their computed spend on it.
  • A billed line for a model DVARA has no spend on, or a line with no model, is shared by each workspace's total computed spend.
  • Shares are rounded to the cent so that they add up to the billed total. The cents left over go to the workspaces with the largest remainders. A tie goes to the workspace whose id sorts first.

If DVARA has no spend for the provider in that month, there is nothing to share the bill by, and the report says so.

Click Workspace shares (CSV) to download the shares for chargeback. The file is named true-up-<provider>-<month>.csv and has these columns: workspace_id,workspace,computed_usd,true_up_usd,adjustment_usd.

Compute again after late cost records​

Cost records for a month can reach Flightdeck after you reconciled it. Open the saved report and click Compute again. Flightdeck sets the saved bill lines against today's cost records and prices, and saves the new figures. You do not upload the file again.

Click Delete to remove a report. The upload stays in the audit log.

ActionAudit event
Upload a billINVOICE_RECONCILED, with the provider, month, format, file name, the file's SHA-256, the billed, computed and variance totals, the rows read and the rows outside the month
Compute againINVOICE_RECONCILIATION_RECOMPUTED, with the same fields and the previous computed total
Delete a reportINVOICE_RECONCILIATION_DELETED, with the same fields as they were when deleted

A refused file writes no audit event.

Compliance reports​

Open Governance → Compliance in the sidebar.

Report list​

Lists every compliance report with ID, type (SOC2 / HIPAA / GDPR / RBI / SEBI), workspace, period, generated date, and actions. Auto-refreshes every 10 seconds. Use the Type and Workspace dropdown filters to narrow the list.

The Compliance Reports page in its empty state, with a Generate Report panel offering SOC2, HIPAA, GDPR and India RBI / SEBI report types above a table reading “No compliance reports generated”The Compliance Reports page in its empty state, with a Generate Report panel offering SOC2, HIPAA, GDPR and India RBI / SEBI report types above a table reading “No compliance reports generated”
Figure 12. Compliance reports list

Generate report​

Click Generate to create a new compliance report:

  • Type — SOC2 Type II, HIPAA, GDPR, or India RBI / SEBI
  • Workspace (optional) — a dropdown to scope the report to one workspace (All Workspaces = every workspace)
  • From / To — reporting period date range

Report contents by type:

SOC2HIPAAGDPR
Audit chain integrityAccess logData processing activities
Access control summaryAuthorization logWorkspace data residency
Policy enforcement summaryPolicy violationsConsent and policy status
Data residencyData access patternsData retention
Token usage summaryAudit integrityAudit integrity
Event count by typePHI handled
Human approvals
Erasure
Tool activity

Every report type also includes MCP credential changes, A2A governance activity and A2A audit-chain integrity (when the A2A plane is set up), and an audit drain watermark that says how complete the audit data for the window is.

The India RBI and SEBI reports share a common section set — data localization (residency), tamper-evident audit-chain integrity, access control, policy enforcement, and token usage — with regulator-specific framing (RBI emphasizes data localization; SEBI emphasizes recordkeeping and audit trail). Scheduled generation is configured via dvara.flightdeck.compliance.rbi-schedule / .sebi-schedule.

Access-control totals include the built-in and SAML LOGIN_SUCCESS / LOGIN_FAILED events and the SSO AUTHENTICATION_SUCCESS / AUTHENTICATION_FAILURE pair. The report identifies the event source it counted. When you select a workspace, every event total is limited to that workspace; the GDPR total is not a platform-wide number.

Compliance generate form — a report-type dropdown (SOC2, HIPAA, GDPR, India RBI and SEBI), a workspace filter, and From/To date pickersCompliance generate form — a report-type dropdown (SOC2, HIPAA, GDPR, India RBI and SEBI), a workspace filter, and From/To date pickers
Figure 13. Generating a compliance report. The type selection drives which audit-event categories are aggregated (per the table above); workspace + date range scope the evidence window. The report includes the audit-chain integrity check for the window.

Click the PDF icon to download the compliance report as a formatted PDF. Click Delete to remove a report (requires confirmation).

Compliance reports follow the same retention rule. By default they stay downloadable until you delete them. When dvara.flightdeck.reports.retention-days is set, the list marks a report Completed while it can be downloaded and Expired after that many days. An expired download returns 410 Gone, and Flightdeck then deletes the report; generate it again for the original evidence window. Report IDs remain workspace-scoped, and filenames use safe type, workspace, and date parts.