Dev.to has plenty of "here is my AI stack" posts. This one is about the part that survives: the protocol.
If two vendors speak different protocols you do not have one stack, you have two stacks and a translation layer you maintain by hand. Everything below follows from that.
This post is about the plumbing: what an AI gateway actually does, where it helps, and where it quietly hurts.
The shape of the problem
A normal AI feature needs more than one model:
- a cheap chat model for drafting
- a strong model for the hard 10% of requests
- an embedding model for retrieval
- an image model for the UI
- increasingly, a video or music model for marketing
Each one arrives with its own SDK, auth scheme, rate limits, error format, and billing unit. Four vendors means four ways to fail.
What a gateway buys you
1. One client, many models. If the gateway speaks the OpenAI API, your existing code works. Switching models is a string.
from openai import OpenAI
client = OpenAI(base_url="https://ai8888.uk/v1", api_key="sk-...")
# cheap pass
client.chat.completions.create(model="fast-chat", messages=msgs)
# hard pass
client.chat.completions.create(model="best-reasoning", messages=msgs)
2. Stable aliases. Upstream model IDs change every few weeks. Aliases like fast-chat and best-image let you swap the target without touching a single line of client code.
3. Failover. When one provider 500s, a gateway can retry the next best provider for the same capability. That is the difference between "the feature is down" and "that answer came from a different model".
4. One place to cap spend. Per-key quotas and spend caps beat four dashboards and a monthly surprise.
What a gateway costs you
- A hop. Extra latency, usually small, occasionally not.
- A dependency. If the gateway is down, everything is down. Ask about failover before you commit.
- Abstraction loss. Provider-specific features (a particular tool-calling dialect, a particular image parameter) may not survive the translation layer.
The part nobody writes about: non-developers
Half the people who need these models will never open a terminal. A gateway that only ships an API leaves them out, and you end up buying a separate consumer subscription anyway.
What worked for me: one account that serves both. Devs get a key, everyone else gets a web app, and both hit the same catalogue and the same bill. It sounds trivial. It removed an entire category of "can you generate this for me" requests.
How I would evaluate any gateway
- Does it speak the OpenAI API without a shim?
- Are aliases stable, and is there a changelog when they move?
- What happens on provider 500 — retry, failover, or error?
- Is there a per-key spend cap?
- Can a non-developer use the same account?
If a vendor cannot answer #3 in one sentence, keep looking.
If you take one thing away: measure what a model change costs you. If it is a refactor, you are not evaluating models, you are evaluating vendors.
I ended up building this for myself and it is now at https://ai8888.uk/?utm_source=devto&utm_medium=social&utm_campaign=launch_2026q4&utm_content=article — 500+ models across chat, image, video, music and voice, one key, plus the web app. Feedback welcome; the alias design is the part I am least sure about.
Top comments (1)
A stable alias plus failover on a 500 is the part worth copying, and the spend cap per key is what keeps a bad day from becoming a bad bill.