Go developers can smell a ported SDK. The ones that arrive from another language bring foreign idioms with them — builders everywhere, exceptions cosplaying as errors, a client you configure by mutating a global. nRouter's Go SDK page reads like it was written by someone who writes Go on purpose, and the details worth stealing are small ones.

The install is versioned, the client comes from the environment

go get github.com/nRouterGateway/nrouter-sdk/sdks/go/v3@v3.1.2 — a v3 module path, pinned to a release. The client is nrouter.NewFromEnv(), reading NROUTER_API_KEY from the environment and targeting https://api.nrouter.ai/v1. No config struct ceremony before the first call. And if you'd rather not take the dependency, the page is upfront that the OpenAI Go client can be pointed at the same endpoint — the SDK has to earn its place, which is the right posture.

Requests are maps, and that is a deliberate trade

Calls take a map[string]any — model, messages, the usual fields. Typed-struct purists will flinch, but there's a real argument for it at a gateway boundary: the payload is JSON-shaped, new request fields don't wait for an SDK release, and the code you write looks like the request you send. The example wraps the call in a context with a 30-second timeout, because of course it does — cancellation is the caller's job, and the SDK respects it.

The metadata is the feature

What sold me is what comes back. The response carries res.Meta.Cost and res.Meta.RequestID — the settled cost and the trace ID, surfaced as typed fields instead of headers you have to go fishing for. Every gateway call being born with its own receipt changes how you instrument a service: log the request ID next to your own trace, reconcile cost from the response you already have. The Python and Node SDKs expose the same metadata (last_response / lastResponse); in Go it's just there on the result.

Streaming is an iterator, not a callback

ChatCompletionsStream returns a stream you walk with stream.Next() and stream.Current().DeltaContent, closing it with defer like any well-behaved resource. SSE underneath, a for loop on top. It's the shape Go programmers already reach for, and it composes with the same context you'd use to cancel a slow generation mid-flight.

Errors unwrap properly

Failures map to HTTP status codes and unwrap to *nrouter.APIError with errors.As, exposing StatusCode and Message — so a rate limit, an auth failure and a guardrail block are three different branches in your code, not one string to grep. The guide also notes the pre-call side: prompt-injection defense, PII masking and budget controls run before upstream dispatch, so a refused call never leaves the gateway.

Short page, honest trade-offs, idioms intact. The guide: https://nrouter.ai/docs/sdks/go

Disclosure: I'm with the nRouter team.