2027 planning guide — evidence checked 20 November 2026

What is a good alternative to Cloudflare AI Gateway?

Cloudflare AI Gateway is a strong edge proxy. It is not a model provider, and its logging, caching and cost model assume you already have provider accounts. A useful alternative is therefore a role decision before it is a vendor decision.

Short answer. Keep Cloudflare AI Gateway for edge caching, rate limiting and logs over your own provider keys. Choose Plugsky when you want models, billing and one API in a managed service; Vercel for an AI SDK-native gateway with no token markup; LiteLLM for self-hosted control; Portkey for guardrails; OpenRouter for catalogue breadth; Helicone for observability. Compare the role first, then the price.

Cloudflare sits between your application and an upstream provider, adding analytics, logging, caching, rate limiting, retries and routing. It works with Workers AI, OpenAI, Anthropic, Gemini and others, and its core features are free. The upstream provider still serves the request and governs the data.

How we evaluated this

We weighted five criteria for a team that already has a provider account and is deciding whether to add a gateway.

  • Role fit, 30%. Whether you need a proxy over your keys or a managed model service.
  • Logging and retention, 20%. What is captured, where it lives, who can read it and how it is deleted.
  • Caching semantics, 20%. Exact match, semantic match, key construction and TTL.
  • Key custody, 15%. BYOK, key rotation and what happens if a provider header is present.
  • Cost shape, 15%. Free core, credit fees, log storage and add-ons.

We read Cloudflare's pricing, caching, logging and BYOK documentation and Vercel's AI Gateway pricing page on 20 November 2026. We did not run a latency test, a cache hit-rate test or a security review.

Gateway, aggregator or model API

Roles and published terms, checked 20 November 2026
OptionRoleLoggingCachingBYOKCost shape
Cloudflare AI GatewayEdge proxy over your providersDefault on; payload suppressionExact match, text and imagesSecrets Store, aliases, rotationCore free; add-ons billed
PlugskyManaged model APIRequest and audit logsNot a gateway cacheVendor-managed keysFlat $8–$120/month
Vercel AI GatewayHosted gatewayRequest logs and routing attemptsProvider prompt cachingYes, no markupNo token markup; add-ons
LiteLLMSelf-hosted proxyYour callbacks and storageDepends on configured backendsYour keysProvider spend plus infrastructure
PortkeyHosted or self-hosted gatewayConfigurable tracesSimple and semantic optionsYour keysUsage or enterprise
OpenRouterAggregatorActivity logs and exportProvider-dependentYes, with allowanceList price plus credit fee
HeliconeObservability proxyRequest traces and analyticsResponse cacheYour keysUsage-based
Direct provider SDKNo gatewayProvider-native onlyProvider-native onlyYour keysProvider list price

The table is a role map. A gateway keeps your provider accounts; a managed API serves the models; an observability proxy focuses on traces.

What Cloudflare does well

Cloudflare's core gateway features are free: analytics, caching and rate limiting. For a Cloudflare team, that is a low-friction way to see token usage, cache repeated prompts and cap requests without changing providers. DLP is also free, with two predefined profiles for accounts without a Zero Trust subscription.

Logging is the decision most teams underestimate

Logs are enabled by default for each gateway. You can turn collection off globally or per request with cf-aig-collect-log, and suppress request and response bodies with cf-aig-collect-log-payload: false while keeping metadata. That is a privacy control, not a retention policy.

Retention depends on when the account created its first gateway. Gateways created on or after 24 September 2026 use Workers Logs and its pricing and retention. Older gateways use Legacy Logs: 100,000 logs on Workers Free, 10,000,000 per gateway on Workers Paid. Ask where logs live, how long they remain, who can read payloads, whether you can export them and what happens on deletion.

Caching is exact match, not semantic

Cloudflare caches text and image responses for identical requests only. The key hashes the provider, endpoint, model, provider auth header and full body, so any change is a miss and rotating a key changes the key. TTL is 60 seconds to one month; the cache is volatile and semantic caching is planned, not available.

That suits a support bot with a small set of repeated questions. It is close to useless for an agent whose prompt changes every turn. If semantic caching is required, test hit rate on real prompts, and be careful with agents where a similar prompt needs a different answer.

BYOK and key custody

Cloudflare stores provider keys in Secrets Store, supports multiple aliases per provider and allows rotation without code changes. It substitutes the stored key only when the provider authorization header is absent; if you send a provider header, Cloudflare forwards it. A stale header silently bypasses BYOK.

Plugsky is a different model: it serves the models, so key custody is vendor-managed by default. That is simpler, but it is not a gateway over your own accounts. Decide whether you are buying a control plane over your keys or a managed model service.

Cost math: the gateway is not the whole bill

Assume 50 million tokens a month at a 70/30 input-to-output mix on a model priced at $2.00 input and $10.00 output per million. Token spend is $220 before any gateway fee.

50M tokens: 35M x $2.00 + 15M x $10.00 = $70 + $150 = $220

Cloudflare core:                 $0 gateway fee
Cloudflare Unified Billing:      5% fee on credits = $11.00
Vercel AI Gateway:               no token markup = $220
OpenRouter Standard:             5.5% credit fee = about $232.10
Plugsky Builder:                 $60 flat, no monthly token cap

This is not apples-to-apples. A gateway bill sits on top of provider tokens; a managed API bill replaces them. The $60 plan is cheaper because it is a different product with a different catalogue and fair-use limits. Use the math to size the gateway fee, not to declare a winner.

When Cloudflare AI Gateway is the better choice

Cloudflare wins when you are already on Cloudflare, want free core analytics, caching and rate limiting, and intend to keep your provider accounts. It also wins when edge DLP, Workers integration or one view of spend matters more than a managed catalogue.

When Plugsky is the better choice

Plugsky wins when you do not want to manage provider keys, contracts and per-token bills separately, and you want one OpenAI-compatible API with 39 documented IDs. Builder and Scale have no monthly token cap or per-token overage; fair-use concurrency and RPM apply. Private VPC, on-premises and air-gapped deployment are contract-led. See the model catalogue and the OpenRouter comparison.

What we did not verify

We did not measure gateway latency, cache hit rate, log volume or DLP accuracy. We did not verify Workers Logs retention beyond the documentation, guardrail costs, Logpush bills or enterprise terms. We did not audit LiteLLM, Portkey or Helicone; their rows are role descriptions. We did not verify OpenRouter's current fee or Vercel's add-ons beyond the pages we read.

For Plugsky, we did not verify a SOC 2 certification. Request the current SOC 2 report or attestation under NDA and verify the period. Audit-log retention and SIEM export are contract questions.

Frequently asked questions

Is Cloudflare AI Gateway free?

Core features — dashboard analytics, caching and rate limiting — are free on all plans. Logs follow Workers Logs pricing and retention for new gateways; Unified Billing adds a 5% fee on credits; guardrails bill as Workers AI; Logpush bills by volume.

Does Cloudflare cache semantic matches?

No. Caching is exact-match only for text and image responses, with a TTL from 60 seconds to one month. Any change to the request body or provider key creates a miss. Semantic caching is planned, not available.

Which alternative is best for BYOK?

LiteLLM, Portkey, Vercel AI Gateway and Helicone let you keep your own provider keys. OpenRouter offers BYOK with an allowance. Plugsky is a managed model service, with vendor-managed keys rather than a gateway over your accounts.

How much latency does a gateway add?

There is no single number. Cloudflare runs at the edge but still calls the upstream provider; hosted gateways add a hop; self-hosted gateways add your infrastructure. Measure p50 and p95 time to first token on your own prompts.

Can I migrate without changing my application?

If the gateway exposes an OpenAI-compatible endpoint, you usually change the base URL, key and model ID. Then replay a golden set, compare logs, cost and error rates, and cut over by workload with a rollback path.

When is a gateway the wrong layer?

When you want the vendor to serve the models, own the uptime and bill one flat plan. A gateway adds control over your providers; it does not remove the provider relationships or the per-token bill.

Sources

Last checked 20 November 2026. Cloudflare and Vercel change plans and features; verify the current docs before standardising. Not paid.