> For clean Markdown of any page, append .md to the page URL. For a task-oriented documentation index, fetch https://docs.nvidia.com/nemo/relay/llms.txt. Use the documentation version matching the installed NeMo Relay package: latest follows the latest stable release, vX.Y.Z identifies a retained release snapshot, and dev documents development changes. Preserve the selected version when following links; do not mix examples or API contracts from different versions. Fetch the relevant section's /llms.txt before individual pages instead of loading a complete version index. # Module codec > Normalized LLM request and response data types. Shared normalized LLM request and response data types. Generated from `cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker`. Normalized LLM request and response data types. Shared normalized LLM request and response data types. ## Modules * [billing](/reference/api/rust-library-reference/nemo-relay/codec/billing): Checked provider token accounting and billing data. Provider token accounting contracts and checked usage arithmetic. * [content](/reference/api/rust-library-reference/nemo-relay/codec/content): Typed content traversal, shared selection, and owned transport snapshots. Borrowed access to normalized message content. * [identity](/reference/api/rust-library-reference/nemo-relay/codec/identity): Stable LLM codec identities shared across SDK boundaries. Stable LLM codec identities shared across Relay runtime and SDK boundaries. * [normalization](/reference/api/rust-library-reference/nemo-relay/codec/normalization): Runtime-supplied provider normalization. Provider normalization supplied by a runtime or embedding application. * [optimization](/reference/api/rust-library-reference/nemo-relay/codec/optimization): Plugin-neutral LLM optimization evidence and summaries. Plugin-neutral evidence and summaries for LLM optimizations. * [pricing](/reference/api/rust-library-reference/nemo-relay/codec/pricing): Runtime-neutral cost estimation contract. Price estimation supplied independently from runtime execution. * [redaction](/reference/api/rust-library-reference/nemo-relay/codec/redaction): Opt-in source-aware editing and clean sanitized projection. Opt-in provider editing and clean projection, independent of PII policy. * [request](/reference/api/rust-library-reference/nemo-relay/codec/request): Normalized LLM request data types. LLM request codec types and trait. * [response](/reference/api/rust-library-reference/nemo-relay/codec/response): Normalized LLM response data types. Normalized LLM response types produced by response codecs. * [streaming](/reference/api/rust-library-reference/nemo-relay/codec/streaming): Provider streaming codec contracts and normalized stream events. Streaming response codecs for the managed LLM execution pipeline. * [tool](/reference/api/rust-library-reference/nemo-relay/codec/tool): Tool-result wire schema inspection. Shared content and failure fields for tool results from any framework. * [traits](/reference/api/rust-library-reference/nemo-relay/codec/traits): Bidirectional request and response codec contracts. LLM codec traits for bidirectional request translation. ## Docs - [Module billing](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/billing.md): Checked provider token accounting and billing data. Provider token accounting contracts and checked usage arithmetic. - [Module content](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content.md): Typed content traversal, shared selection, and owned transport snapshots. Borrowed access to normalized message content. - [Struct Content Cursor](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/struct-contentcursor.md): Forward-only traversal state, independent of the borrowed source lifetime. - [Struct Content Entry](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/struct-contententry.md): One typed entry and its location in the normalized source. - [Struct Content Location](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/struct-contentlocation.md): Read-time location; not a stable edit handle or provider-wire offset. - [Struct Content Snapshot](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/struct-contentsnapshot.md): Owned snapshot; materialization copies selected content for transport or independent retention. - [Struct Message View](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/struct-messageview.md): Shared read-only view of a request item, response output, or instructions. - [Struct Snapshot Entry](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/struct-snapshotentry.md): One owned typed entry and its read-time normalized location. - [Struct Snapshot Tool Call](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/struct-snapshottoolcall.md): Owned invocation identifiers, name, and arguments. - [Struct Snapshot Tool Result](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/struct-snapshottoolresult.md): Owned result identifiers and complete payload. - [Struct Tool Call View](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/struct-toolcallview.md): Borrowed tool-call data, retaining the source's identifier distinctions. - [Struct Tool Result View](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/struct-toolresultview.md): Borrowed tool result. Its payload is excluded from default text extraction. - [Enum Content Field](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/enum-contentfield.md): Field containing an entry, relative to its normalized root. - [Enum Content Kind](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/enum-contentkind.md): Typed content without cloning the normalized source. - [Enum Content Root](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/enum-contentroot.md): The normalized object against which a content location is interpreted. - [Enum Content Selection](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/enum-contentselection.md): Selection applied before extraction. Invalid source/selection pairs are errors. - [Enum Content Selection Error](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/enum-contentselectionerror.md): Invalid content-inspection selection, independent of any transport. - [Enum Content Source](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/enum-contentsource.md): Borrowed normalized input for content inspection; no provider decoding occurs. - [Enum Payload Ref](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/enum-payloadref.md): A payload in its existing representation. No parsing or rendering is performed. - [Enum Retained Content](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/enum-retainedcontent.md): Owned backing for lazy traversal after the original annotation is dropped. - [Enum Snapshot Kind](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/enum-snapshotkind.md): Owned counterpart of borrowed content kinds. - [Enum Snapshot Payload](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/content/enum-snapshotpayload.md): Tool payload in its existing normalized representation. - [Module identity](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/identity.md): Stable LLM codec identities shared across SDK boundaries. Stable LLM codec identities shared across Relay runtime and SDK boundaries. - [Enum Builtin LlmCodec](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/identity/enum-builtinllmcodec.md): Relay's built-in LLM codec identities. - [Enum LlmCodec Identity](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/identity/enum-llmcodecidentity.md): Per-call LLM codec identity supplied to sanitizer and SDK callbacks. - [Module normalization](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/normalization.md): Runtime-supplied provider normalization. Provider normalization supplied by a runtime or embedding application. - [Struct Telemetry Tool Call](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/normalization/struct-telemetrytoolcall.md): A portable tool invocation and its sanitized provider metadata for telemetry. - [Trait LlmNormalizer](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/normalization/trait-llmnormalizer.md): Best-effort request and response normalization for observability projections. - [Module optimization](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/optimization.md): Plugin-neutral LLM optimization evidence and summaries. Plugin-neutral evidence and summaries for LLM optimizations. - [Struct LlmOptimization Contribution](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/optimization/struct-llmoptimizationcontribution.md): One optimizer's evidence for a change to an LLM call. - [Struct LlmOptimization Kind](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/optimization/struct-llmoptimizationkind.md): Open, forward-compatible optimization classification. - [Struct LlmOptimization Model](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/optimization/struct-llmoptimizationmodel.md): Model identity used for counterfactual and effective pricing. - [Struct LlmOptimization Model Transition](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/optimization/struct-llmoptimizationmodeltransition.md): A model change proposed or applied by an optimizer. - [Struct LlmOptimization Summary](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/optimization/struct-llmoptimizationsummary.md): Close-time accounting attached to the normalized LLM response. - [Struct LlmOptimization Token Impact](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/optimization/struct-llmoptimizationtokenimpact.md): Shared token evidence that Relay can aggregate without understanding a plugin payload. - [Struct LlmOptimization Tokens](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/optimization/struct-llmoptimizationtokens.md): Token quantities retained independently from pricing arithmetic. - [Enum LlmOptimization Evidence Quality](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/optimization/enum-llmoptimizationevidencequality.md): Whether token evidence was observed directly or estimated. - [Enum LlmOptimization Summary Status](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/optimization/enum-llmoptimizationsummarystatus.md): Completeness of close-time optimization accounting. - [Trait LlmOptimization Payload](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/optimization/trait-llmoptimizationpayload.md): Trait implemented by typed plugin payloads embedded in an optimization contribution. - [Module pricing](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/pricing.md): Runtime-neutral cost estimation contract. Price estimation supplied independently from runtime execution. - [Trait Cost Estimator](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/pricing/trait-costestimator.md): Immutable price-estimation capability for a provider/model and token usage. - [Module redaction](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/redaction.md): Opt-in source-aware editing and clean sanitized projection. Opt-in provider editing and clean projection, independent of PII policy. - [Struct Normalized Edits](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/redaction/struct-normalizededits.md): A sanitized serialized annotation, with positions anchored to its baseline. - [Trait LlmRequest Redaction](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/redaction/trait-llmrequestredaction.md): Optional request redaction operations exposed by the active request codec. - [Trait LlmResponse Redaction](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/redaction/trait-llmresponseredaction.md): Optional response editing and clean projection exposed by a response codec. - [Module request](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request.md): Normalized LLM request data types. LLM request codec types and trait. - [Struct Annotated LlmRequest](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/struct-annotatedllmrequest.md): Structured view of an LLM request, produced by a Codec from opaque `LlmRequest` content. - [Struct Function Call](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/struct-functioncall.md): A function call within a tool call. - [Struct Function Definition](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/struct-functiondefinition.md): A function definition within a tool definition. - [Struct Generation Params](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/struct-generationparams.md): Normalized generation parameters across providers. - [Struct Open AiImage Url](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/struct-openaiimageurl.md): OpenAI image URL payload. - [Struct Provider Native Component](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/struct-providernativecomponent.md): Lossless provider-native component embedded in the annotated request. - [Struct Tool Call](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/struct-toolcall.md): A tool call requested by the assistant. - [Struct Tool Choice Function](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/struct-toolchoicefunction.md): A specific tool choice that forces a named function. - [Struct Tool Choice Function Name](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/struct-toolchoicefunctionname.md): The name component of a specific tool choice. - [Enum ApiSpecific Request](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/enum-apispecificrequest.md): API-specific request fields that do not have portable semantics. - [Enum Content Part](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/enum-contentpart.md): A single content part within a multimodal message. - [Enum Message](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/enum-message.md): A single message in a conversation, tagged by role. - [Enum Message Content](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/enum-messagecontent.md): Message content: either a plain string or multimodal parts array. - [Enum Tool Choice](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/enum-toolchoice.md): Tool choice control: how the model should use available tools. - [Enum Tool Definition](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/enum-tooldefinition.md): A tool definition available to the model. - [Constant ANNOTATED_LLM_REQUEST_SCHEMA](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/request/constant-annotated-llm-request-schema.md): Versioned JSON envelope schema for `AnnotatedLlmRequest`. - [Module response](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/response.md): Normalized LLM response data types. Normalized LLM response types produced by response codecs. - [Struct Annotated LlmResponse](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/response/struct-annotatedllmresponse.md): Structured view of an LLM response, produced by a response codec from raw JSON API output. - [Struct Cache Write Token Counts](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/response/struct-cachewritetokencounts.md): Prompt-cache write tokens retained for one cache duration. - [Struct Cost Estimate](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/response/struct-costestimate.md): Normalized LLM response cost. - [Struct Response Tool Call](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/response/struct-responsetoolcall.md): A tool call requested by the model in its response. - [Struct Usage](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/response/struct-usage.md): Token usage statistics from an LLM API response. - [Enum ApiSpecific Response](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/response/enum-apispecificresponse.md): API-specific response data that cannot be normalized across providers. - [Enum Cost Source](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/response/enum-costsource.md): Source of a normalized cost value. - [Enum Finish Reason](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/response/enum-finishreason.md): Normalized reason why the model stopped generating. - [Constant CACHE_WRITE_ONE_HOUR_SECONDS](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/response/constant-cache-write-one-hour-seconds.md): One-hour prompt-cache duration, in seconds. - [Module streaming](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/streaming.md): Provider streaming codec contracts and normalized stream events. Streaming response codecs for the managed LLM execution pipeline. - [Enum Normalized Stream Event](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/streaming/enum-normalizedstreamevent.md): Provider-neutral incremental stream item used by cross-protocol transcoders. - [Trait Streaming Codec](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/streaming/trait-streamingcodec.md): Per-provider streaming codec used with the runtime streaming execution API. - [Module tool](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/tool.md): Tool-result wire schema inspection. Shared content and failure fields for tool results from any framework. - [Constant TOOL_RESULT_SCHEMA](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/tool/constant-tool-result-schema.md): Schema name for version one of the tool-result JSON format. - [Module traits](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/traits.md): Bidirectional request and response codec contracts. LLM codec traits for bidirectional request translation. - [Trait LlmCodec](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/traits/trait-llmcodec.md): A bidirectional translator between opaque `LlmRequest` content and structured `AnnotatedLlmRequest`. - [Trait LlmResponse Codec](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/traits/trait-llmresponsecodec.md): Decode-only codec for LLM API responses. - [Trait LlmResponse Encoder](https://docs.nvidia.com/nemo/relay/v1.0.0/reference/api/rust-library-reference/nemo-relay/codec/traits/trait-llmresponseencoder.md): Additive encoder for materializing a normalized response in a provider wire format.