OpenRouter and Model APIs
Level 4 · Where models live and run
The ways to reach an AI model, from the lab's own API to one key for hundreds of models. What OpenRouter does, and what it costs.
Course contentsLesson 13 of 13
Level 1 · The AI labs
Level 2 · Names, sizes and licenses
Level 3 · Picture, video and speech models
Level 4 · Where models live and run
After this lesson you can
- List the routes to reach a model
- Explain what OpenRouter adds
- Pick a route for a given need
11 mincovers 3 glossary entries
Worth reading first: AI Inference Providers
The ways to reach a model, and where OpenRouter fits
There are five common ways to reach a model: the lab's app, the lab's API, a big cloud, an inference provider, or your own machine. OpenRouter adds a sixth. It gives you one API and one key for hundreds of models from many providers, on one bill. If one provider fails, it can send your request to another.
An API is how one program asks another for something. A model API takes your text and sends back the model's reply. You pay for each request, counted in tokens. Every lab and provider has one, but each has its own format, its own key and its own bill.
OpenRouter takes requests in one shared format, with the model's name inside each one. It passes the request to a provider that serves that model. To switch from one model to another, you change one name in your code. That makes it easy to test many models side by side.
This kind of service is called an LLM gateway. Some teams run their own gateway inside the company, to keep keys and spending in one place. OpenRouter is a gateway that someone else runs for you.
The convenience costs a little. OpenRouter passes on each provider's token price with no markup, but it charges a fee of 5.5% when you buy credits. Your data also passes through one more firm. For a big, steady app, going straight to one provider can be cheaper and simpler.
Pick the route by what matters most. Data that must stay put points to your own machine. The strongest closed model points to the lab or a big cloud. Low cost on an open model points to a provider. Trying many models at once points to a router.
People think a router makes every model behave the same. The format is shared, but each model keeps its own strengths, limits and price. A request tuned for one model may do worse on another. So test again after you switch.
Which route to pick
- 1
Your own machine
When the data must stay in the building, and an open model will do.
- 2
The lab's own API
When you want the newest closed model the day it comes out.
- 3
A big cloud
When your firm already pays one cloud and wants AI on the same bill and rules.
- 4
An inference provider
When you want an open model, run fast and cheap, with no chips of your own.
- 5
When you want to try many models with one key. Or when your app must stay up if one provider fails.
Worked example
Lucy tests five models in a day
Lucy has 100 test questions for her quiz app. Through OpenRouter she runs them on five models, changing only the model name each time.
The cheapest of the five gets 92 right, the same as the dearest. She ships the cheap one and pays about a fifth as much.
The words for this lesson3
Check yourself
What does OpenRouter do with your request?
Finished this lesson?
Marking it complete also marks its 3 glossary entries learned, which updates your roadmap and your saved page. 0 are already marked.