← Blog
Engineering
Inside the Master AI Gateway
Tomáš Veselý·Apr 30, 2026·9 min read
How we route between OpenAI, Anthropic and Google to keep latency low and credits predictable.
The gateway is a router with a price list. Large architectural work goes to the strongest reasoning model; a one-line copy change goes to a small fast model. The routing decision is made from the size of the plan, not from the length of the prompt.
Caching is layered: a prefix cache for the stable part of the context, a cross-turn cache for search and web results, and a build cache for the bundler. Together they cut the cost of a typical follow-up turn by more than half.
Image generation runs through the same gateway, which is why you never paste an API key: the credit price is computed before the call and shown in the chat.
