メインコンテンツへスキップ

One Key, One Variable, One Request: Reading the nRouter Quick Start

    The nRouter Quick Start is short enough to summarise in one line — create a virtual key, set it as NROUTER_API_KEY, send a chat completions request — and it is still worth reading slowly, because the omissions are the interesting part.

    There is no tour of the product before the first call. No concepts chapter. The guide assumes a developer who wants a working request and a way to prove

    it worked, in that order.

    The key stays out of the code

    Step two puts the key in an environment variable, and every example (TypeScript, Python, cURL) reads it from there. The accompanying rule is stated flatly: keep the key on your server; never in browser code; never committed to source control. It is the cheapest security habit there is, installed at minute one instead of after the first leak.

    Three doors into the same room

    The request itself can be sent three ways: plain REST with cURL and no install; the nRouter SDK in TypeScript or Python for a typed client; or the OpenAI SDK already in your project, with only the base URL (https://api.nrouter.ai/v1) and the key changed. The endpoint, the key handling, and the request shape are identical across all three — the choice is about your codebase, not about capability.

    Delegation you can audit

    The first request uses nrouter/auto, so the gateway picks the model. Delegating that choice on call one only makes sense because the result is auditable: the request appears in the dashboard's request logs within seconds, naming the model that answered and the exact cost of the request. If you would rather choose, the live model catalog has the IDs, and nothing else about the call changes.

    A quick start is a promise about how a product respects your time. This one keeps the promise in three steps and leaves a receipt.

    Walkthrough: https://nrouter.ai/docs/getting-started/quick-start

     
     
    nRouter.ai - Every model. One API key. Total control. Guardrails, budget enforcement, and smart routing included on every plan.

    あなたへのおすすめ