Browse documentation

Frameworks

Connect nRouter to popular AI frameworks including LangChain, LlamaIndex, Vercel AI SDK, CrewAI, AutoGen, and Instructor via OpenAI-compatible endpoints.

nRouter provides drop-in OpenAI-compatible endpoints (https://api.nrouter.ai/v1) that connect to any AI framework or autonomous agent without custom client plugins or code rewrites.

Key capabilities:

  • Zero-refactor client integration: Point any standard OpenAI client integration at https://api.nrouter.ai/v1 using your sk-nrouter-... virtual key.
  • Server-side policy enforcement: Guardrails, prompt injection filtering, PII redaction, and tenant rate limits execute before requests reach upstream providers.
  • Transparent cost attribution: Every priced response returns exact provider list rates in x-nr-request-cost with zero token markup.
  • Automated model resilience: Configured fallback chains re-route requests if an upstream provider encounters admission failures or rate limits.

Supported Frameworks

FrameworkBest forGuide
LangChainChains, agents, RAGSetup →
LlamaIndexDocument indexing, RAGSetup →
Vercel AINext.js / React UIsSetup →
CrewAIMulti-agent orchestrationSetup →
AutoGenMicrosoft agent frameworkSetup →
InstructorStructured outputs, Pydantic validationSetup →
Claude CodeAnthropic's coding agent behind a gatewaySetup →
CursorEditor chat models with a custom provider keySetup →
OpenClawAgent workflows on OpenAI-compatible routesSetup →

Built-in Gateway Controls

All policies execute server-side without changing client code:

  • Guardrails — PII detection, redaction, prompt injection filtering, and keyword blocks.
  • Caching — Answer repeat prompts directly from edge cache.
  • Prompt templates — Centrally managed system prompts injected at the gateway.
  • Rate & budget caps — Per-key and per-organization RPM/TPM limits with hard USD spend ceilings.
  • Cost tracking — Exact provider list prices in x-nr-request-cost (omitted when unpriced; x-nr-cost-status reports exact or unpriced) with zero token markup.
  • Model fallbacks — Automatic failover to configured fallbacks when an upstream provider cannot take a request.
Was this page helpful?