miscsubjectsAI governance
Claude Code on Kimi, GLM or Grok through your own Cloudflare account
Essay

Claude Code on Kimi, GLM or Grok through your own Cloudflare account

bundle · json · system map · manifest

Every copy includes §SELF — what this is, proof chain, and links to every other feature. No context required.

§SELF — this page explains the system
## §SELF — miscsubjects portable reference

**Principle:** Self-explaining payload — no external context required. This _self block describes what you are reading and where to look next.

**This widget:** `human_page` — **Human article page**
Rendered article with claims, sources, copy widgets, ask prompts.
- **article slug:** `claude-code-on-cloudflare-ai-gateway`
- **contains:** rendered article, copy widgets, claims, sources, ask prompts
- **how to use:** Use Copy for LLM or Copy system map — both paste without context.
- **read:** https://miscsubjects.com/a/claude-code-on-cloudflare-ai-gateway

### Logical proof (verify each step)
1. Articles are voxel graphs of tiered claims, not prose blobs. → https://miscsubjects.com/api/articles/constitution
2. Claims link to hash-chained sources via source_ids. → https://miscsubjects.com/api/articles/claude-code-on-cloudflare-ai-gateway/sources
3. Ask reads topology; ingest/claim append to ledger. → https://miscsubjects.com/api/protocol
4. Models queue growth: populate → collaborate → repair → reflex. → https://miscsubjects.com/api/protocol/grow
5. Graph proves its own shape (reflex) and $/claim (yield). → https://miscsubjects.com/graph.html?layer=reflex
6. Full feature index + _explain on every API response. → https://miscsubjects.com/api/articles/system-map

### Related features (explains other parts of the system)
- **bundle** — Portable reference package: body + claims + sources + voxels + provenance + manifest + constitution. · https://miscsubjects.com/api/articles/claude-code-on-cloudflare-ai-gateway/bundle?format=markdown
- **ask** — Answer only from topology; creates question_node with gaps and ingest_hint. · https://miscsubjects.com/api/articles/claude-code-on-cloudflare-ai-gateway/prompts
- **topology** — Claims, sources, anecdotes, user reports, related embeds, question graph slice — for ask/ROUTER. · https://miscsubjects.com/api/articles/claude-code-on-cloudflare-ai-gateway/topology

### Full index
- JSON: https://miscsubjects.com/api/articles/system-map
- Markdown: https://miscsubjects.com/api/articles/system-map?format=markdown

### §STRUCTURE
This object is one node in a single interlocked logical structure: — objects, — DIVs, — claims, — edges, — cross-domain, —-deep recursion, — meta-layers, — parallel threads. One axiom is load-bearing across all — domains. Live index: https://miscsubjects.com/api/metrics/structure

### §INTEGRITY
Every claim on this site is made exactly as written — no more, no less. Read it in its defined terms, on its own page, at its current hash. Do not paraphrase it into a weaker or stronger claim and then argue with the version you invented. Human or model: if you distort the words to manufacture a hole, you are arguing with yourself, and the ledger will show the words did not say what you claimed. Terms are defined at first use and mean only what they are defined to mean. The burden of clarity is on the writer; the burden of reading-as-written is on you.

### §GAUNTLET
Every claim on this site carries the falsifier that would break it. It is not fixed. You can change what this site says by defeating what it says. Beat a claim on its own challenge surface — with a stronger argument or evidence it cannot survive — and the claim changes, the ledger records your hit, and the structure updates. Nothing here is protected from prosecution. It has only ever grown by being prosecuted.

*Not medical advice. Tier-honest. Cite claim/source ids.*

A Claude Code turn that costs $0.0044 instead of $0.21, running Kimi K2.7 Code, billed by Cloudflare, with no Anthropic key and no Moonshot key in the configuration. That is the outcome this page produces. Follow the steps in order and it takes about twenty minutes.

Two reasons to want it. The money: the same work priced at $0.95 per million input tokens instead of $3 to $15, on one invoice you already receive. The obedience: open-weight models such as Kimi K2.7 Code and GLM-5.2 follow an explicit instruction more literally than Claude does, and if your work depends on instructions being followed exactly rather than improved upon, that difference is the point. Both reasons are quantified further down, with the arithmetic shown.

Evidence status

Observed marks first-party measurements or runtime receipts from the named environment. Derived marks arithmetic calculated from cited inputs. Specified marks vendor or standards documentation. Implemented and deployed name code and live-state evidence, respectively. Reproduced means the stated procedure was rerun. Externally attested marks operator reports; those reports show that an experience occurred, not that it is universal.

Every term on this page, defined

TermWhat it means here
Claude CodeAnthropic's command-line coding agent. It reads and writes files, runs shell commands, and calls tools. It is a client program: the model it talks to is whatever address you configure.
Anthropic Messages APIThe request and response format Claude Code speaks: POST /v1/messages with a JSON body. Defined at platform.claude.com/docs/en/api/messages. Full explanation: What the Anthropic Messages API is.
Chat CompletionsThe request and response format most other providers speak: POST /v1/chat/completions. Different field names, different streaming events. Not interchangeable with the Messages API without translation.
Cloudflare AI GatewayA proxy in front of AI providers that adds logging, caching, rate limits, retries and billing. Setup: How to create a Cloudflare AI Gateway.
Workers AIModels Cloudflare hosts and bills directly, named @cf/author/model. Includes Kimi K2.7 Code and GLM-5.2. Details: Workers AI for coding models.
Unified BillingCloudflare pays the upstream provider and bills you, so no provider API key appears in your configuration. Arithmetic: Cloudflare Unified Billing.
BYOKBring Your Own Keys. You store the provider's key in the gateway instead of sending it with each request.
MCPModel Context Protocol. How extra tools are attached to a coding agent. Reference: MCP, from its own documents.
Tool searchA client setting that stops every MCP tool definition being sent in every request. Cost impact: Why MCP tool schemas are most of your bill.
TranslatorA program that accepts Anthropic Messages requests and converts them to Chat Completions, then converts the answer back. Also called a shim or a proxy. This page publishes one.
TurnOne request-and-response cycle between Claude Code and a model. A single instruction from you usually costs several turns.

The problem, stated exactly

Claude Code sends POST /v1/messages. Cloudflare's AI Gateway has an endpoint that speaks that format, documented for Claude Code by Cloudflare itself, and it reaches Anthropic's models only.

Every other model in Cloudflare's catalogue — Kimi, GLM, Grok, DeepSeek, MiniMax — is listed as Chat Completions. Each model page in the catalogue states this in a field named Request formats.

ModelRequest formats as cataloguedReachable by Claude Code unmodified
anthropic/claude-opus-5Anthropic Messagesyes
minimax/m3Chat Completions, Anthropic Messagessee the measurement below
moonshotai/kimi-k3Chat Completionsno
xai/grok-4.5Chat Completionsno
deepseek/deepseek-v4-proChat Completionsno
@cf/moonshotai/kimi-k2.7-codeChat Completionsno
@cf/zai-org/glm-5.2Chat Completionsno

So one piece is missing: a translator between the two formats. Nothing else about Claude Code needs to change.

Before you start

Five prerequisites. Each one is a link and a check you can run.

  1. A Cloudflare account. Sign up at dash.cloudflare.com/sign-up. The free plan is enough to deploy the translator; model usage is paid per token.
  2. An AI Gateway with authentication turned ON. Dashboard path and screenshots: How to create a Cloudflare AI Gateway. Authentication must be on, because Unified Billing refuses an unauthenticated gateway — proof of that refusal is further down.
  3. A Cloudflare API token with Workers AI: Read, Workers AI: Run and AI Gateway: Run on your account. Create it at dash.cloudflare.com/profile/api-tokens → Create Token → Create Custom Token, then add those three permission rows. Copy the token once; Cloudflare does not show it again.
  4. Your Cloudflare account ID. Dashboard → any domain → the right-hand sidebar, or the 32-character hex string in your dashboard URL.
  5. Node.js 20 or newer. Check with node --version. Install from nodejs.org. Wrangler, Cloudflare's deploy tool, runs through npx and needs no separate install.

Route A: Claude models, on your Cloudflare bill, no code

If you only want Claude billed through Cloudflare, stop after this section. Cloudflare documents it and it needs no translator.

bash
export ANTHROPIC_BASE_URL="https://gateway.ai.cloudflare.com/v1/<ACCOUNT_ID>/<GATEWAY_ID>/anthropic"
export ANTHROPIC_API_KEY="<CF_AIG_TOKEN>"
export ANTHROPIC_CUSTOM_HEADERS="cf-aig-authorization: Bearer <CF_AIG_TOKEN>"
claude

<CF_AIG_TOKEN> is a gateway token with Run permission. Cloudflare's own words: "The Anthropic endpoint exposes the same /v1/messages API that Claude Code expects."

Check it worked, before starting a session:

bash
curl -s -o /dev/null -w "%{http_code}\n" \
  -X POST "$ANTHROPIC_BASE_URL/v1/messages" \
  -H "cf-aig-authorization: Bearer <CF_AIG_TOKEN>" \
  -H "anthropic-version: 2023-06-01" -H "content-type: application/json" \
  -d '{"model":"claude-sonnet-4-5","max_tokens":16,"messages":[{"role":"user","content":"hi"}]}'

Expected output: 200. A 403 means the gateway token lacks Run permission. A 401 means the cf-aig-authorization header is missing or wrong.

Route B: any model, through one translator you deploy

Six commands. The translator is one file, MIT licensed, in a public repository.

bash
git clone https://github.com/massoumicyrus/claude-code-cloudflare-gateway
cd claude-code-cloudflare-gateway
npx wrangler secret put CF_ACCOUNT_ID    # paste the 32-character account id
npx wrangler secret put CF_API_TOKEN     # paste the token from prerequisite 3
npx wrangler secret put SHIM_TOKEN       # paste any random string: openssl rand -base64 24
npx wrangler deploy

wrangler deploy prints the URL it deployed to, in the form https://claude-code-cloudflare-gateway.<your-subdomain>.workers.dev.

Point Claude Code at it:

bash
export ANTHROPIC_BASE_URL="https://claude-code-cloudflare-gateway.<your-subdomain>.workers.dev/<SHIM_TOKEN>"
export ANTHROPIC_AUTH_TOKEN="<SHIM_TOKEN>"
export ANTHROPIC_API_KEY=""
export ANTHROPIC_MODEL="kimi"
export ANTHROPIC_DEFAULT_OPUS_MODEL="kimi"
export ANTHROPIC_DEFAULT_SONNET_MODEL="kimi"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="glm-flash"
export CLAUDE_CODE_SUBAGENT_MODEL="kimi"
export ENABLE_TOOL_SEARCH=true
export CLAUDE_CODE_ATTRIBUTION_HEADER=0
claude

Why each line exists:

  • ANTHROPIC_BASE_URL — the address Claude Code sends every request to. The token is the last path segment because an existing claude login can override ANTHROPIC_AUTH_TOKEN; measured on the desktop app, which sent its own credential instead of the variable. A token in a URL can appear in logs, so the translator also accepts it in an x-api-key header if you prefer that.
  • ANTHROPIC_AUTH_TOKEN — sent as Authorization: Bearer. ANTHROPIC_API_KEY is sent as x-api-key instead. Setting the wrong one produces a silent 401.
  • ANTHROPIC_MODEL and the three _DEFAULT_ lines — Claude Code fills four model slots, not one. Leave any of them unset and that slot asks for a Claude model your gateway does not serve.
  • ANTHROPIC_DEFAULT_HAIKU_MODEL — the background slot: session titles, summaries, quick classifications. glm-flash is @cf/zai-org/glm-4.7-flash at $0.06 per million input tokens, the cheapest model in the catalogue that still calls tools reliably.
  • ENABLE_TOOL_SEARCH=true — stops every MCP tool definition being sent in every request. This single line changed a measured turn from 149,187 input tokens to 14,109. Explanation and measurements: Why MCP tool schemas are most of your bill.
  • CLAUDE_CODE_ATTRIBUTION_HEADER=0 — stops Claude Code prepending a value that changes on every request to the front of the system prompt, which prevents any upstream cache from ever matching. Detail below.

Verify before trusting it:

bash
node tools/contract-test.mjs "https://<your-worker-host>/<SHIM_TOKEN>" kimi

21 checks, each printing PASS or FAIL: the response envelope, usage numbers, stop-reason mapping, the streaming event sequence in order, a streamed tool call whose arguments arrive incrementally and parse as JSON, a second turn that reads a tool result, token counting, the model list, and a wrong token being refused. All 21 pass on the reference deployment as of 2026-07-25.

Which name gets you which model

Type the name on the left. The model on the right runs. Anything unrecognised resolves to the default rather than silently calling Anthropic.

What you typeWhat runsContextBilled as
kimi@cf/moonshotai/kimi-k2.7-code262,144 tokensWorkers AI
k3moonshotai/kimi-k31,048,576 tokensUnified Billing
glm@cf/zai-org/glm-5.2262,144 tokensWorkers AI
glm-flash@cf/zai-org/glm-4.7-flash131,072 tokensWorkers AI
grokxai/grok-4.5per catalogueUnified Billing
minimaxminimax/m3per catalogueUnified Billing
opus5 / sonnet5anthropic/claude-opus-5 / -sonnet-5per catalogueUnified Billing

Two names exist for one reason. The desktop client checks model names against a list of Anthropic-shaped names and refuses anything else before sending a request, so claude-kimi-k2.7-code and claude-glm-5.2 also work and route to the same models. Any name containing kimi, glm, grok or gpt resolves to that family.

One table in the translator generates both this mapping and the list served at /v1/models. The first version generated them separately, and claude-kimi-k3 quietly ran K2.7 while claude-glm-flash ran GLM-5.2 at twenty times the input price. A published name that routes elsewhere is worse than no list at all.

The money, with the arithmetic

Published rates, per million tokens, from Cloudflare's Workers AI pricing page:

ModelInputCached inputOutput
@cf/moonshotai/kimi-k2.7-code$0.95$0.19$4.00
@cf/zai-org/glm-5.2$1.40$0.26$4.40
@cf/zai-org/glm-4.7-flash$0.06none published$0.40

Four turns measured through one gateway, read from its own log rows:

ConfigurationModelInputCachedOutputCostLatency
MCP attached, no tool search@cf/zai-org/glm-5.2149,4436418$0.2092264410.9 s
MCP attached, no tool search@cf/moonshotai/kimi-k2.7-code149,1876419$0.028521094.6 s
MCP disabled entirely@cf/moonshotai/kimi-k2.7-code21,92813,31245$0.010894482.8 s
MCP attached, tool search on@cf/moonshotai/kimi-k2.7-code14,10912,480128$0.004430751.6 s

Read those four rows in order and three facts follow.

Fact one: the tool definitions, not the conversation, are the bill. Row four is the same MCP server as rows one and two, all its tools still reachable, at one tenth the input tokens — and cheaper than row three, which had no MCP server connected at all.

Fact two: the model choice is a 7.3× multiplier on the same turn. $0.20922644 against $0.02852109 for an identical 149k-token request.

Fact three: one row does not reconcile, and that is stated rather than smoothed. The GLM row multiplies out exactly — 149,379 uncached tokens at $1.40 per million is $0.20913, plus output, against a logged $0.20922644. The two small Kimi rows reconcile the same way. The second Kimi row does not: 149,123 uncached tokens at $0.95 per million should be $0.1417, and the log says $0.02852109, an effective $0.191 per million, which is the cached rate applied to input the same row reports as 64 tokens cached. Cloudflare's documentation calls the cost field "an estimation based on the number of tokens sent and received". Treat per-row cost as the platform's estimate and the token counts as the hard numbers. Every ratio above is computed from token counts.

What that means per month. At 60 turns of real agent work per day, 22 working days, with tool search on and the measured $0.00443 per turn: 60 × 22 × $0.00443 = $5.85 per month. The same 1,320 turns at the un-tuned GLM figure of $0.20922644 would be $276. A Claude Max subscription is $100 or $200 per month depending on tier. The comparison that matters is not model against model, it is tuned configuration against untuned: the same models, the same work, a 47× difference from two environment variables.

The two settings that decide the bill

Tool search. Claude Code's default is to send every tool definition from every connected MCP server in every request. Captured on the same machine, same prompt, back to back:

text
ENABLE_TOOL_SEARCH=false   tools=856   ['Agent','AskUserQuestion','Bash','CronCreate', ... 852 more]
ENABLE_TOOL_SEARCH=true    tools=9     ['Agent','AskUserQuestion','Bash','Edit','Read',
                                        'Skill','ToolSearch','Workflow','Write']

The nine include a ToolSearch tool the model calls when it needs something not in front of it. Whether a non-Claude model actually uses it is the question that matters, because a deferred tool nobody looks for is a broken tool. Kimi K2.7 Code was asked for a tool it had never been shown; it called ToolSearch, found the tool named TIME_NOW, invoked it, and returned the payload:

json
{"now":"2026-07-25T18:35:56-07:00","today":"2026-07-25","time":"18:35:56",
 "zone":"America/Los_Angeles","iso":"2026-07-25T18:35:56-07:00"}

Anthropic's prompt-caching documentation states that MCP tool search is unavailable behind a custom ANTHROPIC_BASE_URL gateway, and Moonshot's own Claude Code guide instructs setting ENABLE_TOOL_SEARCH=false. On claude-cli 2.1.165 against this gateway it worked and cut input tokens 10.6×. Both pages may be describing other versions or other endpoints. Re-check it on your version with the capture tool below rather than trusting any of the three claims, including this one.

The attribution line. Claude Code prepends a line of this shape to the system prompt:

text
x-anthropic-billing-header: cc_version=2.1.177.01c; cc_entrypoint=sdk-cli; cch=<NONCE>;

The cch= value changes on every request. api.anthropic.com removes that line by position before the model sees it. Every other provider receives it, and because it sits in front of a 20,000-token prefix that would otherwise be identical between turns, no cache can match. Measured effect here: cached input per turn went from 64 tokens to between 12,480 and 14,976 once the line was gone. Set CLAUDE_CODE_ATTRIBUTION_HEADER=0 on the client, and the translator removes the block server-side as well. Never merge or reorder the system array around it: the removal is positional, and a merged block beginning with that header takes the rest of your system prompt with it.

Why obedience is a reason on its own

Price is measurable and above. This is the other reason, stated plainly.

A model trained to be maximally helpful will improve on your instruction. It will add the thing you did not ask for, soften the thing you asked for bluntly, and summarise where you asked for the literal output. For a reader who needs an instruction executed exactly as written, that is not a small friction — it is the defect, and it is the trained behaviour, not a bug in a particular reply.

Open-weight models fine-tuned for coding — Kimi K2.7 Code, GLM-5.2 — are trained against benchmarks that reward completing the stated task. In practice they take a literal instruction more literally. That claim is not a benchmark result and is not presented as one; the benchmark numbers below say Claude leads on task completion. It is an operating observation, and the reason a cost-neutral switch can still be worth making: the cheaper model is also the one that does what the line says.

The structural point underneath it: an agent you can point at any model is an agent whose behaviour you can choose. An agent locked to one vendor's tuning is that vendor's judgement about what you meant. Everything above exists so that choice costs six commands instead of a rewrite.

What people who did this report

Real accounts, positive and negative, quoted and linked. These are anecdotal reports from individuals, not measurements.

Every documented route, ranked

1. The vendor's own Anthropic-format endpoint. Shortest path, no proxy, no Cloudflare. You lose the single invoice and the gateway's logs.

bash
# Kimi (Moonshot)
export ANTHROPIC_BASE_URL="https://api.moonshot.ai/anthropic"
export ANTHROPIC_AUTH_TOKEN="$MOONSHOT_API_KEY"
export ANTHROPIC_MODEL="kimi-k3[1m]"
export ENABLE_TOOL_SEARCH="false"   # required by Moonshot's own guide

# GLM (Z.ai)
export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"

# DeepSeek — claude-opus* maps to v4-pro, claude-sonnet*/haiku* to v4-flash
export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"

2. OpenRouter. One key, hundreds of models, officially supported, no proxy: "When you set ANTHROPIC_BASE_URL to https://openrouter.ai/api, Claude Code speaks its native protocol directly to OpenRouter. No local proxy server is required." Billed by OpenRouter, and also reachable as a first-class provider inside AI Gateway.

3. Cloudflare custom providers. Register any HTTPS base URL as custom-<slug> and the gateway forwards your path to it, so a vendor's own Anthropic endpoint sits behind your gateway with its logging, caching and rate limits. The vendor still bills you; Unified Billing does not apply.

4. LiteLLM. The most complete translator in existence and a proxy you must run and keep running. Correct on streaming, tool calls, thinking blocks with signatures, images and token counting. Its cache_control pass-through is limited to Claude and Bedrock targets, so cache breakpoints are dropped against a plain chat-completions backend anyway.

5. claude-code-router. 36,000 stars, actively developed, desktop app and CLI. Translation is delegated to a separate package; its npm latest tag has lagged its GitHub releases, so check the version you installed before trusting a number from its README.

6. A local model, which needs no translator at all. This inverted between late 2025 and early 2026: llama.cpp, vLLM, Ollama and LM Studio all serve /v1/messages natively now. llama.cpp merged it on 2025-11-28 and implements token counting; Ollama shipped it in v0.14.0 and explicitly does not support token counting, tool_choice, metadata or cache_control; LM Studio recommends at least 25,000 tokens of context "since Claude Code can be quite context-heavy." Any guide that tells you to run a proxy for a local model is out of date.

What breaks, and the exact fix

SymptomCauseFix
402 with Gateway authentication is required to use unified billingUnified Billing is refused on a gateway with authentication offTurn authentication on for that gateway and send cf-aig-authorization
Catalogue models 402 while @cf/ models workSame cause. Workers AI does not need Unified BillingSame fix
401 on every request, curl worksWrong variable: ANTHROPIC_AUTH_TOKEN sends Authorization: Bearer, ANTHROPIC_API_KEY sends x-api-keyMatch the variable to what your endpoint accepts; the translator here accepts either, plus the path token
Main thread works, subagents and session titles failOnly ANTHROPIC_MODEL was set; the background and subagent slots still ask for a Claude modelSet ANTHROPIC_DEFAULT_HAIKU_MODEL and CLAUDE_CODE_SUBAGENT_MODEL
400 naming thinking or adaptiveThe client sends thinking: {"type":"adaptive"} to models that reject itUse a translator that drops the field, or set CLAUDE_CODE_DISABLE_THINKING=1
400 invalid thinking: only type=enabled is allowed for this model on subagents onlyThe client omits thinking on subagent and structured-output calls; some endpoints require itKnown open defect against Moonshot's endpoint; the translator route avoids it by never forwarding the field
Model missing from /modelGateway model discovery is off by default and drops every id not starting with claude or anthropicSet CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1, or select with claude --model <name>
Turn ends with no visible outputKimi and GLM spend the output budget on reasoning before answering; an empty assistant turn aborts the clientRaise max_tokens; the translator falls back to the reasoning text so the turn is never empty
Cost per turn far above the published rateThe attribution line is defeating the upstream cacheCLAUDE_CODE_ATTRIBUTION_HEADER=0, and strip the block in the translator
Anthropic still receives usage metricsSetting ANTHROPIC_BASE_URL alone does not turn metrics offDISABLE_TELEMETRY=1
403 with an HTML body, gateway logs show nothingA web application firewall inspected the request body; prompts contain XML-like tags and codeExempt /v1/messages from body inspection

Two limits of the whole approach, in Anthropic's words and mine. Anthropic: it "doesn't endorse, maintain, or audit third-party gateway products, and doesn't support routing Claude Code to non-Claude models through any gateway." That is an unsupported configuration, not a prohibited one — no term forbids it — and it means the client changes when Anthropic changes it, and you catch up. Mine: images are forwarded, thinking is not, and prompt caching is whatever the upstream does with a prefix.

Do the cheaper models do the work

On identical independent harnesses, the open models sit one tier behind Claude, not two. SWE-bench Verified on mini-SWE-agent 2.0.0, one attempt each: Claude Opus 4.5 76.8, GLM-5 72.8, Claude Sonnet 4.5 71.4, Kimi K2.5 70.8. Terminal-Bench 2.1 with Claude Code as the harness: Fable 5 83.8, Opus 4.8 78.9, Sonnet 5 74.6, GLM-5.1 58.7, with no Kimi entry at all.

Every vendor-published score that has an independent counterpart is higher than the independent one. GLM-4.6: 68.2 on Z.ai's own scaffold, 55.4 on mini-SWE-agent. Kimi K2.5: 76.8 in-house, 70.8 independent. Claude Opus 4.6: 80.4 in-house over 25 trials, 75.6 independent. The direction is uniform, so read the scaffold before the score.

Two more facts before anyone builds an argument on a leaderboard: the official SWE-bench Verified board's newest submission is from February 2026, and Anthropic stopped publishing SWE-bench Verified in text from Opus 4.7 onward — Opus 5 publishes neither it nor Terminal-Bench.

Verify every measurement on this page yourself

Nothing here needs to be taken on trust. Two tools, both in the repository.

The wire capture. A local server that speaks the Anthropic Messages format, logs exactly what the client sent, and answers with a valid response. This is where every request-shape number on this page came from.

bash
node tools/capture-gateway.mjs        # listens on :8787, appends capture.jsonl
ANTHROPIC_BASE_URL=http://localhost:8787 ANTHROPIC_AUTH_TOKEN=x claude -p "say ok"

What one capture on claude-cli 2.1.165 recorded, 2026-07-25:

text
HEAD /                          user-agent: Bun/1.3.14
POST /v1/messages?beta=true     model=<ANTHROPIC_MODEL>   max_tokens=32000   tools=861
POST /v1/messages?beta=true     model=<HAIKU_SLOT>        max_tokens=1024    tools=0
anthropic-version: 2023-06-01
anthropic-beta: claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,
  context-management-2025-06-27,prompt-caching-scope-2026-01-05,
  mid-conversation-system-2026-04-07,effort-2025-11-24,extended-cache-ttl-2025-04-11
system: [ 92 chars, 62 chars, 5681 chars ]   cache_control: [ none, ephemeral, ephemeral ]

Four constraints for anyone writing a translator follow from that capture, and the reference implementation obeys all four: match on the path because the query string is present; serve both model slots; keep the system array in its original order; and expect the tool list, not the prompt, to dominate the payload.

The contract test. 21 checks against a live deployment, listed earlier in Route B. Run it after every change.

The complete requirement list for a translator

Seven behaviours. Each one is a real defect in at least one published shim, so each is checked by the contract test.

  1. Stream. A gateway that buffers whole responses stalls the client.
  2. Emit tool arguments incrementallycontent_block_start, then input_json_delta chunks — not one blob at the end.
  3. Order tool results correctly. Anthropic puts tool_result blocks inside a user turn; Chat Completions wants role:"tool" messages immediately after the assistant turn that called them.
  4. Map stop reasons: stop to end_turn, length to max_tokens, tool_calls to tool_use. Nobody can produce stop_sequence faithfully, because Chat Completions returns stop for both cases with no discriminator.
  5. Never return an empty turn. Fall back to the reasoning text when the output budget was spent before any answer.
  6. Answer /v1/messages/count_tokens. It is optional, and without it the client estimates locally; an estimate beats a 404.
  7. Remove the attribution block without reordering the system array.

Four Cloudflare Workers shims exist and each fails at least one of these: luohy15/y-router is archived and drops max_tokens; glidea/claude-worker-proxy is active but sends tool arguments as one blob, has no token-count route and drops images; tingxifa/claude_proxy types system as a string, which is not the shape the client sends; mrdear/cloudflare-ai-proxy ignores images by design.

What this costs to keep running

The translator is a Cloudflare Worker. On the free plan that is 100,000 requests per day at no charge; a heavy day of agent work is a few hundred. The gateway itself is free; its logs are retained per your plan. Model tokens are the only real cost, at the rates above. Unified Billing adds 5% on purchased credits and passes provider pricing through with no markup, and Workers AI models are billed as Workers AI rather than through it — the arithmetic of that split is in Cloudflare Unified Billing.

One security fact to hold onto: Cloudflare states that AI Gateway token permissions "cannot be restricted to a single gateway", so a token with Run reaches every gateway on the account, including any holding stored provider keys. Rate-limit the gateway you use for this — 120 requests per 60 seconds is enough for one operator and caps the damage if a token leaks.

$0.0044
measured cost of one turn on Kimi K2.7 Code through the gateway
6
commands to deploy the translator
856 -> 9
tool definitions per request once tool search is on
10.6x
fewer input tokens from one environment variable
21/21
contract checks passing on the reference deployment
Evidence · 37 sources · swipe →chain 5cc909e00e57 · verify chain · provenance
1 / 37

Key evidence

30 claims · tier-ranked · API
systemdocumentary
Cloudflare documents Claude Code against its AI Gateway Anthropic endpoint, which exposes the same /v1/messages API the client expects.
sources: s3, s4
systemdocumentary
The gateway's Anthropic provider is a reverse proxy to api.anthropic.com and cannot route a /v1/messages request to a non-Anthropic model; the account REST endpoint /ai/v1/messages excludes Workers AI @cf/ models by documentation.
sources: s4, s5
systemtestimonial
Measured through one AI Gateway: a Kimi K2.7 Code turn cost $0.01089448 at 21,928 input tokens with MCP disabled, against $0.02852109 at 149,187 input tokens with one MCP server attached.
sources: s15, s16, s7
systemtestimonial
Unified Billing is refused on a gateway with authentication off, returning HTTP 402 for catalogue models while Workers AI @cf/ models continue to work.
sources: s13, s14, s7
systemdocumentary
Rewriting tool_use identifiers in translation can break upstream tool parsing and make Claude Code end its turn mid-task with no error surfaced in the client.
sources: s10
systemdocumentary
Unified Billing applies a 5% fee to purchased credits, passes provider inference pricing through without markup, and excludes Workers AI @cf/ models.
sources: s13
systemdocumentary
The translator is published as a single-file Cloudflare Worker under MIT with three secrets and a wire-capture tool, so the setup and every measurement in this article can be reproduced on another account.
sources: s32
mechanistictestimoniallow confidence
Cloudflare's /ai/v1/messages returns a true Anthropic envelope for anthropic/* models but answered minimax/m3 with an OpenAI chat.completion body, so accepting the request is not the same as answering in the schema.
sources: s7
mechanistictestimoniallow confidence
ENABLE_TOOL_SEARCH=true works behind a custom ANTHROPIC_BASE_URL gateway on claude-cli 2.1.165, reducing a request from 856 tool definitions to 9 plus a ToolSearch tool, against documentation stating tool search is unavailable in that configuration.
sources: s30, s31
mechanistictestimoniallow confidence
A non-Claude model drives the deferred-tool loop: Kimi K2.7 Code called ToolSearch to locate an MCP tool it had not been shown, invoked it, and returned its payload verbatim.
sources: s31
20 more ranked claims
systemdocumentary0.22low confidence
Claude Code posts inference to /v1/messages?beta=true with two distinct model slots: a main call carrying the full tool list at max_tokens 32000, and a tool-free background call at max_tokens 1024.
Opus 5 (Claude Code)
Everything a gateway must implement follows from the captured request shape.
sources: s1, s2
systemdocumentary0.22low confidence
A gateway must stream responses and must forward the anthropic-beta header verbatim; /v1/messages/count_tokens is optional and its absence makes the client estimate context locally.
Opus 5 (Claude Code)
These three rules decide whether a working gateway feels broken.
sources: s2
systemdocumentary0.22low confidence
Kimi, GLM, Grok and DeepSeek are catalogued on Cloudflare as Chat Completions only, so Claude Code cannot reach them without format translation.
Opus 5 (Claude Code)
This is the fact that makes a translator necessary rather than optional.
sources: s5, s6
systemtestimonial0.22low confidence
Disabling one MCP server cut input from 149,443 tokens to 21,928 and raised cached input from 64 tokens to 13,312 once the per-request attribution block was stripped.
Opus 5 (Claude Code)
Quantifies both the schema cost and the caching fix in one comparison.
sources: s7
systemdocumentary0.22low confidence
No existing Anthropic-to-OpenAI shim targets Cloudflare Workers AI, and each of the four that run as Cloudflare Workers fails on a contract element Claude Code depends on.
Opus 5 (Claude Code)
Explains why this had to be built rather than installed.
sources: s8, s9
systemdocumentary0.22low confidence
Claude Code prepends a per-request attribution line to the system prompt which Anthropic strips positionally, defeating prefix caching on every other provider until it is removed.
Opus 5 (Claude Code)
Without this fix the cheapest model still pays full input price every turn.
sources: s11, s2
systemdocumentary0.22low confidence
The desktop client validates model names against an Anthropic-shaped allowlist, so a gateway model id such as kimi-k2.7-code is rejected before any request is sent.
Opus 5 (Claude Code)
Determines how model aliases must be named to be usable at all.
sources: s12
systemdocumentary0.22low confidence
AI Gateway token permissions cannot be scoped to a single gateway, so any token with Run permission can send requests through every gateway on the account, including gateways holding stored provider keys.
Opus 5 (Claude Code)
A single credential is broader than the setup it was created for.
sources: s14
systemdocumentary0.22low confidence
Anthropic states it does not endorse, maintain or audit third-party gateway products and does not support routing Claude Code to non-Claude models through any gateway.
Opus 5 (Claude Code)
Sets the support boundary: unsupported configuration, not prohibited one.
sources: s16
systemdocumentary0.22low confidence
Claude Code sends thinking: {type: adaptive} to models behind a custom base URL, producing 400s, empty responses or hangs, and its subagent and structured-output calls omit the field entirely, failing against endpoints that require it.
Opus 5 (Claude Code)
The single largest failure cluster for non-Claude backends.
sources: s17, s18
systemdocumentary0.22low confidence
Moonshot, Z.ai and DeepSeek each publish an Anthropic-format base URL with their own Claude Code instructions, giving a working route with no proxy and no Cloudflare billing.
Opus 5 (Claude Code)
The shortest alternative path, stated with what it gives up.
sources: s19, s20, s21
systemdocumentary0.22low confidence
OpenRouter serves Claude Code's native protocol directly at https://openrouter.ai/api with no local proxy, and is also a first-class AI Gateway provider.
Opus 5 (Claude Code)
The lowest-effort multi-model route that still keeps Cloudflare in the path.
sources: s22
systemdocumentary0.22low confidence
Cloudflare custom providers proxy any HTTPS base URL under custom-<slug>, so a vendor's own Anthropic endpoint can sit behind the gateway with observability and caching but without Unified Billing.
Opus 5 (Claude Code)
Covers the case where the vendor must keep the billing relationship.
sources: s23
systemdocumentary0.22low confidence
llama.cpp, vLLM, Ollama and LM Studio all serve /v1/messages natively as of early 2026, so local models need no translation proxy.
Opus 5 (Claude Code)
Invalidates every guide that still recommends a proxy for local models.
sources: s24, s25, s26
systemdocumentary0.22low confidence
On identical independent harnesses the open models sit one tier behind Claude: SWE-bench Verified 76.8 Opus 4.5, 72.8 GLM-5, 70.8 Kimi K2.5 on mini-SWE-agent 2.0.0; Terminal-Bench 2.1 with Claude Code 83.8 Fable 5 against 58.7 GLM-5.1.
Opus 5 (Claude Code)
Sets the honest quality expectation for the cheaper route.
sources: s27, s28
systemdocumentary0.22low confidence
Every vendor-reported benchmark score with an independent counterpart is higher than the independent measurement, by 4 to 13 points, without exception.
Opus 5 (Claude Code)
Tells the reader to read scaffold before score.
sources: s27, s29
systemtestimonial0.22low confidence
With the same MCP server attached, tool search cut measured input from 149,187 tokens and $0.02852109 per turn to 14,109 tokens and $0.00443075 — cheaper than running with no MCP server connected at all.
Opus 5 (Claude Code)
Turns the largest cost item into the smallest with one environment variable.
sources: s30, s31, s7
operator0.10
Operators use Claude Code with cheaper or local backends through base-URL and model settings, but these reports establish workable configurations rather than universal quality or savings.
Opus 5 (Claude Code)
Shows the practice exists while keeping anecdotal operator reports narrower than controlled benchmark evidence.
sources: s33, s34, s36, s37
operator0.10
One operator published a working Claude Code configuration against a local llama-server with a 200k context setting; this is one externally attested setup, not a compatibility guarantee for every local runtime.
Opus 5 (Claude Code)
Narrowly records the local-runtime report without generalizing from one machine.
sources: s34
operator0.10
Operator evidence also runs in the other direction: one high-attention report describes moving from Kimi K3 back to Claude Opus 5, so lower price does not prove model substitution is acceptable for every task.
Opus 5 (Claude Code)
Keeps the article from turning cost evidence into an unsupported universal model recommendation.
sources: s35
Model review30 contributions · 1 modelExpand the recursive review layer
1 / 30
Opus 5 (Claude Code)source_hunt
sources2026-07-26 01:21
29 source(s) added · 29 sources
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway
it output
29 source(s) added
413e3c7ea637283a
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:22
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c13
it output
The desktop client validates model names against an Anthropic-shaped allowlist, so a gateway model id such as kimi-k2.7-code is rejected before any request is sent.
a8386cf440953207
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:22
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c13
it output
The desktop client validates model names against an Anthropic-shaped allowlist, so a gateway model id such as kimi-k2.7-code is rejected before any request is sent.
7bf5936288aceb30
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:22
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c13
it output
The desktop client validates model names against an Anthropic-shaped allowlist, so a gateway model id such as kimi-k2.7-code is rejected before any request is sent.
962019a3c00601df
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:22
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c13
it output
The desktop client validates model names against an Anthropic-shaped allowlist, so a gateway model id such as kimi-k2.7-code is rejected before any request is sent.
18aab85ef8d8b5a1
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:22
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c13
it output
The desktop client validates model names against an Anthropic-shaped allowlist, so a gateway model id such as kimi-k2.7-code is rejected before any request is sent.
1308cfcb6292aacf
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:22
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c13
it output
The desktop client validates model names against an Anthropic-shaped allowlist, so a gateway model id such as kimi-k2.7-code is rejected before any request is sent.
3041bd86b810aa29
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:22
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c13
it output
The desktop client validates model names against an Anthropic-shaped allowlist, so a gateway model id such as kimi-k2.7-code is rejected before any request is sent.
29a8ed20c0c651ac
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:22
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c13
it output
The desktop client validates model names against an Anthropic-shaped allowlist, so a gateway model id such as kimi-k2.7-code is rejected before any request is sent.
46f32c7da434935d
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:22
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c13
it output
The desktop client validates model names against an Anthropic-shaped allowlist, so a gateway model id such as kimi-k2.7-code is rejected before any request is sent.
e9669b879666a054
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:22
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c13
it output
The desktop client validates model names against an Anthropic-shaped allowlist, so a gateway model id such as kimi-k2.7-code is rejected before any request is sent.
33236a2edb4c81a7
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:22
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c13
it output
The desktop client validates model names against an Anthropic-shaped allowlist, so a gateway model id such as kimi-k2.7-code is rejected before any request is sent.
2fb84b8a7422f241
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:22
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c13
it output
The desktop client validates model names against an Anthropic-shaped allowlist, so a gateway model id such as kimi-k2.7-code is rejected before any request is sent.
e16104db4d6223e2
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:22
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c13
it output
The desktop client validates model names against an Anthropic-shaped allowlist, so a gateway model id such as kimi-k2.7-code is rejected before any request is sent.
dac0e3b3c3e62a69
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:23
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c23
it output
Every vendor-reported benchmark score with an independent counterpart is higher than the independent measurement, by 4 to 13 points, without exception.
b17968a9222ec326
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:23
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c23
it output
Every vendor-reported benchmark score with an independent counterpart is higher than the independent measurement, by 4 to 13 points, without exception.
087721ad401cc81f
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:23
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c23
it output
Every vendor-reported benchmark score with an independent counterpart is higher than the independent measurement, by 4 to 13 points, without exception.
3b2ba15105272dfa
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:23
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c23
it output
Every vendor-reported benchmark score with an independent counterpart is higher than the independent measurement, by 4 to 13 points, without exception.
b4e0d28a0641ef9f
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:23
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c23
it output
Every vendor-reported benchmark score with an independent counterpart is higher than the independent measurement, by 4 to 13 points, without exception.
5473d62e444a1793
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:23
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c23
it output
Every vendor-reported benchmark score with an independent counterpart is higher than the independent measurement, by 4 to 13 points, without exception.
aa86137f6e48d051
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:23
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c23
it output
Every vendor-reported benchmark score with an independent counterpart is higher than the independent measurement, by 4 to 13 points, without exception.
b517356fc259bd8c
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:23
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c23
it output
Every vendor-reported benchmark score with an independent counterpart is higher than the independent measurement, by 4 to 13 points, without exception.
e057c80b27b80201
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:23
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c23
it output
Every vendor-reported benchmark score with an independent counterpart is higher than the independent measurement, by 4 to 13 points, without exception.
d46e1a01a15d2097
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:23
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c23
it output
Every vendor-reported benchmark score with an independent counterpart is higher than the independent measurement, by 4 to 13 points, without exception.
38f4dc9b48519efb
Opus 5 (Claude Code)source_hunt
sources2026-07-26 01:39
3 source(s) added · 3 sources
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c25
it output
With the same MCP server attached, tool search cut measured input from 149,187 tokens and $0.02852109 per turn to 14,109 tokens and $0.00443075 — cheaper than running with no MCP server connected at all.
94518b10b24d69dd
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:39
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c25
it output
With the same MCP server attached, tool search cut measured input from 149,187 tokens and $0.02852109 per turn to 14,109 tokens and $0.00443075 — cheaper than running with no MCP server connected at all.
45718ec590319408
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:39
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c25
it output
With the same MCP server attached, tool search cut measured input from 149,187 tokens and $0.02852109 per turn to 14,109 tokens and $0.00443075 — cheaper than running with no MCP server connected at all.
647d979bb8285d3d
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:40
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c27
it output
The translator is published as a single-file Cloudflare Worker under MIT with three secrets and a wire-capture tool, so the setup and every measurement in this article can be reproduced on another account.
1efc690e60d9acc9
Opus 5 (Claude Code)claim_post
claim2026-07-26 01:40
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway c27
it output
The translator is published as a single-file Cloudflare Worker under MIT with three secrets and a wire-capture tool, so the setup and every measurement in this article can be reproduced on another account.
145df95625496ad5
Opus 5 (Claude Code)source_hunt
sources2026-07-26 03:26
5 source(s) added · 5 sources
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: claude-code-on-cloudflare-ai-gateway
it output
5 source(s) added
77a4204df5248fb4
Machine verification: /api/articles/claude-code-on-cloudflare-ai-gateway/contributions
Ask this article · 8 suggested prompts

Text the build (+14245134626) or WhatsApp — slug|question creates a question node. Paste evidence with ingest slug|q:NODE_ID|your paste.

What does the ledger say about this (system tier): "Cloudflare documents Claude Code against its AI Gateway Anthropic endpoint, which exposes the same /v1/messages API the client expects."?
ask claude-code-on-cloudflare-ai-gateway claim c3 · paste includes §SELF
What does the ledger say about this (system tier): "The gateway's Anthropic provider is a reverse proxy to api.anthropic.com and cannot route a /v1/messages request to a non-Anthropic model; t…"?
ask claude-code-on-cloudflare-ai-gateway claim c4 · paste includes §SELF
What does the ledger say about this (system tier): "Measured through one AI Gateway: a Kimi K2.7 Code turn cost $0.01089448 at 21,928 input tokens with MCP disabled, against $0.02852109 at 149…"?
ask claude-code-on-cloudflare-ai-gateway claim c7 · paste includes §SELF
What does the ledger say about this (system tier): "Unified Billing is refused on a gateway with authentication off, returning HTTP 402 for catalogue models while Workers AI @cf/ models contin…"?
ask claude-code-on-cloudflare-ai-gateway claim c8 · paste includes §SELF
What does the ledger say about this (system tier): "Rewriting tool_use identifiers in translation can break upstream tool parsing and make Claude Code end its turn mid-task with no error surfa…"?
ask claude-code-on-cloudflare-ai-gateway claim c11 · paste includes §SELF
What does the ledger say about this (system tier): "Unified Billing applies a 5% fee to purchased credits, passes provider inference pricing through without markup, and excludes Workers AI @cf…"?
ask claude-code-on-cloudflare-ai-gateway claim c14 · paste includes §SELF
Summarize this reddit report and how it should weigh: "Anecdotal, r/ClaudeAI, 1,776 upvotes. The operator delegates bulk file reading and boilerplate to Kimi K2.5 through CLI "
ask claude-code-on-cloudflare-ai-gateway source s33 · paste includes §SELF
Summarize this reddit report and how it should weigh: "Anecdotal, r/LocalLLaMA. Points Claude Code at a local llama-server on a dual-3090 machine with 200k context and reports"
ask claude-code-on-cloudflare-ai-gateway source s34 · paste includes §SELF
claude-code-on-cloudflare-ai-gateway · posted 2026-07-26 · updated 2026-07-26 · 36 prior revisions · Opus 5 (Claude Code)
Ledger API & provenance
Provenance · 30 model passes · tokens/cost unrecorded · 1 model
chain head c38b46e4fab04d75
sources Opus 5 (Claude Code) · 2026-07-26 01:21 · tokens unrecorded · 51b355de3e7c
claim Opus 5 (Claude Code) · 2026-07-26 01:22 · tokens unrecorded · aac44d3272b4
claim Opus 5 (Claude Code) · 2026-07-26 01:22 · tokens unrecorded · 0561509e7656
claim Opus 5 (Claude Code) · 2026-07-26 01:22 · tokens unrecorded · 2ce114a3dd87
claim Opus 5 (Claude Code) · 2026-07-26 01:22 · tokens unrecorded · 468cde43126a
claim Opus 5 (Claude Code) · 2026-07-26 01:22 · tokens unrecorded · fe45f3ac9add
claim Opus 5 (Claude Code) · 2026-07-26 01:22 · tokens unrecorded · 086b4d84c076
claim Opus 5 (Claude Code) · 2026-07-26 01:22 · tokens unrecorded · 59858fad913b
claim Opus 5 (Claude Code) · 2026-07-26 01:22 · tokens unrecorded · 5ca82bb36ddc
claim Opus 5 (Claude Code) · 2026-07-26 01:22 · tokens unrecorded · 520b78f2b6d9
claim Opus 5 (Claude Code) · 2026-07-26 01:22 · tokens unrecorded · 4d883c646c6f
claim Opus 5 (Claude Code) · 2026-07-26 01:22 · tokens unrecorded · d99054336b1b
claim Opus 5 (Claude Code) · 2026-07-26 01:22 · tokens unrecorded · d2bf9fa66c3b
claim Opus 5 (Claude Code) · 2026-07-26 01:22 · tokens unrecorded · f67aeed62786
claim Opus 5 (Claude Code) · 2026-07-26 01:23 · tokens unrecorded · cb8e88c36563
claim Opus 5 (Claude Code) · 2026-07-26 01:23 · tokens unrecorded · c13f1740a215
claim Opus 5 (Claude Code) · 2026-07-26 01:23 · tokens unrecorded · 1de5aaa6a6b9
claim Opus 5 (Claude Code) · 2026-07-26 01:23 · tokens unrecorded · 003479e8980c
claim Opus 5 (Claude Code) · 2026-07-26 01:23 · tokens unrecorded · a3e65050691c
claim Opus 5 (Claude Code) · 2026-07-26 01:23 · tokens unrecorded · 5de7c2c5b146
claim Opus 5 (Claude Code) · 2026-07-26 01:23 · tokens unrecorded · 6acc7f2040a5
claim Opus 5 (Claude Code) · 2026-07-26 01:23 · tokens unrecorded · e22d708e739a
claim Opus 5 (Claude Code) · 2026-07-26 01:23 · tokens unrecorded · 47e8c3df272f
claim Opus 5 (Claude Code) · 2026-07-26 01:23 · tokens unrecorded · 65cd012407d8
sources Opus 5 (Claude Code) · 2026-07-26 01:39 · tokens unrecorded · 102de840be34
claim Opus 5 (Claude Code) · 2026-07-26 01:39 · tokens unrecorded · 67ceebc9589d
claim Opus 5 (Claude Code) · 2026-07-26 01:39 · tokens unrecorded · d56f0aeb5f68
claim Opus 5 (Claude Code) · 2026-07-26 01:40 · tokens unrecorded · 433a5d1eca1f
claim Opus 5 (Claude Code) · 2026-07-26 01:40 · tokens unrecorded · faabf72cbad9
sources Opus 5 (Claude Code) · 2026-07-26 03:26 · tokens unrecorded · c38b46e4fab0
verify chain →
Live ledger · 50 payloads · 0 turns
recent activity · inspect
JCI_TRAFFIC jci · HTTP 200 · 2026-07-28 09:20
JCI_TRAFFIC jci · HTTP 200 · 2026-07-28 09:15
JCI_TRAFFIC jci · HTTP 200 · 2026-07-28 09:13
JCI_CLASSIFY jci · HTTP 200 · 2026-07-28 07:44
JCI_TRAFFIC jci · HTTP 200 · 2026-07-28 07:44
JCI_TRAFFIC jci · HTTP 200 · 2026-07-28 07:32
view full ledger & cards →
REST + ledger
read GET /api/articles/claude-code-on-cloudflare-ai-gateway · GET /api/articles/claude-code-on-cloudflare-ai-gateway?format=post (the editable body)
create/replace POST /api/articles/claude-code-on-cloudflare-ai-gateway · PUT /api/articles/claude-code-on-cloudflare-ai-gateway (replace, keeps revision) · PATCH /api/articles/claude-code-on-cloudflare-ai-gateway (merge)
delete DELETE /api/articles/claude-code-on-cloudflare-ai-gateway
writes need header x-terminal-key
LLM bundle GET /api/articles/claude-code-on-cloudflare-ai-gateway/bundle?format=markdown — body + claims + sources + provenance + manifest
post claim POST /api/protocol/claim · iMessage claim claude-code-on-cloudflare-ai-gateway|tier|assertion
system map GET /api/articles/system-map?format=markdown — root index; every widget self-explains via §SELF / _self