How Aixy chooses the cost
The default Hybrid strategy follows this order for each observed upstream attempt:- Provider response: accept a valid per-request USD amount only from the response field trusted by the effective provider credential’s cost contract. Token counts alone are not a reported cost.
- Price book: select an effective organization rule first, then a platform rule. Use its rates with the observed usage. The price book is optional; a matching rule takes priority over catalogs.
- Provider catalog: use a versioned reference price from an implemented provider pricing source. Aixy currently has dedicated sources for regional Amazon Bedrock public offers and the native Charm Hyper catalog at reviewed Hyper endpoints.
- models.dev: use the provider/model entry in the shared metadata catalog when no provider reference price is available. Coverage and rate dimensions depend on that entry.
partial. Catalog sources use persisted
versions and caches; Aixy does not make a live price request for every inference.
The same rule applies between reference sources: a provider price with missing cache rates is not
completed using models.dev. Once a provider-catalog version exists for a target, a temporary source
outage retains it instead of replacing it with a models.dev estimate.
Read the amount and its evidence together
Source and status answer different questions.
official means the rate came from a platform
price-book entry labelled official; its calculated cost is still estimated. A provider-catalog
rate is also estimated, despite coming directly from the provider. A response amount observed on an
incomplete request retains source provider_response with status partial.
An explicit zero rate or response amount is valid. A blank rate, absent token count, missing amount,
or unavailable analytics source is not evidence of zero cost. Even a partial amount of zero must be
read with its status. Positive dashboard totals below one cent display as less than $0.01;
decimal amounts remain available for aggregation and request investigation.
Configure the provider cost contract
Open Providers, choose the organization or project connection, and use its credential row’s pencil to open Edit provider, then review Cost tracking. You can save cost changes while keeping the saved credential, or use Replace credential to update both together. These settings also appear when adding a provider. Configure the credential marked Effective for the traffic you want to measure: a project credential overrides the organization’s credential and uses its own cost contract. Owners and Org admins can manage organization connections and project connections. Project admins can change connections only in their assigned projects. Saving increments the cost-contract version without requiring a replacement provider secret.Select the strategy
Let Aixy manage response formats
New credentials use Automatic for cost extraction and streaming usage. Choose your attribution strategy; Aixy handles the protocol details. Provider-reported only can be saved before any requests have run. Requests without a valid reported amount remain unattributed in that mode. Aixy validates cost evidence in each response. Reviewed provider contracts recognize formats such as OpenRouter’susage.cost and the reviewed Charm Hyper endpoints’ usage.cost.usd. On unknown
endpoints, automatic extraction accepts the supported usage.cost.usd shape, which explicitly
denominates the request amount in USD. A scalar cost field alone is ambiguous and is ignored.
Negative, non-finite, malformed, or missing amounts are ignored; an explicit valid zero is retained.
Aixy does not convert currencies or execute arbitrary JSONPath expressions.
Automatic streaming settings request final usage on providers known to support it. Other protocols
retain their native usage handling. Unknown endpoints are observed without adding an unverified
streaming parameter, making probe calls, or retrying billable requests. A missing usage field in one
response does not establish that a provider never supports it.
The form describes the configured behavior. Activity shows actual cost, source, token usage, and
coverage after requests run. No response is validated merely by saving the credential. Missing
terminal evidence, malformed usage, interruptions, and client cancellation can leave accounting
partial even when the client receives useful output. See Stream responses.
Advanced protocol settings
Existing credentials keep their saved settings. Select Use automatic settings in the credential’s cost configuration to adopt automatic handling without replacing the secret. For a custom integration, expand Advanced protocol settings to override cost extraction or streaming usage. Selectusage.cost or usage.cost.usd only after confirming that it is a per-request
USD amount. Ignore provider cost amounts disables response amounts; with Provider-reported only,
that leaves requests unattributed. Request OpenAI final usage adds stream_options.include_usage
for Chat Completions streams. Do not add a usage request leaves client-supplied parameters and
native protocol usage handling unchanged. Overrides do not create evidence a provider never returns.
Configure the price book
Use an explicit price when you have negotiated rates, a private or custom connection, an uncovered model, or public rates that do not describe your billing terms. Automatic estimates do not require a manual price entry. Discover the connection’s models or use Playground pricing preparation to make its reference prices available to native inference. Model details shows a compact Concept / Price / Origin table for the connection’s default request context. When a Price Book rule applies, its prices appear as Override in Aixy, with the rule’s scope and version. Otherwise, the origin identifies the provider catalog or models.dev. An override selects the whole tariff: an absent rate remains missing, rather than being silently filled from a public catalog. Private override amounts require Price Book read access. The dialog warns when missing required prices prevent hard-budget admission, including a missing write tariff for the connection’s configured cache duration. It lists the missing concepts even when no hard budget is enabled yet. Loading or failed checks are shown separately. This checks pricing coverage for the displayed context; admission checks the final request again. Each cache-write duration appears once. Use the tariff for the observed duration; there is no additional generic write tariff to add to it. In Cost Center → Price Book, choose Add custom price. Owners and Org admins can create organization rules and deactivate them; Project admins can inspect the price book but cannot edit it. Platform rules are maintained by the Aixy operator and cannot be edited from an organization’s price book.- Provider: enter the canonical Aixy provider identifier, such as
openaiorbedrock-runtime. - Model or prefix: enter the exact upstream model ID, preferably a versioned ID. For a gateway
model
bedrock-runtime/openai.gpt-oss-120b-1:0, use providerbedrock-runtimeand modelopenai.gpt-oss-120b-1:0. Use the actual upstream target rather than a virtual routing name. A single trailing*matches a prefix; other wildcard forms are unsupported. - Service tier: leave blank for a rule that can match any tier, or enter the exact named tier whose rates you reviewed. Nondefault tiers need an exact tier rule for hard-budget admission.
- Token rates: enter USD per one million tokens, separately for uncached input, cache reads, each cache-write duration, and output. Do not paste a per-token or per-thousand-token rate without converting its units. Leave an unknown rate blank; enter zero only when that category is known to be free. For cache reads/writes, use Charged at the input rate only when those tokens are billed at the input price; use Not applicable to this model only when that token class cannot occur. These declarations need an exact model ID and supporting evidence URL.
- Per-request charge: optionally add a flat USD charge per matched upstream attempt. It is additional to this rule’s token calculation, not a percentage or markup on reported cost.
- Additional usage: add a meter and its USD price per unit when the provider bills work
separately from tokens. For example,
web_search_requestsidentifies reported web searches; a rate of0.01means one cent for each search. An absent rate is unknown; enter zero only when that unit is known to be free. Adding a price does not grant support for an unreviewed tool. - Price source and Evidence URL: select Provider contract for negotiated terms or Manual operating estimate for other operating rates. Retain an HTTPS link to the supporting evidence; do not put credentials in the URL. Then select Create price version.
Understand matching and replacements
Only rules effective at the upstream attempt’s start time are eligible. Among matching rules, the resolver prioritizes, in order:- Organization scope over platform scope.
- An exact service-tier match over a rule with no tier restriction.
- An exact model over a prefix, then a longer matching prefix over a shorter one.
- The later effective start if the preceding criteria tie.
standard tier. An explicitly named tier matches only that value.
Create another price with the same provider, model pattern, and tier to replace an organization
rule. Aixy appends a version and closes the earlier effective window. The dashboard uses the save
time. A new version must start after the latest version for that same scope. Deactivating a rule
stops future matches and may expose a lower-priority rule or reference fallback. Neither operation recalculates
costs already emitted.
Example calculation
These are illustrative rates, not a provider quotation. Assume a complete response reports 750 uncached input tokens, 250 cache-read tokens, 100 five-minute cache-write tokens, and 100 output tokens:
The calculation is
sum(tokens × rate / 1,000,000) + sum(additional units × unit rate) + per-request charge,
using decimal arithmetic. The example above contains no separately billed units. If the same response
also reported two searches priced at 0.01 each, the total would be $0.02385 estimated.
Aixy normalizes supported token formats so cached input is not charged again as uncached input.
Reasoning counts are retained when reported; the price book has no separate reasoning-rate field.
Confirm whether reasoning is already included in the provider’s output billing.
If the cache-write rate were missing, the calculable amount would be $0.00335 partial**; Aixy would
not fill that rate from a catalog. If Hybrid instead received a trusted USD amount of `0.004` on a
complete response, it would record **$0.004 provider_reported, without adding the rule’s charges.
Automatic reference prices and history
Reference estimates are stored separately from the editable price book. Their history is keyed by the exact provider, model, and a fingerprint of the connection endpoint. Regional or custom connections therefore do not share price versions accidentally. This isolation preserves which source was used; it does not establish that a generic public price matches a private contract. Bedrock’s source selects supported public on-demand token rates for the configured region, including cache writes with an explicit supported duration. Charm Hyper’s native source supplies input, output and cache-read rates for reviewed Hyper endpoints. A write quote without duration metadata does not establish a TTL-specific price. If a dedicated source is absent or has no price, Aixy consults models.dev, including itsamazon-bedrock alias for Aixy’s bedrock-runtime provider.
These public lookups do not require tenant billing credentials or send inference keys to catalogs.
Prices fetched during model discovery are persisted for the same connection endpoint and model,
so future hard-budget checks and Activity costs can use them without a Playground request. Native
inference picks up prepared prices during its background configuration refresh, normally within
one minute. Existing interactions retain their recorded attribution.
Active targets become eligible for refresh after six hours, driven by model discovery,
usage enrichment, hard-budget preparation, or Playground preparation. Previously watched targets are also refreshed
in the background after expiry. Repeated manual refreshes are bounded to protect source availability.
Unchanged rates and provenance retain the same version; changes append a version. Failed refreshes
retry after a short delay, normally one minute, while retaining the last known estimate. A stale
source cache does not count as a fresh confirmation.
The first observation establishes an estimation baseline that can cover the request which caused
it to be fetched. It is not proof of what the provider charged before observation. Later versions
start at their source observation time because these catalogs do not provide a reliable historical
change date. Attribution selects the version effective when the upstream attempt started, including
streams that finish after a price change. Events before the initial baseline can remain
unattributed, and already emitted events are not repriced with today’s catalog.
Automatic references use the available base token rates even when a catalog mentions context
tiers or separately priced reasoning. These amounts are marked partial because the flattened
reference cannot price every charge. Nonstandard service tiers still need a matching explicit rule.
An explicit rule does not add support for arbitrary meters. Reviewed web-search counters use the
applicable per-unit tariff alongside token prices. Observed audio charges, unpriced or unreviewed
server-side tools, and cache writes without an exact-duration tariff can make rate-based accounting partial. Public estimates do not establish private
discounts, credits, taxes, or charges for work absent from the observed usage.
Pricing persistence, catalog requests, and ordinary usage enrichment run outside model forwarding.
Reports update asynchronously. Catalog or management database availability is not a synchronous
dependency of ordinary inference; hard-budget admission has additional requirements below.
Prices and hard budgets
A response amount arrives too late to authorize spend. Before calling a provider, a hard budget needs a reservation based on an explicit rule or a prepared reference price, even when the credential normally uses provider-reported cost. A monitor budget reports usage and warnings without blocking requests. Price Book, provider-catalog and models.dev rates are sufficient for estimated enforcement; a final provider price or invoice is not required. A hard budget caps spend calculated from those rates and the request bounds. Public rates, cache assumptions and omitted tier or reasoning charges can differ from the provider’s final bill. Use an explicit price when your billing terms require different rates.- Provide input/output rates, plus a positive output-token bound
such as
max_tokens,max_completion_tokens, ormax_output_tokens. When several bounds are supplied, all must be valid and the largest is used. Chat Completions and Responses requests that Aixy translates to Anthropic Messages may omit the bound: Aixy sendsmax_tokens: 4096upstream and reserves that value. - A missing cache-read rate uses the input rate for the reservation. Cache-write rates are required when the connection or request enables cache writes. Enter a separate rate or an evidence-backed billing declaration when known. Declarations require an exact model ID and an evidence URL. Cache-write prices are matched to their exact duration. Prepared models.dev v2 references preserve separate duration tariffs, including one-hour writes when published. Missing metadata does not imply that cache work is free. Without a selected duration, reservations include the highest known cache-write tariff; settlement uses observed durations. Observed cache tokens without a known rate or valid declaration leave the calculated cost partial and retain the reservation.
- Reference prices not confirmed within 24 hours cannot authorize new spend. They can still
support historical estimates. A cold or stale target can return
model_pricing_warmingbefore any upstream call. Prepare its prices through model discovery or Playground and allow the background native snapshot refresh to complete before retrying. An explicit complete rule avoids catalog preparation. - Input admission follows reviewed provider contracts. Native Anthropic Messages and verified
Bedrock Messages support images and opaque native input, including PDFs, URLs and file references.
When a tighter local bound is unavailable, the versioned native input contract reserves the full
current API context ceiling of 1,000,000 input tokens, at the highest applicable input/cache
rate. Admission uses the smaller valid bound for text and reviewed images, including large
base64 encodings. Plain client tool declarations, such as Claude Code’s tools, reserve the
encoded request size plus a reviewed allowance of 1,024 input tokens for the provider’s
tool-use prompt, capped at that ceiling. Typed native client tools (bash, text editor, computer
and browser) and opaque content keep the full ceiling. The output limit, such as
Claude Code’s large
max_tokens, is always reserved in full. This can require substantially more budget headroom than the eventual usage. Other provider meters need their own reviewed contract. - A context ceiling covers input for one sampling pass. New server-side compaction, provider tools, stored conversation references, multiple candidates, and cache writes without applicable prices remain unsupported when their complete work cannot be bounded. Existing thinking or compaction blocks are native input; they do not authorize new compaction or tool work.
Hard-budget refusals
A request refused under a hard budget is never sent to the provider. Onlyhard_budget_exceeded
(HTTP 402) means the allowance cannot cover the request. Every other refusal says that it is not a
budget limit, what Aixy could not process and who acts. The error details carry a category and
an action_owner (client, budget_administrator, organization_administrator, aixy or
retry). On Anthropic Messages routes these details are returned with the error.
When a root request field has not been reviewed, for example a field added by a new client
release, the message names it and
details.field carries it. Only short ASCII identifiers
(A-Z, a-z, 0-9, _, up to 64 characters) are named; field values and nested keys are never
returned. Report the request ID to Aixy: changing the budget does not admit the request.
Earlier releases returned these refusals with hard_budget_ codes. Activity still explains
historical events that use them.
Provider-hosted web search
Reviewed WebSearch requests on the native Anthropic Messages connection can use hard budgets and TPM limits. The request must supply a positive finitemax_uses and a supported tool definition;
unknown versions or execution controls remain unsupported. A custom endpoint’s native input
setting and Bedrock Messages input support do not grant provider-hosted search support.
Complete token prices and a web_search_requests price per unit are required for financial
admission. Prepared reference prices can supply that rate when the source publishes it. If an
explicit Price Book rule applies, include the unit rate in that rule: missing override prices are
not filled from a reference tariff. Follow Anthropic’s search billing documentation
when reviewing your terms.
Search can add billable input and internal sampling passes. Aixy uses Anthropic’s published default
of ten server-side iterations, reserving ten full native input contexts and, conservatively, ten
output-token limits, plus the maximum search fees. With the current native context ceiling, that
can reserve 10,000,000 input tokens before output and unit charges. The remaining hard budget
and any TPM allowance must cover that conservative maximum even when the final search costs only
a few cents. max_uses limits searches; it does not bound every internal sampling pass by itself.
Complete observed usage replaces the reservation with the applicable token and search charges.
Without a complete provider-reported monetary receipt, missing final search counters, unsupported
usage and interrupted responses retain conservative liability. A stream’s initial zero is not
proof of zero final search usage. Continuing a
pause_turn response requires a new admitted request. Aixy preserves accepted native payloads and
does not insert a search limit on the client’s behalf.
Search on other providers
Several providers bill each provider-run search separately from tokens. Aixy records all of them with the sameweb_search_requests unit, so one per-unit price covers the provider’s search fee
regardless of the tool name the request used:
- Anthropic-compatible connections report
usage.server_tool_use.web_search_requests. - OpenAI Responses reports each search as a
web_search_calloutput item. Aixy counts completed calls, including in streamed responses. A call that is still running, failed or incomplete has no documented billing rule, so the cost stays partial instead of assuming either a charge or zero. See OpenAI’s search pricing. - Server-tool counters Aixy has not mapped to a unit, such as
server_side_tool_usage_details, keep the cost partial when they report usage; they are never priced as free.
max_tool_calls but no API-wide input ceiling for the passes a search adds,
so OpenAI search requests remain unsupported under hard budgets and TPM limits.
When a custom price applies to an exact model, the Price Book editor names the per-unit reference
rates that price does not include and can copy them in one action.
For hosted search, combined input counts above a reference tariff’s first context-length threshold
may not reveal the price of each internal sampling pass. Aixy marks that cost partial and retains
the reservation, including for failed searches with zero billable search requests. Aggregate input
at or below that threshold, flat Price Book prices, or a complete monetary receipt can establish
settled charges.
Reservations use a conservative request-size and output-limit bound, rounded up to micro-USD; they
can exceed the eventual token-based cost. Each applicable hard limit must have enough capacity.
Complete accounting can replace the reservation with the attributed amount. Incomplete or missing
accounting retains conservative liability; a timeout does not make uncertain spend free. Disabling
cost attribution does not disable hard budgets or prevent reservations from remaining unresolved.
Routing fallbacks can run several upstream attempts, each with its own provider, model, price and
usage evidence. Reporting counts observed attempts, not unique prompts. The budget reserves for
possible attempts and retains a conservative total when multiple attempts run. Do not compare one
successful completion’s cost with the whole routed request’s reservation as if they were equivalent.
See Routing.
Resolve a Playground pricing warning
The Playground checks price coverage when you select a model, key or protocol. It checks all potential targets of a routing model. This does not invoke the provider or reserve budget. The final request still goes through normal admission, including balance and supported-input checks. If prices are incomplete, the notice identifies the model, missing billing information and source. Use Recheck prices after a source update or configuration change. Your message remains in place. Pricing administrators can choose Complete pricing to open Price Book in another tab. Known rates are loaded when available; review them, fill the missing rates or documented cache billing declarations, and save the new version. Return to the Playground and recheck. Members without pricing permission can select another model or ask an administrator to complete the entry. An absent cache-write price does not prove there is no cache-write charge. Explicitly enabled cache writes still need a rate or billing declaration. Ordinary bounded text requests can use input/output estimates without complete optional cache metadata. Context tiers and separately priced reasoning keep the resulting cost marked partial. Do not fill invented zero prices. Actual hard-budget admission rejections are recorded in Activity with their request ID, zero upstream attempts and zero provider cost. A price-coverage check itself is not a model request.Verify configuration and investigate gaps
Assign or correct an interaction’s estimated price
- In Cost Center → Cost quality, select an unattributed reason to open the matching interactions in Activity, then open an interaction.
- As an Owner or Org admin, select Assign price, or Correct price on an existing estimate. Choose a Price Book version for the exact recorded provider and model. Historical versions are available; the recorded service tier must be compatible. If no version is available, add an exact-model price in Price Book first.
- Review the USD preview calculated from recorded tokens and cache usage, then save. Missing
tokens cannot be recovered by choosing a price. Incomplete evidence or uncovered charges keep
the amount marked
partial. - Check the assigned amount and selected price version in Activity and the updated totals and coverage in Cost Center → Cost quality. Analytics may take a short time to reflect a saved assignment.
Check attribution coverage
Before relying on totals or enabling a hard budget:- Confirm the effective credential, strategy, trusted response field, upstream model ID, connection region, and service tier.
- Send bounded ordinary and streaming test requests. Exercise cache reads/writes and routing fallbacks if your application uses them.
- In Activity, open each attempt’s Cost attribution details. Review Amount, Evidence, Source, Pricing rule and Contract. Reference estimates also use the pricing-rule ID and version fields; their absence from the editable price book is expected.
- Check the arithmetic against observed token categories and the correct rates, then review attribution coverage in Cost Center → Cost quality. Include partial and unattributed counts when assessing spend, rather than relying only on the displayed total.
- For hard budgets, verify admission and settlement separately. Prepare pricing before sending production traffic and confirm that completed test requests release excess reservation capacity.
Customer telemetry exports carry the amount, status, source, rule version,
cost-contract version, attribution mode and unattributed reason when applicable. Retain this
provenance with exported usage. Organization, project, team, user and API-key totals are different
views of the same events; adding those views together double-counts spend. Dashboard totals cover
retained analytics, so retain a separate export for accounting periods longer than your retention.