← Blog

Cloudflare AI Gateway Pricing: Logs, Guardrails, DLP, and Billing

Parminder Singh
Parminder Singh··6 min read
Summarize with AI

Cloudflare AI Gateway core features are free, while the complete cost depends on log storage and export, Workers AI guardrail inference, DLP entitlement, provider usage, and Unified Billing credits. Account age also determines whether gateway logs use Workers Logs or Legacy Logs, so two buyers can see different quotas for the same gateway product.

Comparisons & Alternativesai-securitycloud-securityllm-securityarchitecturepolicy-enforcement
Cloudflare AI Gateway Pricing: Logs, Guardrails, DLP, and Billing

Cloudflare AI Gateway's core features are free on all plans. The bill begins around the gateway: model-provider inference, Workers Logs or Legacy Logs, Logpush exports, Workers AI inference used by Guardrails, and prepaid credits purchased through Unified Billing. DLP scanning is free, but the available profiles depend on the account's Cloudflare Zero Trust entitlement. A useful estimate therefore starts with the account and route, not the word "free."

TL;DR

  • Cloudflare lists AI Gateway core analytics and caching, with rate limiting, as free on every plan.
  • Gateways first created on or after September 24, 2026 use Workers Logs; older gateway accounts use Legacy Logs with different limits.
  • DLP scanning is free, while profile breadth expands for accounts with a Zero Trust subscription that includes DLP.
  • Guardrails runs Llama Guard on Workers AI and incurs token-based Workers AI inference charges.
  • Unified Billing adds a 5% fee when credits are purchased, and credential precedence determines when those credits are used.

The free core excludes several cost owners

Cloudflare's AI Gateway pricing page says the product is available on all plans and identifies dashboard analytics and caching, with rate limiting, as free core features. Those capabilities make a useful entry point, but they do not erase the cost of the model being called or the systems used to retain and export evidence.

Build the estimate with separate ledger lines. Record provider inference first, then log ingestion and retention, log export, Guardrails inference, Zero Trust DLP entitlement, and Unified Billing credit fees. Add engineering and incident-response ownership because a free control can still create operational work.

I would reject a budget row that says "Cloudflare AI Gateway: $0." On a whiteboard, draw the request entering the gateway and the provider call leaving it. Add the log flowing to storage. Put a cost owner beside each arrow. The best AI gateway guide uses the same route-first approach for product selection.

Workers Logs and Legacy Logs create two price paths

Cloudflare assigns AI Gateway logs according to when the account created its first gateway. Accounts that created their first gateway on or after September 24, 2026 use Workers Logs and follow that product's pricing and retention. Accounts with an earlier gateway use Legacy Logs. Procurement should capture the actual account state rather than assuming a new documentation page describes every tenant.

The pricing page lists Legacy Logs storage limits of 100,000 logs total across all gateways on Workers Free and 10 million logs per gateway on Workers Paid. These are stored-log limits, not a universal monthly request allowance. Confirm deletion behavior and what happens when the limit is reached.

The current Workers Logs documentation lists 200,000 log events written per day with three days of retention on Workers Free. Workers Paid includes 20 million events per month, charges $0.60 per additional million under the displayed schedule, and retains logs for seven days. Cloudflare also says Workers Logs moves to Cloudflare Observability pricing on December 1, 2026. Save the quote and dated documentation used for the forecast.

Calculate daily events from production traffic and retries, plus errors and sampling settings. Then model the peak day and retained volume. The AI Gateway latency guide covers request-path measurement; logging needs its own capacity test because high traffic and verbose metadata can grow independently.

DLP is free with entitlement boundaries

Cloudflare states that DLP scanning in AI Gateway is free on all plans. An account without a Zero Trust subscription receives two predefined profiles: Financial Information and Social, Insurance, or National Identifier Numbers. An account with a Zero Trust subscription that includes DLP receives the broader account-level set. That entitlement covers Cloudflare's predefined and custom profiles as well as integration profiles, DLP datasets, and OCR.

Put the required profiles in the architecture worksheet and map each one to the existing Zero Trust entitlement. If OCR or a custom dataset is part of the requirement, confirm the underlying subscription and its commercial terms.

Test DLP on actual gateway routes. Cloudflare's profile availability does not prove that browser chat, local tools, or model calls bypassing the gateway are covered. Send a known test value through a nonproduction gateway and retain the event showing the matched profile and resulting action, plus whether the request or response was inspected.

Guardrails adds Workers AI inference

Cloudflare's pricing page says Guardrails evaluates prompts and responses with @cf/meta/llama-guard-3-8b on Workers AI. Usage is billed as token-based Workers AI inference, so cost scales with the text evaluated. A request inspected on input and output can create a different token total from a request inspected only once.

Forecast prompt and response tokens separately. Include retries and streaming behavior if they apply. Then use the current Workers AI rate for the exact model and date. Keep that rate outside the gateway's free-core line because it is a distinct metered service.

Guardrails is a content evaluation step. It should be tested for the configured categories, response action, latency, failure posture, and logging. Do not treat its presence as proof of employee authorization or data-destination policy. Those decisions require identity and organizational context on the route.

Unified Billing charges for purchased credits

Cloudflare's Unified Billing documentation says users pre-purchase credits and use them for Workers AI or supported third-party providers through AI Gateway. A 5% fee applies to credits purchased. Cloudflare's own example charges $105 for $100 of credits. Provider inference rates pass through without an additional per-token markup under the documented model.

The 5% charge occurs when credits are bought, while provider consumption draws down the credit balance. Record top-up size, auto top-up threshold, expected monthly inference, and treatment of any negative balance. Cloudflare says a negative balance can be charged to the payment method on file at the beginning of the following month.

Compare Unified Billing with direct provider billing after accounting for commitments, discounts, taxes, credits, and reconciliation work. A 5% credit fee can be acceptable when one invoice and managed credentials reduce operational overhead. It can also be unnecessary for a team that already has favorable provider contracts and mature credential management.

Credential precedence determines who pays

Credential resolution can change the bill without changing the request URL. Cloudflare checks first for provider authentication supplied on the request and forwards it unchanged. In its absence, the gateway uses BYOK stored under the default alias. Unified Billing applies only when neither source is available.

The default-alias rule needs an acceptance test. On Unified Billing endpoints, a stored key under another alias such as production does not prevent fall-through to Unified Billing. The cf-aig-byok-alias header selects a non-default alias only on direct provider-passthrough requests. Cloudflare also offers a setting that requires provider credentials to prevent third-party requests from falling through to Unified Billing.

Send three controlled requests and inspect the resulting charges: one with a request-level provider key, one using the stored default key, and one with neither. Then repeat a missing-key case after enabling the credential requirement. This test is cheaper than discovering the precedence rule from a month-end credit drawdown.

Logpush and Workers Logs solve different jobs

Workers Logs provides native retention and analysis for eligible accounts. Logpush exports AI Gateway logs to an external destination. Cloudflare says Logpush is available to all AI Gateway customers and bills exported and transformed volume according to Logpush pricing.

Include both only when the architecture needs both. Short native retention can support immediate debugging, while Logpush sends records to a SIEM, data lake, or longer-retention store. Estimate events, average bytes, transformation, destination ingestion, storage, and query costs. Validate redaction and access control before exporting prompt or response content.

The DeepInspect and Cloudflare AI Gateway comparison covers policy boundaries. Pricing should follow the selected job: routing and caching, content controls, evidence export, or identity-aware authorization.

DeepInspect

DeepInspect evaluates authenticated HTTP model requests deliberately routed through its proxy. It binds application-supplied identity and role to a versioned policy that evaluates data classification and destination, then records the outcome outside the calling application's write path.

Cloudflare AI Gateway can remain the routing, caching, provider-billing, and content-control layer where those features fit. DeepInspect addresses the separate decision of whether a specific user or agent may send a given data class to that model route. Price the layers against their own traffic and evidence requirements. Book a technical deep dive at deepinspect.ai.

Frequently asked questions

Is Cloudflare AI Gateway free?

Its core dashboard analytics, caching, and rate limiting are listed as free on all plans. Provider inference, Workers Logs or Legacy Logs, Logpush, Guardrails on Workers AI, broader DLP subscriptions, and Unified Billing credit fees can create costs around that core.

Which log system will an account use?

Cloudflare says accounts whose first gateway was created on or after September 24, 2026 use Workers Logs. Earlier gateway accounts use Legacy Logs. Check the actual tenant and preserve the applicable limits in the quote worksheet.

How much does Unified Billing add?

Cloudflare applies a 5% fee when credits are purchased. Its documentation gives the example of a $100 credit purchase producing a $105 charge. Provider per-token rates are passed through without an added inference markup under the current description.

Is Cloudflare AI Gateway DLP free?

DLP scanning is free on all plans, but available profiles differ. Accounts without an eligible Zero Trust subscription receive two predefined profiles. Accounts with a Zero Trust subscription that includes DLP receive the broader profile set described by Cloudflare.

Do Guardrails use the free gateway core?

The gateway integration sits in AI Gateway, but evaluation runs on Workers AI using Llama Guard and is billed as token-based inference. Forecast the evaluated prompt and response tokens with the current Workers AI rate.