Anatomy of an AI gateway
Every request crossesevery layer. An AI gateway is more than a proxy with model names. It speaks the model APIs, routes across providers, meters and limits every token, screens content, and shows you what happened, on a foundation built to stream.
Available in the current releaseExperimental opt-in, off by defaultProposed open design proposalClassify and route MCP and A2A traffic Store and rehydrate Responses history; serve Conversations Agentic loop for MCP and web-search tool calls Responses state, Conversations and the agentic loop are experimental and off by default.
MCP → Agentic loop →
Time to first token for streaming responses Token usage metrics and Prometheus /metrics OpenTelemetry tracing and structured access logs OpenTelemetry → Time to first token →
Proposed next: Trace context propagation · OTLP metrics export
Unified token counts from provider responses Pre-request balance checks and post-response usage reporting Token usage returned in response headers Token counting → External metering →
Token, rate and cost limits per application Weighted costs so expensive models spend more budget Consumption reporting and optional alerts Read proposal #00121 →
Token rate limits with tiered enforcement and 429 responses Token ceilings on request size and requested output Request rate limits, circuit breakers and timeouts Token rate limits → Token ceilings →
External guardrail providers pass, block or redact content Fails closed unless you explicitly opt out Configured per route, with documented streaming limits Guardrails →
Validated user, agent and workload identity Pluggable decisions with Cedar, CEL or OPA Per-upstream token delegation and an audit event per decision Security features → Identity headers →
Classify by API format, model, streaming and tools Route by model or MCP tool name Rewrite client-facing model names Intelligent routing → Provider routing →
OpenAI, Anthropic and Chat Completions-compatible backends such as vLLM Azure OpenAI, AWS Bedrock Converse and Vertex AI Gemini AWS SigV4, Entra ID and Google ADC upstream credentials Provider adapters work within their documented limitations.
Vertex AI Gemini → AWS SigV4 →
OpenAI Responses and Chat Completions Anthropic Messages, natively or translated Streaming translation included Anthropic Messages → Responses proxy →
Implement HttpFilter or TcpFilter in your own crate Conditional filters and branch chains Compiled for native execution Write a filter → Extensions →
Zero-copy streaming and StreamBuffer inspection Load balancing, health checks and atomic config reload Rustls TLS and unsafe_code = "deny" Core features → Payload processing →
To start from a task instead, such as sending a first request, connecting an application or deploying, use the documentation hub .