{"slug":"cloudflare-unified-billing","verification":{"valid":false,"broken_at":0,"reason":"prev mismatch"},"count":25,"sources":[{"id":"s1","type":"publisher_documentation","url":"https://developers.cloudflare.com/ai-gateway/features/unified-billing/","title":"Cloudflare AI Gateway — Unified Billing","publisher":"Cloudflare","date":"2026-06-22","quote":"A 5% fee is applied to all credits purchased through Unified Billing. For example, a $100 credit purchase will result in a $105 charge. Inference pricing from providers is passed through with no markup — you pay the same per-token rates as you would directly with the provider.","summary":"The fee, the no-markup pass-through, the two prerequisites (credits loaded, gateway authenticated), the supported provider list, the exclusion of Workers AI @cf/ models, the negative-balance caution, and the ZDR section. Positive on clarity of the fee, silent on the 402.","claim_ids":["c1","c11","c16","c2","c3","c4","c9"]},{"id":"s2","type":"publisher_documentation","url":"https://developers.cloudflare.com/ai-gateway/configuration/authentication/","title":"Cloudflare AI Gateway — Authenticated Gateway","publisher":"Cloudflare","date":"2026-06-17","quote":"The `AI Gateway Read`, `Run`, and `Edit` permissions cannot be restricted to a single gateway — unlike R2, which supports per-bucket scoping. Any token with `AI Gateway Run` can send requests through every gateway in the account, including any configured with stored provider keys through Bring Your Own Keys (BYOK), consuming those credentials.","summary":"The exact dashboard click path for turning authentication on, and the warning that AI Gateway token permissions are account-scoped. Also carries the behaviour table whose 'Off / No header → Request succeeds' row is contradicted by the measured 402 for Unified Billing. Negative on that row.","claim_ids":["c13","c4","c5"]},{"id":"s3","type":"specification","url":"https://developers.cloudflare.com/ai-gateway/usage/rest-api/","title":"Cloudflare AI Gateway — REST API","publisher":"Cloudflare","date":"2026-06-29","quote":"The `/ai/v1/messages` endpoint strictly uses Anthropic's API schema and supports routing to Anthropic and other third-party models. Workers AI models (`@cf/`) do not support this schema.","summary":"The reference the endpoint and model-id behaviour comes from: four endpoints with a per-endpoint support matrix, the author/model vs @cf/author/model naming rule, the cf-aig-gateway-id requirement, and the per-request cf-aig-* header table.","claim_ids":["c6","c7","c8"]},{"id":"s4","type":"publisher_documentation","url":"https://developers.cloudflare.com/ai-gateway/reference/pricing/","title":"Cloudflare AI Gateway — Pricing","publisher":"Cloudflare","date":"2026-05-19","quote":"AI Gateway's core features available today are offered for free, and all it takes is a Cloudflare account and one line of code to get started. Core features include: dashboard analytics, caching, and rate limiting.","summary":"Establishes the zero in the BYOK column of the money table: the gateway itself costs nothing, so the only Cloudflare charge in the Unified Billing route is the 5% credit surcharge.","claim_ids":["c2"]},{"id":"s5","type":"publisher_documentation","url":"https://developers.cloudflare.com/ai-gateway/features/spend-limits/","title":"Cloudflare AI Gateway — Spend limits","publisher":"Cloudflare","date":"","quote":"Spend limits are eventually consistent. The current request's cost is recorded after completion, so a burst of concurrent requests can briefly exceed the limit before enforcement catches up.","summary":"Confirms spend limits cover both Unified Billing and BYOK, that they block with 429, and that they are computed from the same per-request cost field the log rows carry. The eventual-consistency admission is why a 429 can arrive under budget.","claim_ids":["c12"]},{"id":"s6","type":"publisher_documentation","url":"https://developers.cloudflare.com/ai-gateway/configuration/bring-your-own-keys/","title":"Cloudflare AI Gateway — BYOK (Store Keys)","publisher":"Cloudflare","date":"2026-06-09","quote":"Ensure your gateway is authenticated.","summary":"The alternative route. Keys live in Secrets Store and the provider bills you directly — and the prerequisite list shows BYOK requires the same authenticated gateway Unified Billing does, so switching lanes does not remove that step.","claim_ids":["c14"]},{"id":"s7","type":"publisher_documentation","url":"https://developers.cloudflare.com/workers-ai/platform/pricing/","title":"Cloudflare Workers AI — Pricing","publisher":"Cloudflare","date":"","quote":"Workers AI is included in both the Free and Paid Workers plans and is priced at **$0.011 per 1,000 Neurons**.","summary":"The other ledger. Gives the unit and rate that a measured @cf/ call's neurons field converts into, which is how the Workers AI row of the money table is priced.","claim_ids":["c3"]},{"id":"s8","type":"publisher_documentation","url":"https://developers.openai.com/api/docs/pricing","title":"OpenAI — API pricing","publisher":"OpenAI","date":"","quote":"gpt-4.1-mini 0.4 0.1 1.6","summary":"OpenAI's own per-million rates for gpt-4.1-mini: $0.40 input, $0.10 cached input, $1.60 output. Used to test Cloudflare's no-markup claim against a real logged cost field, and to price the worked example.","claim_ids":["c10","c15"]},{"id":"s9","type":"publisher_documentation","url":"https://openrouter.ai/docs/faq","title":"OpenRouter — FAQ, what are the fees for using OpenRouter","publisher":"OpenRouter","date":"","quote":"OpenRouter charges a fee when you purchase credits. We pass through the pricing of the underlying model providers without any markup, so you pay the same rate as you would directly with the provider.","summary":"The other side of the disagreement over 'the same 5%'. Identical mechanism to Cloudflare's, but the rate rendered on the page is 5.5% with a $0.80 minimum for card payments and 5% for crypto — so the mechanism matches and the number does not.","claim_ids":["c16"]},{"id":"s10","type":"publisher_documentation","url":"https://platform.claude.com/docs/en/about-claude/models/overview","title":"Anthropic — Model overview and pricing","publisher":"Anthropic","date":"","quote":"Introductory pricing of $2 / $10 per MTok applies to Claude Sonnet 5 through August 31, 2026.","summary":"The published rate the measured Cloudflare cost field is reconciled against for anthropic/claude-sonnet-5, plus the standard $3 / $15 that replaces it after 2026-08-31 — which is what makes the last row of the money table move.","claim_ids":["c10","c15"]},{"id":"s11","type":"github","url":"https://github.com/cloudflare/ai/issues/548","title":"AI Gateway REST: /ai/v1/responses rejects Unified Billing on an authenticated gateway","author":"pemontto","publisher":"GitHub","date":"2026-05-30","quote":"POST to `/ai/v1/responses` with Unified Billing auth (`Authorization: Bearer {CF_API_TOKEN}` plus `cf-aig-gateway-id: {authenticated_gateway_id}`) returns HTTP 402 even though the gateway has `authentication: true`.","summary":"The canonical 402 report, filed on Cloudflare's own repository with a full curl reproduction: identical headers and model return 402 on /ai/v1/responses and 200 on /ai/v1/chat/completions, across openai/gpt-5.4, gpt-5.4-mini and gpt-5.5. Negative. Open with zero comments; did not reproduce on this account today, and both outcomes are published.","claim_ids":["c17","c5"]},{"id":"s12","type":"github","url":"https://github.com/anomalyco/opencode/issues/32951","title":"Cloudflare AI Gateway (Unified Billing) rejects `role: \"system\"` in messages array when proxying Anthropic models","author":"pmonte","publisher":"GitHub","date":"2026-06-19","quote":"Cloudflare AI Gateway Unified Billing routes requests to Anthropic's backend. When the model is `anthropic/*`, the gateway applies Anthropic's validation rules, which **do not accept `role: \"system\"` inside the `messages` array**.","summary":"The shape trap named precisely. opencode 1.17.8 against anthropic/claude-sonnet-4.6 failed on every request because the OpenAI-compatible client puts the system prompt in messages[0]. Negative — the OpenAI-compatible veneer leaks Anthropic's schema.","claim_ids":["c18","c7"]},{"id":"s13","type":"github","url":"https://github.com/withastro/flue/issues/327","title":"Support anthropic models via cloudflare's unified billing","author":"just-be-dev","publisher":"GitHub","date":"2026-06-20","quote":"have been leaning into cloudflare's AI gateway unified billing so that I don't have to provision keys for openai/anthropic directly. Ran into a bit of an issue where using anthropic's models in this way doesn't quite work.","summary":"States the motive plainly — no per-provider keys — then hits the same mismatch from the adapter side: the Cloudflare binding formats every cloudflare/... request as OpenAI chat-completions, which works for cloudflare/@cf/... ids and not for cloudflare/anthropic/claude-sonnet-4.6. Mixed, leaning negative; patched locally and verified from a bare setup.","claim_ids":["c18","c7"]},{"id":"s14","type":"hn","url":"https://news.ycombinator.com/item?id=48346648","title":"Comment on \"OpenRouter raises $113M Series B\" — the Cloudflare gateway is not free","author":"yencabulator","publisher":"Hacker News","date":"2026-05-31","quote":"Free? They take the same 5% fee as OpenRouter does.","summary":"Direct correction of a commenter who called Cloudflare's gateway the free option, citing the unified-billing docs page. Negative on the pricing-surprise axis, and the claim this page reconciles against OpenRouter's own published 5.5% + $0.80 card fee.","claim_ids":["c16"]},{"id":"s15","type":"hn","url":"https://news.ycombinator.com/item?id=47793121","title":"Comment on \"Cloudflare's AI Platform\" — no pricing on the models page","author":"bm-rf","publisher":"Hacker News","date":"2026-04-16","quote":"Not seeing any pricing info on the models[1] page. Wonder how much of a lift this is over paying providers directly. Perhaps Cloudflare is doing this at cost? Also interesting that zero data retention is not on by default","summary":"Read the launch docs and could not find pricing at all, and separately noticed zero data retention is off by default. Negative — the pricing-opacity complaint that precedes the later 5% discovery, and the earliest public note that ZDR is opt-in.","claim_ids":["c11","c19"]},{"id":"s16","type":"hn","url":"https://news.ycombinator.com/item?id=47793207","title":"Comment on \"Cloudflare's AI Platform\" — markup on token usage","author":"6thbit","publisher":"Hacker News","date":"2026-04-16","quote":"i wonder about their princing and potential markup on top of token usage?i presume they wont let you \"manage all your AI spend in one place\" for free.","summary":"Grants Cloudflare is well positioned network-wise but assumes a markup on token usage. Negative — the suspicion that turns out to be half right: there is a fee, but it sits on the credit purchase and not on the tokens, which the measured cost rows confirm.","claim_ids":["c15","c19"]},{"id":"s17","type":"github","url":"https://github.com/jeremyhart/claworc/pull/6","title":"Simplify Cloudflare AI Gateway to Unified Billing; fix migration guard","author":"jeremyhart","publisher":"GitHub","date":"2026-06-26","quote":"Cloudflare authenticates and bills the upstream provider, so no per-provider keys are needed.","summary":"Merged pull request rewriting a connector to drop the confusing \"Provider API Key\" plus separate \"Gateway Token\" pair in favour of a single Cloudflare API token with AI Gateway Run permission. Positive — the auth collapse is the payoff people are actually after.","claim_ids":["c1","c20"]},{"id":"s18","type":"github","url":"https://github.com/kyleboas/blob/pull/124","title":"Allow Cloudflare Unified Billing without upstream provider keys","author":"kyleboas","publisher":"GitHub","date":"2026-02-25","quote":"Cloudflare Unified Billing lets the gateway handle upstream authentication and billing, so provider API keys should be optional when routing through the AI Gateway.","summary":"Merged pull request fixing a callLLM that attached an upstream Authorization header on every gateway request and injected ANTHROPIC_API_KEY/OPENAI_API_KEY into agent inputs, blocking pure Unified Billing flows. Now requires only aiGatewayToken, with provider keys as an explicit BYOK fallback. Positive.","claim_ids":["c1","c20"]},{"id":"s19","type":"repository","url":"https://github.com/massoumicyrus/claude-code-cloudflare-gateway","title":"claude-code-cloudflare-gateway — a Worker that speaks Anthropic Messages and forwards to this surface","publisher":"GitHub","date":"","quote":"tools/contract-test.mjs","summary":"MIT-licensed reference implementation of the routing described here, including the anthropic/* lane and cf-aig-gateway-id handling, with a 21-check wire contract test and a capture tool that logs exactly what a client sends. Where a reader can read the code rather than trust the prose.","claim_ids":["c6"]},{"id":"s20","type":"independent_measurement","url":"https://miscsubjects.com/a/claude-code-on-cloudflare-ai-gateway","title":"Measured per-turn cost of coding traffic through the same gateway","publisher":"miscsubjects.com","date":"2026-07-25","quote":"MCP attached GLM-5.2 149,443 in / $0.20922644 / 10.9s; Kimi 149,187 in / $0.02852109","summary":"Independent of this page's own probes: per-turn token and cost figures captured with tools/capture-gateway.mjs and read back from gateway logs, for a real coding agent on the same account. Gives the 5% a denominator in monthly terms rather than per-request cents.","claim_ids":["c15"]},{"id":"s21","type":"runtime_receipt","url":"https://miscsubjects.com/a/cloudflare-unified-billing","title":"First-party: the 402 reproduced against two gateways, 2026-07-26","publisher":"miscsubjects.com","date":"2026-07-26","quote":"{\"errors\":[{\"message\":\"Gateway authentication is required to use unified billing. Enable authentication on your gateway or provide your own API key (BYOK).\",\"code\":2021}],\"success\":false,\"result\":{},\"messages\":[]}","summary":"Two POSTs to /ai/v1/chat/completions with model openai/gpt-4.1-mini, the same token and the same body, differing only in cf-aig-gateway-id: the gateway with authentication:false returned 402 code 2021, the gateway with authentication:true returned 200 with content 'ok' and usage 14/1. Method published in the article so it can be rerun.","claim_ids":["c13","c5"]},{"id":"s22","type":"runtime_receipt","url":"https://miscsubjects.com/a/cloudflare-unified-billing","title":"First-party: the anthropic/* shape trap and both working bodies, 2026-07-26","publisher":"miscsubjects.com","date":"2026-07-26","quote":"{\"errors\":[{\"message\":\"Model execution failed (User Input Error): Invalid value at messages[0].role: Invalid option: expected one of \\\"user\\\"|\\\"assistant\\\"\",\"code\":7003}],\"success\":false,\"result\":{},\"messages\":[]}","summary":"anthropic/claude-sonnet-5 on an authenticated gateway: an OpenAI-shaped body with role 'system' at messages[0] returned HTTP 400 with this error; the same body without the system message returned 200 but with no content field; /ai/v1/messages with a top-level system returned 200 with the text and gatewayMetadata keySource 'Unified'.","claim_ids":["c18","c21","c7"]},{"id":"s23","type":"runtime_receipt","url":"https://miscsubjects.com/a/cloudflare-unified-billing","title":"First-party: gateway log rows with the cost field, reconciled against published rates","publisher":"miscsubjects.com","date":"2026-07-26","quote":"\"tokens_in\":22,\"tokens_out\":4,\"cost\":0.00008400000000000001,\"authentication\":true,\"wholesale\":true,\"byok\":null","summary":"Three rows read back from GET /ai-gateway/gateways/default/logs for the calls made in this article. Each cost value equals tokens times the provider's published per-million rate to the digit, on two providers — the no-markup claim tested rather than repeated. wholesale:true is the Unified Billing marker; byok:null confirms no stored key.","claim_ids":["c10","c15","c22"]},{"id":"s24","type":"runtime_receipt","url":"https://miscsubjects.com/a/cloudflare-unified-billing","title":"First-party: /ai/v1/responses returned 200, so issue 548 did not reproduce here","publisher":"miscsubjects.com","date":"2026-07-26","quote":"\"object\":\"response\",\"model\":\"openai/gpt-4.1-mini\",\"status\":\"completed\",\"usage\":{\"input_tokens\":14,\"output_tokens\":2","summary":"POST /ai/v1/responses with openai/gpt-4.1-mini and cf-aig-gateway-id pointed at the authenticated gateway returned HTTP 200 with a full Responses envelope. Negative result for the endpoint-specific 402 in cloudflare/ai issue 548 on this account and model; the issue remains open and uncommented, so both are published rather than one being chosen.","claim_ids":["c17"]},{"id":"s25","type":"runtime_receipt","url":"https://miscsubjects.com/a/cloudflare-unified-billing","title":"First-party: a Workers AI model on the unauthenticated gateway, billed in Neurons","publisher":"miscsubjects.com","date":"2026-07-26","quote":"\"usage\":{\"prompt_tokens\":42,\"completion_tokens\":2,\"total_tokens\":44,\"prompt_tokens_details\":{\"cached_tokens\":0},\"neurons\":1.529652714729309}","summary":"@cf/meta/llama-3.3-70b-instruct-fp8-fast through the same gateway that 402s on provider/model returned HTTP 200 and reported neurons rather than a dollar cost. Direct evidence that the authentication requirement belongs to Unified Billing and not to the gateway, and that a working @cf/ call proves nothing about the configuration.","claim_ids":["c13","c3"]}]}