The Agent Stack

Agents are designed to do almost any kind of work, from answering support tickets to writing code. No matter how complex the workload, how long it runs, or how many turns it takes to complete, every agent needs three core capabilities to operate:
Agents need to connect to models and route between them
Agents need to run workflows across many steps
Agents need to connect to the systems that make them useful and the platforms people use to interact with them
Implementing these capabilities to build a complete agent forces developers to choose between vendor lock-in with a single provider API, stitching together solutions, or building abstractions themselves.
The Agent Stack gives you all the building blocks you need to create and ship production-grade agents.




Connect to models
Agents don't run on a single model. Every task has a different cost, latency, and capability tradeoff, and the right call depends on what the agent is doing. It needs one interface to reach any of them, a way to route between them, and a way to stream back to the user.
AI SDK gives an agent one interface to call any model, and AI Gateway routes across hundreds of them from a single endpoint.
AI SDK
Every lab exposes model calls through their own API. Streaming, tool calls, structured output, and the shape of the request all vary, so every provider you support adds another integration to build and maintain.
AI SDK is a single interface for building AI apps, agents, and frameworks. It is platform, framework, and model agnostic, and allows you to generate text, images, speech, video, and more.
1import { generateText } from 'ai';2const { text } = await generateText({3 model: 'anthropic/claude-sonnet-4.6',4 prompt: 'Summarize the latest deploys.',5});6console.log(text);Switch models by changing one string, not your code.
AI Gateway
Tokens are a production dependency now, the way bandwidth is for the web, and agents use different models per task. Integration across labs means separate keys and billing from providers that are expensive, rate-limited, and always changing.
AI Gateway is the CDN for tokens, routing them on the global network we have run for over a decade. It routes each call through a single endpoint, fails over when a provider goes down, and tracks cost and usage across all of them. You pay the provider's price with no markup, and you can use your own keys.
“The last thing we want is to rebuild our infrastructure every time a new model drops. The last thing we want is to rebuild our infrastructure every time a new model drops. The last thing we want is to rebuild our infrastructure every time a new model drops. ”Greg Chan CTO

SERHANT. runs three models from a single key, sending market analysis to Claude, marketing copy to GPT, and image generation to Gemini.