Without a gateway
ServicesProviders
Each service calls each provider directly, and spend shows up late.
Mirage Academy · LLM Gateways, Cost Management & Model Routing
Aimed at software engineers and technical product people who build AI features, this advanced course covers many models behind one gateway. Eight chapters and forty lessons lead to a capstone: a gateway with three providers and per-user budgets.
One door
Start with the course video. Under it, the same three services and three providers drawn twice: once without a gateway and once with one.

Your app calls more than one model, and each provider has its own API, its own limits and its own bill. This course is for the engineer who has to keep that under control. Without a gateway, each service calls each provider directly, and spend shows up late. With a gateway, one API hides the providers, budgets stop spend early, fallbacks cover an outage, and an audit log records every call. Each request follows one path. The gateway checks rate limits and quotas. It serves from cache when it can. Otherwise it routes by cost, quality and latency, and falls back to another model. Then it counts the tokens and charges them to a user. In the capstone you build a gateway with three providers and per-user budgets. If you run models in production and want one place to control them, start with the first chapter.
ServicesProviders
Each service calls each provider directly, and spend shows up late.
ServicesGatewayProviders
One API hides the providers, budgets stop spend early, fallbacks cover an outage, and an audit log records the calls.
One request
The picture shows the stages the course video names. Chapter 1 teaches the full nine-step request path in reference order.
The gateway checks rate limits and quotas first.
Chapter 4It serves from cache when it can.
Chapter 5Otherwise it routes by cost, quality and latency.
Chapter 3When the chosen model fails, it falls back to another model.
Chapter 5Then it counts the tokens and charges them to a user.
Chapter 6An audit log records the calls.
Chapter 7Providers
Chapter 2 covers the layer between your services and the providers.
One request shape for services, and an adapter per provider.
The fields a model catalogue keeps for each model.
Aliases, pinning and deprecation of models.
Parameters and limits across providers, and what not to translate.
Contract tests with recorded replies for an adapter.
Routing
Chapter 3 covers routing policies, cascades and how to evaluate a router. The calculator below uses made-up cost units.
Cascade3.00 units per request
Per 1,000 requests: 3,000Strong model only10.00 units per request
Per 1,000 requests: 10,000The cascade costs less than sending everything to the strong model. (-70%)
The cascade starts to pay off above 10%.
The rule: each request pays for the cheap call, and the requests whose answer is not accepted pay for the strong call as well. Expected cost per request = 1 + (1 minus the accepted share) x the price ratio. Sending everything to the strong model costs the ratio itself. So the cascade is cheaper exactly when the accepted share is above 100 divided by the ratio, in percent. This covers cost only. Whether the cheap answers are good enough is what evaluating a router measures.
The cascade costs less than sending everything to the strong model. Cascade: 3.00. Strong model only: 10.00.
Limits
Chapter 4 starts with the limits providers enforce and builds your own on top.
Example run, made-up numbersThe bucket holds up to 5 tokens. It refills 1 token each second.
The rule: the bucket starts full and is topped up for the seconds since the last request, capped at its capacity. A request takes its cost when that much is in the bucket. Otherwise it is refused with HTTP 429 and the bucket stays as it was.
A provider refuses requests over its limit and answers with HTTP 429.
Token buckets for rate limits.
Budgets and reservation before a call.
Quotas, and sharing capacity fairly between users.
Alerts and enforcement of limits.
Fallbacks
Chapter 5 covers what the gateway does before a call, and what it does when the call fails.
A request that repeats word for word can be answered from the cache.
Semantic caching, and the risk that comes with it.
Answers that should not be served from a cache.
Retries and fallback chains of other models.
Timeouts, hedging and circuit breakers for a failing provider.
Accounting
Chapter 6 turns token counts into numbers a team can use. The figure uses made-up numbers.
Spend by tagExample, made-up numbers
Gateway count: 10,000Provider count: 10,100Gap: +100 (+1%)
The gateway counts tokens itself and compares its count with the provider's.
Cached and reasoning tokens in the count.
Tags and allocation of spend.
Showback, chargeback and unit cost as ways to report spend.
Forecasts and anomalies in spend.
Audit and filtering
Chapter 7 is about what the gateway records and what it lets through.
Which fields of a call go into the audit log.
Tracing a response back to its request, route and user.
Sensitive values are masked before the request leaves the gateway.
Answers pass a filter on the way back to the service.
Who may read the log, and how long it is kept.
Capstone
You end the course by building the gateway, in five steps from the requirements to the review.
Write the requirements and the design record.
List the models of the three providers and the table that routes requests to them.
Script the failures the gateway has to survive, then run them.
Report who spent what, per user.
Decide whether the gateway is ready to run, and say why.
Start
Course language: English.
Level and audience
In the Academy
Each lesson combines a short visual explainer, questions, a task and a quiz.
Passing the chapter assessments leads to your certificate.
In a voice session the coach has you explain the material in your own words and asks again where the answer is thin. The coach does not decide the certificate.
The course comes with a certificate that fixed rules grant. It has its own verification code, which anyone can use to check it online. It is Mirage's own statement and not a state-recognized degree.
Prompt and Context Engineering course →Agentic Engineering course →
The catalogue lists it as advanced, with eight chapters and forty lessons. It teaches how to run many models behind one gateway, with routing, budgets, fallbacks and accounting.
Its catalog audience is engineers and technical product people building AI features, at advanced level.
In this course it is the one place between your services and the model providers. The course video describes one API that hides the providers, budgets that stop spend early, fallbacks for an outage and an audit log of the calls.
A gateway with three providers and per-user budgets. You write the requirements and design record, the catalogue and route table, the failure scripts and the accounting report, and then hold a go or no-go review.
The engineering course builds one application: structured outputs, tools and routing inside it. This course treats routing, limits and accounting as shared infrastructure for many services and providers.
No. This course covers the layer around the model calls. The Prompt & Context Engineering course covers prompting, and the Agentic Engineering course covers agents.
Yes, a certificate comes with the course. Fixed rules on your chapter checks decide it, the AI coach does not, and others can check it online with its verification code.
The course page lists all forty lessons, from chapter one onward.