Vercel vs Cloudflare vs Portkey AI Gateway
Short answer: pick Cloudflare AI Gateway if you want free caching and observability at the edge, Vercel AI Gateway if your app already lives on Vercel and you want one billing surface for models, and Portkey if you need guardrails, per-team budgets and self-hosting. Below is the feature-by-feature breakdown.
Feature comparison: Vercel AI Gateway vs Cloudflare AI Gateway vs Portkey
| Capability | Vercel AI Gateway | Cloudflare AI Gateway | Portkey |
|---|---|---|---|
| Primary purposeWhat the product is designed to do first | Unified model access for apps built and deployed on Vercel | Observability, caching and rate limiting in front of model providers | Production LLMOps control plane: routing, guardrails, governance |
| Model coverageHow many providers/models are reachable through one API | Hundreds of models through the AI SDK provider interface | Major providers plus Workers AI models run on Cloudflare's own network | 1,600+ models documented across providers with one OpenAI-compatible API |
| Semantic / response cachingReuse answers for equivalent requests to cut spend | Not documented as a semantic cache | Yes — response caching with configurable TTL | Yes — simple and semantic caching modes |
| Guardrails and content policyInline checks on prompts and responses | Left to the application layer | Guardrails available alongside gateway policies | Yes — a guardrails library with pass/fail actions on request and response |
| PII redactionStrip sensitive data before it reaches a provider | Not documented | Available via guardrails configuration | Yes — PII detection and redaction guardrails |
| Fallbacks and retriesBehaviour when a provider errors or rate limits | Provider fallback supported through the AI SDK | Yes — fallback chains and request retries | Yes — conditional routing, load balancing, retries and fallbacks |
| ObservabilityLogs, traces and per-request cost visibility | Usage and spend inside the Vercel dashboard | Request logs, analytics and cost metrics per gateway | Full request logging, tracing, evals and cost analytics |
| Budgets and governancePer-team or per-key spend controls | Account-level credit and usage limits | Rate limiting per gateway | Virtual keys with budget limits and rate limits per team or workload |
| Deployment modelWhere the gateway runs | Fully managed by Vercel | Fully managed on Cloudflare's edge network | Managed cloud, plus self-hosted / hybrid for enterprise |
| Pricing shapeHow you are billed for the gateway itself | Model tokens billed through your Vercel account; gateway included in plan | Gateway is free; you pay providers directly (caching reduces provider spend) | Free tier, then per-request/seat tiers; enterprise for self-hosting |
Capabilities reflect each vendor's public documentation at time of writing. See our methodology for how we verify claims.
Which AI gateway should you choose?
Choose Vercel AI Gateway if…
- Your product already ships on Vercel and uses the AI SDK.
- You want one invoice covering hosting and model spend.
- Provider switching matters more than inline policy enforcement.
Choose Cloudflare AI Gateway if…
- You want caching, rate limiting and logs with zero gateway cost.
- Repeated prompts make response caching an immediate saving.
- Edge latency and existing Cloudflare infrastructure matter.
Choose Portkey if…
- You need guardrails, PII redaction and audit-grade logging.
- Per-team budgets and virtual keys are a governance requirement.
- Compliance pushes you toward self-hosted or hybrid deployment.
Where a routing gateway stops and a security gate starts
All three products are routing-first. They standardize provider access, cache responses and report spend — but only Portkey and Cloudflare document inline content controls, and none of them position themselves primarily as a prompt-injection defense layer. If your driving risk is untrusted input reaching a model, read the AI gate explainer and the prompt-injection prevention guide, then compare security-first platforms in our rankings.
Frequently asked questions
- What is the difference between Vercel AI Gateway, Cloudflare AI Gateway and Portkey?
- Vercel AI Gateway is a model-access layer for teams already deploying on Vercel — it standardizes provider access and billing inside the Vercel platform. Cloudflare AI Gateway is an edge proxy focused on caching, rate limiting and observability in front of any provider, and it is free to use. Portkey is the most complete control plane of the three, adding guardrails, virtual keys with budgets, conditional routing and self-hosting for regulated teams.
- Which one is cheapest?
- Cloudflare AI Gateway has no gateway fee — you keep paying model providers directly, and its response caching can cut provider spend on repeated prompts. Vercel folds model spend into your Vercel account. Portkey charges for the platform above a free tier, which usually pays for itself only when you need its governance and guardrail features.
- Which gateway has real security controls?
- Portkey is the strongest of the three on inline security, with a guardrails library covering PII detection, content checks and custom validators applied to both requests and responses. Cloudflare offers guardrails alongside its gateway policies. Vercel leaves content and injection defense to the application layer. If prompt-injection defense is the deciding requirement, look at dedicated AI security gates rather than a routing-first gateway.
- Can I self-host any of these?
- Only Portkey documents a self-hosted and hybrid deployment for enterprise customers. Vercel AI Gateway and Cloudflare AI Gateway are managed services that run on their respective platforms, so your traffic transits vendor infrastructure by design.
- Can I use more than one AI gateway?
- Yes, and chaining is common: an edge cache in front and a governance layer behind it, or a security gate ahead of a routing gateway. Verify your latency budget and decide which single layer owns policy enforcement, otherwise debugging blocked requests becomes painful.
Related: Cloudflare AI Gateway review · Portkey review · How to reduce AI token costs · Build your own comparison
The AI Gateway Brief
A weekly briefing on AI security threats, gateway technology, token economics, model routing, and the infrastructure controlling enterprise AI.