Rust SDKs for hosted APIs usually pick a lane: wrap the popular ecosystem crate and inherit its blind spots, or go fully native and make you learn a new API before you can call anything. nRouter's Rust SDK page does something more interesting — it ships both, in one crate, and lets the two halves divide the work.

The drop-in half: async-openai, configured

Add nrouter = "3.1.2" to Cargo.toml alongside Tokio, and nrouter::client() hands you a configured async-openai client — key read from NROUTER_API_KEY, pointed at https://api.nrouter.ai/v1. Requests are the async-openai builder types you may already know: CreateChatCompletionRequestArgs, messages built with ChatCompletionRequestUserMessageArgs, .await on the call, done. If your codebase already speaks async-openai, the gateway is a constructor change. That is the correct amount of novelty for an integration.

The native half: the metadata is the point

The reason the native client exists is headers. Every gateway response carries the x-nr-* telemetry — request identity, settled cost — and the generic client has no opinion about them. nrouter::http::Client::from_env() does: its chat completions call returns the body plus out.meta, and the example prints out.meta.cost next to out.meta.cost_status. That pairing is a small, honest piece of design. Cost at a gateway is a settlement, not a guess, and exposing its status alongside the value beats pretending every number is final the moment it lands. If you are reconciling spend or tracing a call, this is the client you want; if you just need completions, the async-openai half is less code. Choose per call site, not per project.

Streaming without the ceremony

Streaming runs through the native client's messages_stream, which takes a JSON payload — the example is an Anthropic-shaped messages request, a reminder that the gateway speaks both wire formats — and returns a stream you drain with while let Some(chunk) = stream.next().await?, printing chunk.delta as it arrives. The page describes the SSE handling as zero-allocation; I can't bench that from a docs page, but the API shape is right for it: no callback registration, no channel plumbing of your own, just an async loop that composes with the rest of your Tokio runtime and ends when the stream does.

Errors you can match on

The part I'd steal for any Rust client: refusals map to a NRouterError enum with variants that carry meaning — GuardrailBlocked (400), Authentication (401), Credit (402, the balance or the key's budget ceiling), RateLimit (429), Service (503). In Rust that is not documentation garnish, it's control flow: you match on the variant, and a budget refusal gets a different response from a rate limit, which gets a different response from a guardrail block. Three failures that look identical in a status-code log are three different programs in your code, and the SDK keeps them separate for free.

Two clients sounds like indecision until you see the split: ecosystem compatibility for the calls, native types for the evidence the gateway adds. The guide is at https://nrouter.ai/docs/sdks/rust if you want the full examples.

Disclosure: I'm with the nRouter team.