> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/relay/llms.txt.
> For full documentation content, see https://docs.nvidia.com/nemo/relay/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# Module pricing

> Data-driven LLM model pricing used to layer cost estimates onto usage.

Generated from `cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi`.

Data-driven LLM model pricing used to layer cost estimates onto usage.

Pricing is deliberately separate from response normalization so adding providers, aliases, or cache-accounting rules does not require editing [`AnnotatedLlmResponse`](/reference/api/rust-library-reference/nemo-relay/codec/response/struct-annotatedllmresponse).

## Structs

* [ModelPricing](/reference/api/rust-library-reference/nemo-relay/codec/pricing/struct-modelpricing): Per-token pricing for a model, expressed in USD per one million tokens.
* [PricingCatalog](/reference/api/rust-library-reference/nemo-relay/codec/pricing/struct-pricingcatalog): Collection of model pricing entries.
* [PricingConfig](/reference/api/rust-library-reference/nemo-relay/codec/pricing/struct-pricingconfig): Runtime pricing resolver configuration.
* [PricingResolver](/reference/api/rust-library-reference/nemo-relay/codec/pricing/struct-pricingresolver): Ordered pricing lookup chain.
* [PromptCachePricing](/reference/api/rust-library-reference/nemo-relay/codec/pricing/struct-promptcachepricing): Prompt-cache accounting rules for a model pricing entry.
* [TokenPricingRates](/reference/api/rust-library-reference/nemo-relay/codec/pricing/struct-tokenpricingrates): Token rates expressed as USD per one million tokens.
* [TokenRateTier](/reference/api/rust-library-reference/nemo-relay/codec/pricing/struct-tokenratetier): A token pricing tier selected by prompt/input token count.

## Enums

* [CacheReadAccounting](/reference/api/rust-library-reference/nemo-relay/codec/pricing/enum-cachereadaccounting): How cache-read tokens relate to prompt token counts in provider usage.
* [PricingCatalogError](/reference/api/rust-library-reference/nemo-relay/codec/pricing/enum-pricingcatalogerror): Errors produced while parsing or validating a pricing catalog.
* [PricingSourceConfig](/reference/api/rust-library-reference/nemo-relay/codec/pricing/enum-pricingsourceconfig): Declarative pricing source supported by Relay configuration.
* [PricingUnit](/reference/api/rust-library-reference/nemo-relay/codec/pricing/enum-pricingunit): Billing unit represented by a pricing entry.
* [RateScheduleApplication](/reference/api/rust-library-reference/nemo-relay/codec/pricing/enum-ratescheduleapplication): How a selected rate-schedule tier applies to billable usage.
* [TokenRateSchedule](/reference/api/rust-library-reference/nemo-relay/codec/pricing/enum-tokenrateschedule): Data-driven token rate schedule for provider pricing with request thresholds.

## Traits

* [PricingSource](/reference/api/rust-library-reference/nemo-relay/codec/pricing/trait-pricingsource): Pluggable pricing source interface.

## Functions

* [active\_pricing\_resolver](/reference/api/rust-library-reference/nemo-relay/codec/pricing/fn-active-pricing-resolver): Returns the active process-wide pricing resolver.
* [attach\_estimated\_cost](/reference/api/rust-library-reference/nemo-relay/codec/pricing/fn-attach-estimated-cost): Adds a model-pricing estimate to a normalized response when cost is missing.
* [attach\_estimated\_cost\_for\_provider](/reference/api/rust-library-reference/nemo-relay/codec/pricing/fn-attach-estimated-cost-for-provider): Adds a provider-aware model-pricing estimate to a normalized response when cost is missing.
* [estimate\_cost](/reference/api/rust-library-reference/nemo-relay/codec/pricing/fn-estimate-cost): Estimates USD cost for a model/usage pair when pricing is known.
* [estimate\_cost\_for\_provider](/reference/api/rust-library-reference/nemo-relay/codec/pricing/fn-estimate-cost-for-provider): Estimates USD cost for a provider/model pair when pricing is known.
* [estimate\_cost\_with\_catalog](/reference/api/rust-library-reference/nemo-relay/codec/pricing/fn-estimate-cost-with-catalog): Estimates USD cost using the provided catalog.
* [estimate\_cost\_with\_provider](/reference/api/rust-library-reference/nemo-relay/codec/pricing/fn-estimate-cost-with-provider): Estimates USD cost using the provided catalog and provider/model pair.
* [infer\_model\_provider](/reference/api/rust-library-reference/nemo-relay/codec/pricing/fn-infer-model-provider): Infers a provider/route value for a decoded model.
* [pricing\_for\_model](/reference/api/rust-library-reference/nemo-relay/codec/pricing/fn-pricing-for-model): Returns known pricing for a model ID.
* [pricing\_for\_provider](/reference/api/rust-library-reference/nemo-relay/codec/pricing/fn-pricing-for-provider): Returns known pricing for a provider/model pair.
* [reset\_active\_pricing\_resolver](/reference/api/rust-library-reference/nemo-relay/codec/pricing/fn-reset-active-pricing-resolver): Restores the active process-wide pricing resolver to an empty resolver.
* [set\_active\_pricing\_resolver](/reference/api/rust-library-reference/nemo-relay/codec/pricing/fn-set-active-pricing-resolver): Replaces the active process-wide pricing resolver.