For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • About NVIDIA NeMo Relay
    • Overview
    • Architecture
    • Ecosystem
    • Concepts
    • Release Notes
  • Getting Started
    • Agent Runtime Primer
    • Prerequisites
    • Installation
    • Configuration / Setup
    • Quick Start
  • NVIDIA NeMo Relay CLI
    • About
    • Basic Usage
    • Claude Code
    • Codex
    • Cursor
    • Hermes Agent
  • Supported Integrations
    • About
    • OpenClaw Plugin Guide
    • LangChain Integration Guide
    • LangGraph Integration Guide
    • Deep Agents Integration Guide
  • Instrument Applications
    • About
    • Adding Scopes and Marks
    • Instrument a Tool Call
    • Instrument an LLM Call
    • Add Middleware
    • Code Examples
  • Observability Plugin
    • About
    • Configuration
    • Agent Trajectory Interchange Format (ATIF)
    • Agent Trajectory Observability Format (ATOF)
    • OpenTelemetry
    • OpenInference
  • Adaptive Plugin
    • About
    • Configuration
    • Adaptive Cache Governor (ACG)
    • Adaptive Hints
  • NeMo Guardrails Plugin
    • About
    • Configuration
  • Integrate into Frameworks
    • About
    • Adding Scopes
    • Wrap Tool Calls
    • Wrap LLM Calls
    • Handle Non-Serializable Data
    • Using Codecs
    • Provider Codecs
    • Provider Response Codecs
    • Code Examples
  • Build Plugins
    • About
    • Define a Plugin
    • Validate Plugin Configuration
    • Plugin Configuration Files
    • Register Plugin Behavior
    • Design Plugin Configuration
    • NeMo Guardrails Example Plugin
    • Code Examples
  • Contribute
    • About
    • Development Setup
    • Workflow and Reviews
    • Testing and Documentation
  • Reference
    • APIs
      • Python Library Reference
      • Node.js Library Reference
      • Rust Library Reference
        • nemo-relay
          • api
          • codec
            • anthropic
            • openai_chat
            • openai_responses
            • pricing
            • request
            • response
              • AnnotatedLlmResponse
              • CostEstimate
              • ResponseToolCall
              • Usage
              • ApiSpecificResponse
              • CostSource
              • FinishReason
            • streaming
            • traits
          • config_editor
          • error
          • json
          • observability
          • plugin
          • plugins
          • stream
          • editor_config
        • nemo-relay-adaptive
        • nemo-relay-ffi
    • Performance
  • Resources
    • Support and FAQs
    • Glossary
    • Troubleshooting Guide
    • Community
    • Legal
NVIDIANVIDIA
Developer-friendly docs for your API
Privacy Policy | Your Privacy Choices | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2026, NVIDIA Corporation.

LogoLogo
On this page
  • Fields
  • total: Option<f64>
  • currency: String
  • input: Option<f64>
  • output: Option<f64>
  • cache_read: Option<f64>
  • cache_write: Option<f64>
  • source: CostSource
  • pricing_provider: Option<String>
  • pricing_model: Option<String>
  • pricing_as_of: Option<String>
  • pricing_source: Option<String>
  • Implementations
  • impl CostEstimate
  • total_or_component_sum
  • total_for_currency
  • total_or_component_sum_for_currency
  • Trait Implementations
  • impl Clone for CostEstimate
  • clone
  • clone_from
  • impl Debug for CostEstimate
  • fmt
  • impl<'de> Deserialize<'de> for CostEstimate
  • deserialize
  • impl PartialEq for CostEstimate
  • eq
  • ne
  • impl Serialize for CostEstimate
  • serialize
  • impl StructuralPartialEq for CostEstimate
ReferenceAPIsRust Library Referencenemo-relaycodecresponse

Struct Cost Estimate

||View as Markdown|
Previous

Struct Annotated LlmResponse

Next

Struct Response Tool Call

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

pub struct CostEstimate {
    pub total: Option<f64>,
    pub currency: String,
    pub input: Option<f64>,
    pub output: Option<f64>,
    pub cache_read: Option<f64>,
    pub cache_write: Option<f64>,
    pub source: CostSource,
    pub pricing_provider: Option<String>,
    pub pricing_model: Option<String>,
    pub pricing_as_of: Option<String>,
    pub pricing_source: Option<String>,
}

Normalized LLM response cost.

Provider-reported cost is preserved as-is. Model-pricing estimates include source and as-of metadata so downstream systems can audit stale pricing tables without losing a usable estimate.

Fields

total: Option<f64>

Total cost in currency.

currency: String

ISO 4217 currency code for the cost fields.

input: Option<f64>

Uncached prompt/input token cost in currency.

output: Option<f64>

Completion/output token cost in currency.

cache_read: Option<f64>

Prompt cache read cost in currency.

cache_write: Option<f64>

Prompt cache write cost in currency.

source: CostSource

Origin of this cost value.

pricing_provider: Option<String>

Provider associated with the cost or pricing estimate, if known.

pricing_model: Option<String>

Model ID associated with the cost or pricing estimate, if known.

pricing_as_of: Option<String>

Date the pricing value was last verified, if known.

pricing_source: Option<String>

Source URL or label for the pricing value, if known.

Implementations

impl CostEstimate

impl CostEstimate

total_or_component_sum

pub fn total_or_component_sum(&self) -> Option<f64>

Returns the explicit total, or the sum of component costs when no total was supplied.

total_for_currency

pub fn total_for_currency(&self, currency: &str) -> Option<f64>

Returns the total only when it is denominated in the requested currency.

total_or_component_sum_for_currency

pub fn total_or_component_sum_for_currency(&self, currency: &str) -> Option<f64>

Returns the explicit or component-derived total in the requested currency.

Trait Implementations

impl Clone for CostEstimate

impl Clone for CostEstimate

clone

fn clone(&self) -> CostEstimate

clone_from

fn clone_from(&mut self, source: &Self)

impl Debug for CostEstimate

impl Debug for CostEstimate

fmt

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<'de> Deserialize<'de> for CostEstimate

impl<'de> Deserialize<'de> for CostEstimate

deserialize

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,

impl PartialEq for CostEstimate

impl PartialEq for CostEstimate

eq

fn eq(&self, other: &CostEstimate) -> bool

ne

fn ne(&self, other: &Rhs) -> bool

impl Serialize for CostEstimate

impl Serialize for CostEstimate

serialize

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
    __S: Serializer,

impl StructuralPartialEq for CostEstimate

impl StructuralPartialEq for CostEstimate