LangChain
Chains, agents, and RAG pipelines.
Use ChatOpenAI with base_url set to the NemoRouter endpoint. Every chain, tool, and agent runs unchanged.
pip install langchain-openaiProvider docsNemoRouter is a managed LLM gateway with a fully OpenAI-compatible REST API. Every framework, SDK, and tool that already talks to OpenAI talks to NemoRouter — change two lines and keep one key, one bill, and built-in guardrails across 20+ models.
The whole integration
Drop-in /v1/chat/completions, /embeddings, /models
Python, Node, Go, Java, Ruby, PHP, cURL
LangChain, LlamaIndex, Vercel AI, CrewAI & more
base_url + api_key — nothing else changes
There is no NemoRouter SDK you are forced to adopt. Compatibility is the integration — point any OpenAI client at our endpoint.
Sign up at nemorouter.ai, generate a NemoRouter virtual key (sk-nemo-…), and grab the base URL.
Set base_url to the NemoRouter endpoint and api_key to your key. That is the entire integration.
Your framework, SDK, and observability tooling all run unchanged — now with one key, one bill, and built-in guardrails.
These snippets are generated from the canonical NemoRouter SDK examples — the exact same source the playground and keys page use. Set NEMOROUTER_API_KEY in your environment and go.
pip install nemoroutersdk| 1 | # Cache: enabled (org default). Pass nemo_cache: false to skip. |
| 2 | from nemoroutersdk import NemoRouter, NemoGuardrailBlockedError |
| 3 | |
| 4 | client = NemoRouter() # reads NEMOROUTER_API_KEY from env |
| 5 | |
| 6 | try: |
| 7 | response = client.chat.completions.create( |
| 8 | model="gemini-2.5-flash", |
| 9 | temperature=1, |
| 10 | max_tokens=1024, |
| 11 | top_p=1, |
| 12 | messages=[ |
| 13 | {"role": "user", "content": "Hello! What models do you support?"}, |
| 14 | ], |
| 15 | # nemo_cache=False, # Uncomment to skip cache |
| 16 | ) |
| 17 | print(response.choices[0].message.content) |
| 18 | |
| 19 | # Auto-captured metadata |
| 20 | meta = client.last_response |
| 21 | if meta: |
| 22 | print(f"Cost: ${meta.cost}") |
| 23 | print(f"Guardrails: {meta.guardrails_applied}") |
| 24 | |
| 25 | except NemoGuardrailBlockedError as e: |
| 26 | print(f"Blocked by guardrail: {e}") |
Base URL is always https://api.nemorouter.ai/v1. Works with the official OpenAI SDKs and any OpenAI-compatible client.
Each of these is a standard OpenAI-API client. NemoRouter does not ship a bespoke plugin for them — it does not need to. They work because the API surface is identical.
Chains, agents, and RAG pipelines.
Use ChatOpenAI with base_url set to the NemoRouter endpoint. Every chain, tool, and agent runs unchanged.
pip install langchain-openaiProvider docsRetrieval and document indexing.
Point the OpenAI LLM class at NemoRouter. Query engines and retrievers keep working — only the endpoint moves.
pip install llama-index-llms-openaiProvider docsStreaming UIs for Next.js & React.
Configure the @ai-sdk/openai provider with a custom baseURL. streamText and generateText route through NemoRouter.
npm install ai @ai-sdk/openaiProvider docsProduction RAG and search pipelines.
OpenAIGenerator and OpenAIChatGenerator accept an api_base_url — set it to NemoRouter and your pipelines are unchanged.
pip install haystack-aiProvider docsMulti-agent orchestration.
CrewAI reads OpenAI-style env vars. Set OPENAI_API_BASE to the NemoRouter endpoint and your crews run on managed models.
pip install crewaiProvider docsConversational agent frameworks.
AutoGen LLM configs take a base_url field. Drop in the NemoRouter endpoint and every agent message routes through the gateway.
pip install autogen-agentchatProvider docsAgent Development Kit.
ADK speaks the OpenAI-compatible interface via LiteLLM-backed models — point it at NemoRouter to keep one key and one bill.
pip install google-adkInstructor, Marvin, DSPy, Semantic Kernel…
If a library accepts an OpenAI base URL or honors OPENAI_API_BASE, it works with NemoRouter. No SDK fork, no shim, no waiting on us.
Don't see your framework? If it accepts an OpenAI base URL or honors OPENAI_API_BASE, it already works.
NemoRouter ships a first-party Python SDK and works with the official OpenAI SDKs everywhere else. Set the base URL, set the key — the request and response shapes are unchanged.
| Language | Install | Client |
|---|---|---|
| Python | pip install nemoroutersdk | NemoRouter SDK or openai |
| Python (OpenAI) | pip install openai | openai.OpenAI(base_url=…) |
| Node.js / TypeScript | npm install openai | new OpenAI({ baseURL }) |
| Go | go get github.com/sashabaranov/go-openai | openai.ClientConfig{ BaseURL } |
| Java | Maven / Gradle — openai-java | OpenAIOkHttpClient.builder() |
| Ruby | gem install ruby-openai | OpenAI::Client.new(uri_base:) |
| PHP | composer require openai-php/client | OpenAI::factory()->withBaseUri() |
| cURL / HTTP | Any HTTP client | POST /v1/chat/completions |
Live, runnable snippets for every language are on the playground and your dashboard keys page.
NemoRouter forwards request logs, traces, and metrics to the tools your platform team already runs — configured from Observability → Callbacks, with zero changes to your application code.
Stream traces, spans, and token usage to Langfuse for prompt analytics and evals. Configure it once under Observability → Callbacks — no code change in your app.
Ship request logs and latency metrics to Datadog so LLM traffic sits alongside the rest of your service telemetry.
Archive raw request logs to an S3 bucket you control — for retention, audit, or downstream batch analysis.
Route alerts — LLM errors, budget thresholds, provider outages — into a Slack channel so the right people see them fast.
Alerts can also fan out over generic webhooks — see the observability overview.
Pointing your client at NemoRouter is two lines — but those two lines move every request behind a managed gateway.
Switch models by changing a string — no per-provider keys, no SDK swaps. NemoRouter manages all provider credentials.
PII redaction, prompt-injection detection, and secret scanning run at the gateway — your framework code stays clean.
Per-key, per-team spend tracked in real time. The cost header is authoritative — credits reserve and settle automatically.
Langfuse, Datadog, S3, and Slack callbacks are toggles in the dashboard — not webhook code you write and maintain.
These are full product builds, not marketing pages — so they are not live yet. We are tracking them as committed roadmap items, not shipped features.
Manage keys, teams, budgets, and guardrails as code. Planned — not yet published to the Terraform registry.
A nemo command for keys, usage, and config from the terminal. In design — no install command to publish yet.
Want early access? sales@nemorouter.ai
Two lines · five minutes
Keep your framework, keep your SDK, keep your observability tooling. Change the base URL and the key — get one bill, built-in guardrails, and real cost tracking.