What Cloudflare AI Gateway actually is
Cloudflare AI Gateway is a hosted control plane that sits between your application and model providers, running on Cloudflare's global edge network. Cloudflare operates it; there is nothing to self-host, and the gateway's source is not published (peripheral SDK packages in cloudflare/ai are MIT). Integration is a base-URL change, and the core product is free on every plan: analytics, caching, rate limiting, request logging, and DLP scanning cost nothing.
The product is moving fast. A REST API shipped on 2026-05-21 with a universal /ai/run endpoint plus OpenAI Chat, OpenAI Responses, and Anthropic Messages schemas. On 2026-08-07 Cloudflare merged Workers AI and AI Gateway into a single control plane with shared endpoints and billing. The providers page lists 24 named providers, Workers AI among them, including dedicated speech and media vendors such as Deepgram, ElevenLabs, and Fal.
Where Cloudflare is the right choice
Three things are genuinely strong. Price: the core gateway is free, and Unified Billing adds a 5% fee on credit purchases (a $100 purchase charges $105) with inference passed through at provider price. Routing: Dynamic Routing is a versioned visual editor with conditional branches, percentage splits for A/B tests, budget and rate-limit quotas that switch to fallbacks, and automatic retries on provider failures. Compliance: Cloudflare has held SOC 2 Type II since 2019 and carries ISO 27001, 27701, and 27018. If your stack already fronts through Cloudflare and procurement wants a large public company with a long audit history, it is a defensible default.
Prompt logging is the fork in the road
Cloudflare's logging is on by default and stores the user prompt and model response along with tokens, cost, and duration. Logs persist until you delete them or hit the storage cap: 100,000 logs total on free accounts, 10 million per gateway on Workers Paid ($5/month base). You can opt out per gateway or per request (cf-aig-collect-log). Since November 2025 there is also an opt-in Zero Data Retention mode that routes Unified Billing traffic to provider endpoints that do not retain content; Cloudflare's docs state it does not apply to BYOK.
TrustedRouter inverts the default. Ordinary synchronous and streaming inference does not write prompt or output content to persistent storage; what we keep is metadata: request ids, model and provider, token counts, latency, cost, region, and an API-key hash (privacy page). Batch is a separate opt-in mode with enclave-encrypted artifacts retained up to 30 days. Privacy is also routable per request: trustedrouter/zdr restricts to providers with cited zero-retention terms, trustedrouter/e2e restricts to confidential-compute providers with provider-side end-to-end encryption (currently tinfoil and phala), and trustedrouter/eu pins an EU-focused provider set. See /models for every route.
Verification: what can you actually check?
With Cloudflare, assurance is documentation and audits. Those are real, and the SOC 2 report is available under NDA, but the gateway's code is not published, so "logging is off" is a setting you take on trust.
Our gateway's source is public under BUSL-1.1 (source-available, converting to Apache-2.0 four years after each release; the SDKs are Apache-2.0 or MIT), and the running build is attested on three clouds: GCP Confidential Space, AWS Nitro Enclaves, and Azure Confidential Containers. Anyone can fetch a live attestation from the endpoints on trust.trustedrouter.com and check the measurement against published release digests with one script. The boundary is precise and worth stating plainly: attestation covers the gateway build, not downstream model providers. Provider retention on zdr routes is a contractual and policy tier, cited per provider; on the e2e routes the provider's own confidential-compute and E2EE mechanisms apply. Details are on /security.
Pricing, on stated bases
The two fee numbers look similar and sit on different bases. Cloudflare charges 5% when you purchase Unified Billing credits, then passes inference through at provider price; the mode covers 6 providers and is limited to 200 requests per 60 seconds per gateway, and the free core gateway adds no fee to traffic on your own provider keys. TrustedRouter charges the provider's token price plus 5.5% on each prepaid request, with a $0.01 per million token floor on free and near-zero routes; video is the provider quote plus 20%; there is no monthly fee (pricing). BYOK is supported on both sides; we do not publish a separate BYOK fee, while Cloudflare's core gateway adds no fee to BYOK traffic — compare against your own quote.
What we do not claim
We are young. Our repos have been public since late April 2026 and public benchmark history starts June 2026; Cloudflare's audit trail goes back years. We publish a DPA, BAA, and subprocessor list, but as of August 2026 we have no published SOC 2 or HIPAA certification. Our published pricing covers text, embeddings, and video generation; if you rely on Cloudflare's speech vendors (Deepgram, ElevenLabs, Cartesia), check /models for equivalents before committing. Our availability number is a published 99.99% target with live burn rates on the status page, and our on-page uptime history is short.
Moving over
If you call Cloudflare's OpenAI-compatible endpoints, the change is the base URL, the auth (Cloudflare API token to TrustedRouter key), and model naming. Everything configured in the Cloudflare dashboard stays there: dynamic routes, caching rules, spend limits, Guardrails and DLP policies, and Logpush jobs have no importable equivalent, and prepaid credits do not transfer. The code change is small; the config rebuild is the real work. Start with one streamed request and compare output, latency, and billed usage before moving traffic.