Sort AI Gateway providers by cost, latency, or throughput

๐กAutomatically route AI traffic to the cheapest or fastest provider without manual intervention or code changes.
โก 30-Second TL;DR
What Changed
Dynamic provider sorting by cost, TTFT, or TPS
Why It Matters
This feature allows teams to build more resilient and cost-effective AI applications by automatically routing traffic to the best-performing provider for their specific needs.
What To Do Next
Configure the 'sort' parameter in your AI Gateway provider options to optimize your LLM calls for latency or cost.
Key Points
- โขDynamic provider sorting by cost, TTFT, or TPS
- โขAutomatic ranking updates at request time without code changes
- โขComposability with existing routing controls like Zero Data Retention (ZDR) and order overrides
๐ง Deep Insight
Web-grounded analysis with 25 cited sources.
๐ Enhanced Key Takeaways
- โขVercel AI Gateway supports 'bring-your-own-key' (BYOK) authentication, allowing developers to use their existing API keys from providers like OpenAI, Anthropic, or Google without incurring additional token markups from Vercel.
- โขThe AI Gateway was initially developed and used internally by Vercel to power its v0.app service, which has served millions of users, before being made available to external developers.
- โขBeyond dynamic sorting, the gateway offers automatic failover mechanisms, redirecting requests to alternative providers if a primary model experiences downtime, and manages high request throughput with rate limits to support production-level traffic.
- โขVercel AI Gateway is tightly integrated with the Vercel AI SDK and is optimized for Vercel-hosted applications, working seamlessly with Next.js, serverless functions, and edge runtimes.
- โขThe platform provides transparent pricing with no markup on tokens, including for BYOK requests, and offers detailed logs, performance metrics, and cost tracking for each request to aid in usage analysis and cost distribution across providers.
๐ Competitor Analysisโธ Show
| Feature / Platform | Vercel AI Gateway | OpenRouter | LiteLLM | Helicone | Portkey |
|---|---|---|---|---|---|
| Primary Focus | Unified API, routing, reliability, monitoring for Vercel-hosted apps | Unified API for many models, model discovery, pricing transparency | Open-source LLM proxy, standardized OpenAI-format API calls | Open-source observability & proxy, zero markup pricing | AI Gateway & LLMOps control plane, routing, guardrails, prompt management |
| Pricing Model | Pay-as-you-go, no token markup (including BYOK), free $5/month credit | Aggregated billing, 5.5% platform fee | Free to self-host, no licensing fees for core gateway | Zero markup on gateway, monetizes premium observability/analytics | Free tier (10k logs/month), paid plans from $49/month |
| Routing Strategies | Dynamic (uptime, latency), explicit order, sort by cost/TTFT/TPS | Optimization criteria (cost, latency, intelligence, throughput, math, coding), metadata, weighted | Latency-based, cost-based, least-busy, usage-based | Latency, cost, weighted, least-busy | Latency, weighted, health-aware |
| Failover | Automatic failover to available alternatives | Yes | Yes | Health-aware load balancing, auto failover | Automatic retries, fallbacks, load balancing |
| Observability | Detailed logs, performance metrics, cost tracking | Basic request metadata logging (prompts/completions opt-in) | Cost tracking across 100+ LLMs | Request logging, cost tracking, caching, rate limiting, analytics | Detailed request logs, cost tracking, performance analytics |
| Data Retention | Zero Data Retention (ZDR) available for Pro/Enterprise, team-wide or per-request | Documents prompts/completions not logged by default (unless opt-in) | Not explicitly detailed in search results | Not explicitly detailed in search results | PII redaction |
| Model Coverage | Hundreds of models from major providers (OpenAI, Anthropic, Google, xAI, etc.) | Hundreds of models from multiple providers (OpenAI, Anthropic, Google, Meta, Mistral, etc.) | 100+ LLM providers | All major LLM providers | 200+ LLMs |
| Integration | Tightly integrated with Vercel AI SDK, Next.js, serverless functions, edge runtimes | Unified API, works across platforms | OpenAI-compatible API | Single line of code integration | Unified API |
๐ ๏ธ Technical Deep Dive
- Architecture: Vercel AI Gateway operates as a managed gateway within the Vercel ecosystem, functioning as an application-layer gateway optimized for Vercel-hosted applications.
- Latency: The gateway provides consistent request routing with reported latency under 20 milliseconds.
- Integration: It is built on and takes full advantage of the Vercel AI SDK, supporting features like tool calling, function arguments, streaming, retries, attachments, and structured outputs.
- Dynamic Sorting Mechanism: By default, the AI Gateway dynamically selects providers based on recent uptime and latency. The new
sortoption allows developers to rank providers by 'cost', 'ttft' (time to first token), or 'tps' (throughput per second) at request time. - Provider Health Integration: When sorting, the gateway uses provider health status as a guardrail. Healthy providers are sorted purely by the chosen metric, while degraded or recovering providers receive a penalty, pushing them lower in the sort order. Down providers are always sorted last.
- Time to First Token (TTFT): This metric measures the delay between a user submitting a prompt and the model producing the first output token, directly impacting perceived responsiveness. It includes network latency, API gateway routing, and load balancing delays, with the prefill phase being a significant contributor to TTFT.
- Throughput (TPS): Refers to the total tokens or requests the system handles per second, serving as an efficiency metric.
๐ฎ Future ImplicationsAI analysis grounded in cited sources
โณ Timeline
๐ Sources (25)
Factual claims are grounded in the sources below. Forward-looking analysis is AI-generated interpretation.
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
- Google Search Source
Weekly AI Recap
Read this week's curated digest of top AI events โ
๐Related Updates
AI-curated news aggregator. All content rights belong to original publishers.
Original source: Vercel News โ


