ENATIV Logo
ENATIV
Back
© 2026 ENATIV
ProjectsServicesKnowledge hubContact
contact@enativ.pl
  1. Knowledge hub
  2. ›
  3. AI
  4. ›
  5. OpenRouter

OpenRouter

A gateway to AI models of many providers: one API, routing, fallback models and the data on the way.

AIUsing since 2024 · Featured project: ENATIV Portfolio

Category
AI
Using since
2024
Featured project
ENATIV Portfolio

In practice

I pick OpenRouter when an app should have one account and one API address for models of different providers, and choosing a model should be a setting, not a rebuild. The chat on this site, ENATIV Portfolio, reaches its model through OpenRouter. When data cannot pass through a middleman, I choose a direct contract with the provider.

What is OpenRouter?

OpenRouter is a service that exposes models of many providers through one API address. Instead of an account at each provider, you send the request to OpenRouter and name the model in it. It is also compatible with the OpenAI API: an OpenAI client works with it after a change of address and credentials, plus a model name from OpenRouter. In TypeScript you connect it through the AI SDK; this entry is about the gateway.

OpenRouter itself picks which provider serves a request for a given model. By default it weighs measured price and reliability, and a request can narrow that: give an order of providers or require those that do not collect data. When a model is unavailable, the request can move on to the next model in a list, and billing follows the model that finally answered.

Kind
A gateway to models of many providers
Access
One API and one account

How I work with OpenRouter

I start by asking which data will pass through the model, because a gateway adds a second middleman. Only when that is acceptable do I pick models. I keep the model identifier in one place, so changing it is a setting.

  1. Data and provider settings

    I read what OpenRouter and the model providers do with the content of requests. OpenRouter stores no prompts or answers unless you opt in, but the model provider has its own rules, so a request can limit routing to providers that do not collect data or keep none.

  2. Fallback models and billing

    A list of fallback models kicks in on an outage or a rate limit and bills by the model that finally answered. A fallback can cost more or sound different, so I set it deliberately and test it on the same questions as the main model. In ENATIV Portfolio the chat route uses one model and no fallback list.

  3. Account and credentials

    The account belongs to the company. Only the server environment holds the API key, and in ENATIV Portfolio the chat route, without it, answers with a 503 error instead of sending the request.

When it fits, and when it doesn't

OpenRouter fits where the choice of model should stay open for the whole life of the product.

A good fit when

  • An app that should use models of different providers without a separate integration with each.
  • A project at the trial stage, comparing several models on the same questions.
  • A feature that should survive the outage of one model thanks to a fallback list.
  • A chat or assistant in a Next.js app that needs just one account on the server side.

Not a fit when

  • Personal or confidential data that cannot pass through a middleman.
  • A feature that relies on abilities of one model that other providers do not offer in the same shape.
  • A company that already has a contract with a model provider and does not want a second party.

Calling models from code, meaning streaming and tools, needs a separate layer, described in the entry on the AI SDK. When answers should rest on your documents, that is a topic for RAG. I choose an account directly at the model provider when the data is sensitive or one model is enough. Besides OpenRouter I also integrate the native provider APIs directly, such as Anthropic, OpenAI and Gemini.

Frequently asked questions

Yes. The request goes to OpenRouter and then to the model provider, so two data policies apply. OpenRouter states that it stores no prompts or answers unless you opt in, but always stores request metadata. A request can also require providers that do not collect data. I read the provider rules before choosing a model.
OpenRouter itself moves to another provider of the same model, if there is one. With a list of fallback models it also tries the next model. That one will answer differently, so I settle with you whether you want an answer from another model or an error message.
You gain one account and one place to change the model. You lose the direct relationship with the provider: there is one more party between the app and the model. Providers also differ in the parameters they support, so not every setting works with every one. For a feature that depends on a single model, I first check whether a gateway makes sense at all.
Your company, since it is the one the app serves. Browser code and the repository never see the API key; only the server environment holds it.

On this page

  • In practice
  • What is OpenRouter?
  • How I work with OpenRouter
  • When it fits, and when it doesn't
  • Frequently asked questions

Related topics

  • OpenRouter
  • Vercel AI SDK
  • RAG
  • Next.js
  • TypeScript

Related services

  • AI IntegrationCustom AI solutions, chatbots, and intelligent automation for your business.
  • Semantic Search & AI Q&ASearch that understands what users mean, with answers grounded in your own content, in a new app, an existing one or your CMS.
  • AI Customer SupportAI assistants for chat, email and helpdesk: suggested replies, ticket triage and a website chatbot that hands over to a human.
  • AI for BusinessRolling out Claude, ChatGPT Enterprise, Copilot or Gemini for your team, plus a knowledge assistant that respects user permissions.

Torn between one model provider and a gateway?

Write which data will pass through the model and how many providers you want at hand. I will say whether one OpenRouter account is enough or a direct contract is better.

Describe your projectSee ENATIV Portfolio