Your AI gateway is probably a Python SDK. That works on a laptop. It does not survive contact with real traffic.
This is not a dig at the people who built those libraries. They solved a real problem: developers wanted one way to talk to every model, and they wanted it yesterday. A Python wrapper around OpenAI, Anthropic, Bedrock, and friends was the fastest way to do that. Ship the library, done.
Then the library grew a server. Then the server grew a UI. Then the UI grew a billing plan. Somewhere along the way, the thing stopped being an SDK and started calling itself a "gateway." Nothing underneath changed. It is still a Python process wrapping HTTP clients.
That is fine for weekend projects. It is not fine for the gateway that sits in front of your production traffic.
What a gateway actually has to do
A gateway is the thing every request hits first. That means:
- Terminate TLS, including ALPN negotiation for HTTP/2.
- Keep connection pools warm to upstreams, for tens of thousands of concurrent streams.
- Survive slow clients, slow upstreams, half-open TCP, broken WebSockets, and HTTP smuggling attempts.
- Enforce auth before a single byte of the body reaches your application code.
- Apply rate limits that understand request shape, not just request count.
- Apply WAF rules that understand request shape, not just URL suffixes.
- Transform headers, bodies, and streams without buffering everything into memory.
- Emit structured logs, metrics, and traces that look the same as the rest of your stack.
- Restart cleanly, reload config without dropping connections, and run in every deployment shape you already own.
None of this is specific to AI. All of it is what people spent twenty years teaching nginx, HAProxy, and Envoy to do. It is the reason those projects exist.
The AI-SDK-that-grew-a-server crowd has to rebuild every one of those pieces from scratch, in Python, usually while also shipping features. Some of them do a reasonable job. None of them do it the way a production operator expects.
What AI traffic actually is
AI traffic is HTTP traffic. A POST to /v1/chat/completions is a POST. The body is JSON. The response is a stream of server-sent events or chunked JSON. The auth is a bearer token. The upstream is at api.openai.com or a model endpoint inside your VPC.
The things that make it feel different are surface features, not architectural ones:
- Responses stream for longer. Tens of seconds, sometimes minutes. A proxy that handles WebSockets handles this already.
- Costs are measured in tokens, not requests. A proxy that can count bytes can count tokens.
- You want provider fallbacks when one is down. A proxy that does health-checked upstream pools does this already.
- You want to cache. A proxy that caches GETs can be taught to cache prompt-keyed responses.
- You want prompt-level policy. That is a request transform and a response transform.
The honest read is that everything new about AI gateways fits inside the extension points a real proxy already has. You do not need a different runtime. You need the same runtime, with a handful of features added.
Why this matters in practice
The teams we talk to all hit the same wall. They stand up an AI gateway for their first use case. It works. Then one of two things happens:
The first is they put it in front of traffic that is not AI. Maybe an internal API that also wants auth and rate limits. The AI gateway cannot do that well, because it was never a gateway. So they keep the existing API gateway and put the AI gateway behind it. Now they run two gateways.
The second is that the AI use case grows. Streaming to a browser. WebSocket tunnels for an agent. MCP traffic. A quiet request to add a WAF rule because someone pasted a jailbreak prompt into support. The AI gateway starts to wobble. The ops team finds themselves patching a Python service to do what their existing reverse proxy does out of the box.
Both paths end in the same place. Two control planes. Two sets of configs. Two sets of dashboards. Two on-call runbooks. All of it to solve a problem that should have been one box.
What SBproxy is
SBproxy is a single static binary. A reverse proxy that happens to speak LLM, MCP, and agent traffic.
It started life as a production reverse proxy. TLS, HTTP/1.1, HTTP/2, WebSockets. Auth, WAF, rate limits, IP filters, transforms, caching, multi-tenant routing. The kind of proxy you would put in front of any HTTP service.
Then we taught it AI. Provider fallbacks across 200-plus models. Token accounting. Semantic caching. Budget limits. Prompt-level policy as a first-class rule, not a middleware afterthought. MCP federation, so one proxy fronts N MCP servers.
Same runtime. Same YAML. One config file describes an auth policy in front of your internal API, a rate limit in front of your checkout endpoint, and a provider fallback chain in front of your chat completions route. One process reads that file. One log stream reports what happened.
This is not a clever architecture. It is the obvious one. The only reason nobody did it first is that the AI gateway market started inside application code, and the API gateway market started inside infrastructure, and nobody had standing to merge them.
What to do with this
If you are running a Python AI gateway behind an API gateway, you are running two things to get one job done. That is a stitch, not a stack. Rip one of them out.
If you are picking one now, pick the one that was built to sit in front of traffic. The AI parts are easy to add to a proxy. The proxy parts are very hard to add to a Python SDK.
If you want to see what it looks like:
curl -fsSL https://sbproxy.dev/install.sh | sh
Point it at a YAML with an origin. Send it traffic. Keep the parts that work.
We did not set out to build an AI gateway. We set out to stop running two of them.