Build Stuff 2026 · Vilnius · Beta 1 · Fri 4 Dec · 14:30
Lessons from building one.
Johannes Brüderl · Principal Software Engineer · Redpanda Data
About me
github.com/birdayz
redpanda.com
Part 1 · What
Where it sits, what it does, and where the gateway ends and the platform begins.
What
The obvious question
API gateway · thinks in HTTP
route /orders/* → orders:8080 match header x-tenant limit 100 req/s per API key
You configure paths, headers and upstream hosts.
AI gateway · thinks in GenAI
provider my-anthropic, my-bedrock model allowlist, fallbacks, smart routing mcp all the tools you want identity users, agents, applications
You configure GenAI stuff.
AI gateways sit one abstraction level higher. You can build one on top of an API gateway.
Part 2 · Why
Me, to our CTO, about 18 months ago
Turned out almost everything we add goes through the gateway. Owning it makes us way faster.
Recap
Governance
Audit log · transcripts · policies · cost
Platform engineering & IT
All traffic, all vendors · routing, fallback
Tools
Register and share
Identity
Policies & on-behalf-of identity
Part 3 · How
The gateway
01
Reverse proxy to the LLM providers. Many wire protocols.
02
The data integration layer. Tools for agents. JSON-RPC over HTTP and SSE.
03
Most popular standard to expose agents. No clear winner yet.
04
API of the AI gateway itself, to manage it.
Honorable mentions: AG-UI and others. Agent protocols are far from settled.
Deep dive · 01 / 03
Providers, wire protocols, and the conventions around them.
LLM API
OpenAI
Chat Completions
/v1/chat/completions
Responses
/v1/responses
Two native APIs. Responses is the one OpenAI recommends for new work.
Anthropic
Messages
/v1/messages
Chat Completions
/v1/chat/completions
No prompt caching on compat. Anthropic: not for production use.
generateContent
/v1beta/models/{m}:generateContent
Chat Completions
/v1beta/openai/chat/completions
The model is in the URL, not the body.
AWS Bedrock
Invoke · Converse
/model/{id}/invoke · /converse
Messages some models
Chat Completions · Responses
/openai/v1/…
Support varies per model. Two hosts.
Other providers (have to) use one of these.
Core abstractions
Core abstractions
Chat Completions
POST /v1/chat/completions { "model": "gpt-5", "stream": true, "max_completion_tokens": 256, "messages": [ { "role": "system", "content": "Be brief." }, { "role": "user", "content": "Hi" } ] }
Messages
POST /v1/messages { "model": "claude-sonnet-4-5", "stream": true, "max_tokens": 256, "system": "Be brief.", "messages": [ { "role": "user", "content": "Hi" } ] }
Converse
POST /model/<model-id> /converse-stream { "system": [ { "text": "Be brief." } ], "messages": [ { "role": "user", "content": [ { "text": "Hi" } ] } ], "inferenceConfig": { "maxTokens": 256 } }
generateContent
POST /v1beta/models/ gemini-2.5-flash :streamGenerateContent { "systemInstruction": { "parts": [ { "text": "Be brief." } ] }, "contents": [ { "role": "user", "parts": [ { "text": "Hi" } ] } ], "generationConfig": { "maxOutputTokens": 256 } }
First design question
HTTP Body
{"model": "my-anthropic/claude-…"}
HTTP Header
X-Provider: my-anthropic
HTTP Path · what we do
/llm/v1/providers/my-anthropic
Paths · sounds trivial, is not
Have you seen this one?
OpenAI SDK · /v1 is part of the base URL
Anthropic SDK · bare base URL, the SDK appends /v1
There it is · a /v1 in the base URL, to "look like OpenAI"
Paths · you are not alone
NextChat #4599
Groq: POST
cline #974
"path":"
cline #15561
VS Code: /v1 404. CLI: 200
new-api #126
Groq: POST
chatwoot #15902
Proxy … becomes /v1
kilocode #2384
Custom base URL: POST
Roo-Code #8282
Custom URL: /v1 stacked, /v1
bifrost #6562
base_url … gives /v1
bifrost #517
Docs example yields /v1
recipes #1630
Recipe base URL gives /v1
Red: papered over it. Strip, dedupe or special-case /v1.
Paths · do it properly
For now and forever
The official SDK is the spec.
Base URL what the user types into the provider's official SDK.
Upstream URL where the gateway sends it. Whatever the SDK adds after the base URL gets appended.
OpenAI SDK
base URL…/providers/my-openai/chat/completions upstream URLhttps://api.openai.com/v1/chat/completionsAnthropic SDK
base URL…/providers/my-anthropic/v1/messages upstream URLhttps://api.anthropic.com/v1/messagesWire protocols
Usage
"cache_read_input_tokens": 1200
Errors
{"type": "error", "error": {…}}
Streaming
data: [DONE]
This is the bare minimum. On top: guardrails, transcripts, audit logs, budgets, rate limits, …
Wire protocols
// a guardrail block, Anthropic Messages {"type": "error", "error": {"type": "invalid_request_error", "message": "Blocked by policy"}} // the same block, OpenAI Chat Completions {"error": {"type": "invalid_request_error", "code": "content_policy", "message": "Blocked by policy"}} // simplified
The client only speaks its wire protocol. Even when the gateway is the one saying no.
Built on wire protocols
Fallback rides on this. Same model, next host, until the first token.
Testing
Most tests
The real proof
The worst
Models
id: eu.anthropic.claude-haiku-4-5-20251001-v1:0 model: anthropic/claude-haiku-4-5 failover UI wire_apis: [anthropic_messages, bedrock_converse] translate snippets capabilities: tools: true agent failover tool_search: false reasoning: budget: true modalities: input: [text, image, document] constraints: max_input_tokens: 200000 agent UI max_output_tokens: 64000 gateway supported_params: [temperature, top_p, max_tokens, stop] pricing: cost input_usd_per_m: 1.10 output_usd_per_m: 5.50 cached_input_usd_per_m: 0.11 attributes: inference_geo: eu UI # trimmed, simplified
Deep dive · 03 / 03
MCP fragmentation is real
MCP
The whole company, one place: centralization.
Identity
Tools
The list of tools can change: per caller, and over time.
Why dynamic is the right design
Static · one schema for everyone
create_issue({
project: string,
fields: [{ name: string, value: string }]
})
Dynamic · this project, this caller, only fields they can see
create_issue({
summary: string,
story_points: integer,
customer: "Acme" | "Globex",
due: string // format: date
})
Generate it dynamically, e.g. one tool per table. High-fidelity schemas give much better results.
Tools
The tools an MCP server lists can depend on the user.
alice
connect_account
jira_search
jira_get_issue
jira_create_issue
jira_transition
project lead
bob
connect_account
jira_search
jira_get_issue
read-only
Part 4 · Back up
Build, buy or self-host · per situation
| You are | You mostly need | Verdict |
|---|---|---|
| A small teamone or two providers | Keys out of the apps, a spend limit | buy or self-host an open-source proxy is enough |
| A platform teammany teams, many providers | Cost per team, allow-lists, one base URL for everyone | buy or build self-hosting is not worth it |
| A regulated enterprisedata stays in your cloud | Per-user identity, audit, tools that act as the user | buy a vendor that deploys into your account |
| An AI platform vendorthe gateway is your product | All of the above, for your customers | build and staff it for good |
Build Stuff 2026 · Vilnius
Johannes Brüderl · Principal Software Engineer · Redpanda Data
github.com/birdayz