Most Vercel AI Gateway vs. Cloudflare AI Gateway comparisons start with Cloudflare's pricing page, and the word "free" settles the question before a single production request gets routed. That framing skips the two variables that actually decide it: what happens when a provider degrades mid-request, and what the bill looks like once traffic clears the free tier's log cap. Failover architecture and cost at production volume are where the two gateways genuinely diverge.
Key takeaways:
Vercel AI Gateway fails over to the same model on a different provider automatically. Cloudflare AI Gateway requires a manually ordered fallback array that can route to a different model entirely.
Vercel charges zero markup on every token, including Bring Your Own Key (BYOK) usage. Cloudflare's Unified Billing adds a 5% fee to every credit purchased.
Cloudflare's free plan caps at 100,000 total logs per account across all gateways, a limit a gateway handling 1,000 requests a day clears in under four months.
Cloudflare AI Gateway ships free exact-match caching and Dynamic Routing, plus Guardrails and Data Loss Prevention (DLP), but those content-safety features are still Beta, and Cloudflare doesn't offer Vercel AI Gateway's automatic failover or per-user cost attribution.
AI Gateway is the default provider in AI SDK v7, so a plain
creator/model-namestring routes through it with no configuration.Vercel fits Next.js and TypeScript teams already building on the AI SDK. Cloudflare fits teams standardized on Workers with native Workers AI access.
Copy link to headingWhat are the key differences between Vercel AI Gateway and Cloudflare AI Gateway?
Vercel AI Gateway and Cloudflare AI Gateway both proxy LLM traffic through a single API, track spend across providers, and pass through provider token pricing without a markup. Past that surface, the products diverge on how they behave when a provider degrades and what a team pays once traffic clears the free tier.
Copy link to headingWhat we compared
This comparison draws on the current published documentation, changelogs, and production data both vendors have released, cross-checked against each product's live docs rather than either company's marketing copy. Where a claim couldn't be verified against a primary source, it's left out rather than passed through as fact.
The criteria weighted most heavily are the ones that compound at production scale: what happens on a provider outage, what a credit purchase actually costs once fees are included, how long logs survive before an account hits its limit, and how each gateway enforces Zero Data Retention (ZDR) with providers.
Here's where the two gateways split on the axes that matter once real traffic is flowing:
Each row hides a different shape than the table alone shows. Walking through the ones that carry the most weight at production volume is where the real tradeoffs surface.
Copy link to headingAutomatic failover versus a configured fallback array
When a provider degrades, AI Gateway fails over to the same model on a different provider. The application gets a successful response, nothing in the code changes, and nobody configured a fallback chain in advance. Cloudflare handles the same failure differently. A team orders a fallback array ahead of time, and when the first entry fails, the request routes to the next configured entry, which may be a different model entirely rather than the same one on another provider.
Production data backs the case for automatic failover. Across seven months of AI Gateway traffic and over 200,000 teams, fallback routing rescued 3.5% of all requests and 5.1% of all tokens that crossed the gateway. Cline, the open-source coding agent, A/B tested its previous router against AI Gateway on live production traffic and saw P99 streaming latency improve 10 to 14% and API error rates drop 43.8%.
Cloudflare's fallback array supports up to five retries with constant, linear, or exponential backoff, plus timeout-triggered fallbacks that Vercel doesn't document an equivalent for. A cf-aig-step response header reports which provider ultimately answered. Teams that want explicit control over the fallback sequence get it, at the cost of configuring it before the outage happens rather than after.
Copy link to headingThe "free" framing breaks down at production log volume
Cloudflare AI Gateway is genuinely free at experiment scale. In production, the log cap and the Unified Billing fee change that math.
Cloudflare's free plan stores 100,000 logs total across every gateway on an account. A single gateway handling 1,000 requests a day exhausts that cap in under four months. Past the limit, new logs stop saving unless the team upgrades to the Workers Paid plan, which raises the ceiling to 10 million logs per gateway and adds Logpush export.
Unified Billing, Cloudflare's managed billing option, adds a 5% fee to every credit purchased: a $100 credit purchase settles at $105. Vercel charges provider list rates with zero markup, including on BYOK, and no percentage fee on credit purchases.
Copy link to headingData governance now runs in both directions
Both gateways route to providers under formal no-retention agreements, but the coverage differs. Vercel's Zero Data Retention (ZDR) is free per request on Pro and Enterprise plans, or enforceable team-wide across every request for $0.10 per 1,000 successful ones, and it applies to any request the gateway routes regardless of billing method.
Cloudflare added opt-in ZDR to Unified Billing in November 2025. A team toggles it as the gateway default or sets the cf-aig-zdr header per request, and Cloudflare routes that traffic only through providers that don't retain prompts or responses. The scope is narrower: it covers Unified Billing traffic specifically, not requests authenticated through BYOK or provider-native endpoints. Teams enforcing data governance as an infrastructure-wide policy get closer to that with Vercel's team-wide toggle. Teams that only need it on the specific traffic routed through Cloudflare's managed billing get a comparable guarantee for free.
Copy link to headingCloudflare's free caching and Beta content-safety features
Cloudflare ships free exact-match response caching, with hits cutting latency by up to 90% and a cache time to live (TTL) of up to one month. Vercel prices cached-read tokens per model but doesn't document a gateway-level response cache.
Cloudflare's Guardrails and DLP are both Beta. Guardrails evaluates prompts and responses through Llama Guard on Workers AI and bills as Workers AI inference. DLP scans for sensitive data using shared Cloudflare One DLP profiles and is free on every plan. Neither has a documented equivalent on Vercel AI Gateway today.
Once the axes are laid out, the shape of each product becomes clearer, and looking at each gateway on its own terms is the next useful step.
Copy link to headingVercel AI Gateway for TypeScript and Next.js teams
Vercel AI Gateway is a managed LLM routing layer built from the same infrastructure that had already powered v0 for millions of users. It launched in alpha in May 2025 and reached general availability on August 21, 2025, processing traffic through a single endpoint (https://ai-gateway.vercel.sh/v1) with access to hundreds of models across 20+ providers.
The gateway is also the default provider in AI SDK v7. Passing a plain creator/model-name string to any AI SDK function routes the request through the gateway with nothing else to configure.
Copy link to headingPros and cons of Vercel AI Gateway
Vercel AI Gateway pros:
Automatic same-model failover: When a provider degrades, the gateway retries the identical model on another provider with no fallback array to configure in advance.
Zero markup, including BYOK: Tokens cost the same as buying directly from the provider, whether the team uses Vercel's managed credits or its own API keys.
Per-user cost attribution: The Custom Reporting API returns per-user, per-day breakdowns across every provider, useful for teams running agents on behalf of end users who need to know if each account is profitable.
Zero-configuration AI SDK integration: A plain model string routes through the gateway by default in AI SDK v7, with OpenAI- and Anthropic-compatible endpoints available for teams not using the SDK.
Vercel AI Gateway cons:
No gateway-level response cache: Cached-read tokens are priced per model, but there's no documented exact-match caching layer at the gateway itself.
No content-safety or DLP tooling: Teams that need built-in prompt and response scanning have to build that layer themselves or add a third-party service.
Team-wide governance features carry a per-request fee: Team-wide ZDR and the provider allowlist each cost $0.10 per 1,000 successful requests on Pro and Enterprise, though per-request ZDR is free.
Best for: Vercel AI Gateway fits teams already building on Next.js or the AI SDK, teams that need cross-provider failover without configuring a fallback chain, and teams whose product economics depend on knowing what each end user costs to serve.
Pricing: AI Gateway charges provider list rates with zero markup on every token, including BYOK. The free tier includes $5 a month in credits and access to free-tier eligible models. Optional capabilities like team-wide ZDR, the provider allowlist, and Custom Reporting carry small per-request or per-write fees on top of token costs.
Copy link to headingWhere Vercel AI Gateway stands out
AI Gateway pulls ahead on reliability that requires no upfront configuration. Zo Computer's baseline for AI model calls ran a 98% success rate with a 7.5% retry rate before moving to AI Gateway. After the move, the retry rate fell to 0.34%, a 20x improvement, without the team building custom retry or fallback logic first.
That same ergonomic pattern extends to model adoption. Okara runs CMO agents for 120,000 companies and processes 4 billion tokens a day with a team of four, a scale where per-user cost visibility through the Custom Reporting API is closer to a unit-economics requirement than a nice-to-have.
Copy link to headingCloudflare AI Gateway for Workers-native teams
Cloudflare AI Gateway is a managed AI routing and observability proxy available on every Cloudflare plan, with analytics, caching, and rate limiting free of charge. It routes to 24 native providers, and Cloudflare added a universal REST endpoint in May 2026 that speaks OpenAI and Anthropic request formats alongside its own generic run format. Its main differentiator is native Workers AI integration: 50+ open-source models running on Cloudflare's own infrastructure at $0.011 per 1,000 Neurons, with 10,000 Neurons a day free, though that access only matters to teams already committed to Workers.
Copy link to headingPros and cons of Cloudflare AI Gateway
Cloudflare AI Gateway pros:
Free core features on every plan: Dashboard analytics, exact-match caching, and rate limiting cost nothing at any scale, with no credit purchase or plan upgrade required.
Native Workers AI access: Teams already on Workers get open-source model inference on Cloudflare's own infrastructure without leaving the platform.
Dynamic Routing with A/B testing: Conditional routing rules support percentage splits, geographic segmentation, and budget-based fallbacks, configured visually or as JSON.
Built-in content safety: Guardrails and DLP scan prompts and responses for policy violations and sensitive data without a third-party integration.
Cloudflare AI Gateway cons:
Manually ordered fallback array: Failover requires configuring the sequence in advance, and a fallback entry can route to a different model rather than the same one on another provider.
Log storage capped hard on the free plan: 100,000 logs total per account across every gateway, a limit a moderate-volume gateway clears in months, not years.
Unified Billing carries a credit fee: A 5% surcharge applies to every credit purchased through Cloudflare's managed billing option, on top of pass-through token rates.
BYOK still in Beta: Encrypted key storage and rotation across 20+ providers work today, but the feature hasn't reached general availability.
Best for: Cloudflare AI Gateway fits teams already running on Workers that want native Workers AI model access, plus low-volume or evaluation workloads where the free tier's log cap and manual fallback setup aren't yet a constraint.
Pricing: Core features are free on every plan. Unified Billing passes through provider token rates with a 5% fee on purchased credits. Workers AI models bill separately at $0.011 per 1,000 Neurons, with 10,000 Neurons a day free.
Copy link to headingWhere Cloudflare AI Gateway fits, and what that fit costs
Cloudflare's case is narrower than the free-tier headline suggests. Analytics, caching, and rate limiting cost nothing, and Dynamic Routing's percentage splits and geographic segmentation give teams evaluation and traffic-shaping tools that Vercel doesn't currently document an equivalent for. That fit holds mainly for teams already running Workers, Durable Objects, or other Cloudflare products, where the gateway shares a dashboard with the rest of the stack.
The tradeoff is what a team gives up to get there. None of those free features replace automatic same-model failover, and a team still has to build and maintain the fallback array itself before the first outage, not after.
Copy link to headingVercel AI Gateway vs. Cloudflare AI Gateway: which is right for your team?
For most teams shipping a production LLM feature, the reliability and cost-predictability gap makes Vercel AI Gateway the stronger default. Cloudflare AI Gateway earns a look in a narrower set of cases, mainly where a team is already committed to the Workers platform or only needs a free proxy for early evaluation.
Copy link to headingChoose Vercel AI Gateway for production reliability and Next.js teams
For a team already building on Next.js or the AI SDK, or any team taking an LLM feature to production, Vercel AI Gateway is the stronger call. The default-provider behavior means the model string is close to the entire integration, and the automatic failover removes a category of production incident that would otherwise need custom retry logic built and maintained in-house. Teams whose product depends on per-user cost attribution, or whose token volume makes a 5% credit surcharge a real line item, get a clearer answer from Vercel's zero-markup, zero-fee pricing.
Copy link to headingCloudflare AI Gateway is a narrower fit for Workers-committed teams
Cloudflare AI Gateway makes sense mainly for a team already standardized on Workers that wants Workers AI model access without adding a second vendor, or one running short-lived experiments where the free tier's log cap won't matter. Outside those cases, the manually ordered fallback array and the Unified Billing surcharge are costs that show up as soon as the workload leaves the experimentation stage.
Copy link to headingHow Vercel AI Gateway solves production reliability and cost problems
Teams moving an LLM integration to production run into the same handful of failures regardless of which gateway they start with. AI Gateway's design addresses the ones that show up most often once real traffic arrives.
Copy link to headingA single provider going down takes the whole feature with it
The pain shows up the first time a primary model provider has an incident during business hours. An application that calls one provider directly has no path around the outage, and the failure looks identical to a bug in the application even though nothing in the code changed.
AI Gateway's fallback rescued 3.5% of all requests and 5.1% of all tokens across seven months of production traffic, all without a team writing retry logic first. Zo Computer's retry rate fell from a 7.5% baseline to 0.34% after the move, a 20x improvement that came from moving retries, fallbacks, and provider health monitoring to the routing layer instead of building it in-house.
Copy link to headingPer-provider integration work multiplies with every new model
The pain that compounds quietly is integration debt. Every new provider a team wants to try means a new SDK, a new authentication flow, and new edge-case handling for that provider's specific error shapes.
Here's what switching models looks like with AI SDK v7, with no separate provider SDK to install:
import { streamText } from 'ai'
const result = streamText({ model: 'anthropic/claude-sonnet-4.6', prompt: 'Explain how AI Gateway routes requests.'})Passing a creator/model-name string is the entire integration in AI SDK v7. Switching providers or models is a config change rather than a new SDK to wire up, which is the same ergonomic pattern that let Cline's A/B test isolate a 10 to 14% P99 latency improvement without touching application code.
Copy link to headingNobody knows which end users are actually profitable
The pain that surfaces once an application serves other people's workloads, not just its own team, is unit economics. A shared model budget makes it hard to tell whether a specific customer or workflow is costing more than it earns.
AI Gateway's Custom Reporting API returns per-user, per-day breakdowns across every provider a team uses, BYOK included, in a single query. Okara runs CMO agents for 120,000 companies and 4 billion tokens a day with a team of four, and per-user cost visibility at that scale is closer to a requirement than a convenience.
Copy link to headingCompliance requirements get bolted on request by request
The pain that shows up under a security review is inconsistent data handling. Different requests routed through different providers can end up with different retention guarantees, and tracking that manually across every code path doesn't scale.
Team-wide ZDR routes every request through providers under a formal no-retention agreement with no code changes required, enforced from the dashboard. Per-request ZDR is free on Pro and Enterprise for workflows that only handle sensitive data some of the time.
Copy link to headingGet started with Vercel AI Gateway
Choosing between Vercel AI Gateway and Cloudflare AI Gateway comes down to which failure mode a team would rather manage: configuring a fallback sequence ahead of time, or trusting an automatic system to handle it as traffic scales. For teams building on Next.js or the AI SDK, and for teams whose growth curve is going to run into a log cap or a credit surcharge before it runs into anything else, AI Gateway removes both problems at the infrastructure layer.
Vercel AI Gateway gives a team:
Automatic cross-provider failover: No fallback array to configure before an outage happens.
Zero markup on every token: Including BYOK, with no percentage fee on credit purchases.
Per-user cost attribution: The Custom Reporting API breaks down spend by user, provider, and day.
Zero-configuration AI SDK integration: A model string is the entire integration in AI SDK v7.
Zero Data Retention, free per request: Team-wide enforcement available for $0.10 per 1,000 successful requests.
Start building at vercel.com/new, or deploy a working AI Gateway integration from vercel.com/templates.
Copy link to headingFrequently asked questions about Vercel AI Gateway vs. Cloudflare AI Gateway
Copy link to headingDoes Vercel AI Gateway work without the AI SDK?
Yes. AI Gateway exposes OpenAI Chat Completions and OpenAI Responses endpoints, plus an Anthropic Messages endpoint, so direct HTTP calls work without the SDK. The AI SDK remains the lowest-friction path for TypeScript teams already using it.
Copy link to headingCan I use my own API keys (BYOK) on both gateways?
Yes, with differences. Vercel's BYOK is available on paid plans at zero markup, and failed BYOK requests can retry with Vercel's system credentials billed against account credits. Cloudflare's BYOK is in Beta, with encrypted key storage and rotation across 20+ providers.
Copy link to headingDoes Cloudflare AI Gateway support semantic caching?
No. Cloudflare's cache keys on the full request body, exact match only, and semantic caching doesn't appear in either vendor's current first-party documentation.
Copy link to headingWhat happens when Cloudflare AI Gateway hits its log storage limit?
New logs stop saving once the account reaches the cap, with no fallback behavior documented past that point. The free plan allows 100,000 logs total across all gateways, the Workers Paid plan raises that to 10 million per gateway, and paid teams can export via Logpush for longer retention.
Copy link to headingIs it safe to route production requests through an AI gateway, latency-wise?
Yes. Cline's live A/B test comparing its previous router against Vercel AI Gateway found P99 streaming latency improved 10 to 14% and API error rates dropped 43.8%, with the gateway's architecture designed for sub-20ms global routing overhead.