Fable 5.2 code reviews in CI cost us 58% less once we put an LLM caching gateway in front of them. Every HotKV Cloud instance now ships with that gateway. You change the base URL of your OpenAI or Anthropic client, and any request the gateway has already answered comes back from HotKV instead of from the provider's bill. To get a real number, we put Claude Code in a CI pipeline as a code reviewer and let it review 3,139 diffs.
In short. We replayed 1,333 real commits from the Flask repository as CI events, and Claude Code reviewed each diff with Fable 5.2. Through the HotKV LLM caching gateway the run cost $85.02. Without it, the same reviews would have cost $200.38, so we paid 58% less. Repeated reviews came back in about 1.1 seconds instead of 11.2. Anthropic's prompt caching was on the whole time, and the saving comes on top of it.
Why we tested this in CI
CI runs the same job over and over. You push a branch and the pipeline runs. Minutes later you open a pull request on the same commit, and it runs again. Then a flaky test fails, someone clicks "re-run all jobs", and the whole thing runs a third time. If one of those jobs asks a model to review the diff, the model gets the same diff and the same instructions every time.
Each of those runs is billed in full. With a strong model that hurts. A fresh Fable 5.2 review of one of our commits cost about 6.4 cents on average, and a busy team pushes all day.
That is exactly the case an exact cache is built for. The gateway in HotKV Cloud is hotkv-gateway, our Apache 2.0 caching proxy, with HotKV as the store behind it. It handles the OpenAI API and Anthropic's Messages API, streaming included. When the same request arrives twice, the second one never leaves your instance.
How the test worked
We didn't want a loop that sends one prompt a thousand times. We wanted something that behaves like a real pipeline, with real code and the real Claude Code command line.
Commits from Flask
The code came from Flask, the Python web framework. We took its history without merge commits and kept every commit whose diff, message included, came to between 800 and 25,000 characters. That drops empty commits and huge generated ones. The run got through the 1,333 most recent of those before it hit its budget.
A new commit arrived every 8 seconds. It started a push run right away and a pull request run 1 to 5 minutes later. For 30% of commits a rerun followed 3 to 10 minutes after the push. A third of those got a second rerun after 10 to 20 minutes. Ten reviews ran at a time.
We picked that schedule. If your team opens pull requests from fresh commits, or rarely reruns jobs, you will see fewer repeats than we did.
The review step
Each run was the same step a CI job would run, with the diff piped into Claude Code in headless mode.
export ANTHROPIC_BASE_URL="https://<instance>.hotkv.io:8443/<secret>/anthropic"
git show "$SHA" | claude -p "You are reviewing a pull request in CI. \
Review this diff for bugs, security issues and missing tests. Reply with a short \
numbered list of findings, most important first, or 'LGTM' if there is nothing \
worth raising." --model claude-fable-5-2 --tools "" --output-format json
The export is the only line you would add to an existing setup. We used Claude Code 2.1.323 with its tools switched off, since the whole diff is already in the prompt. For the cost of each fresh review we took the number Claude Code reported itself, at Fable 5.2's list price of $8 per million input tokens and $40 per million output tokens.
What the Fable 5.2 reviews cost
All 3,139 reviews finished, with no errors, in just under three hours.
The gateway answered 1,806 reviews from its cache, 57.5% of the total. The other 1,333 went to Anthropic and cost us $85.02. If those 1,806 repeats had gone to Anthropic too, the bill would have been $200.38. We saved $115.36, or 58%.
| Trigger | Runs | Answered from the cache |
|---|---|---|
| Push | 1,333 | 0% |
| Pull request | 1,307 | 100% |
| Rerun | 382 | 100% |
| Second rerun | 117 | 100% |
| All | 3,139 | 57.5% |
Speed changed too. A cached review took a median 1.07 seconds, and most of that is Claude Code starting up. A fresh one took 11.23 seconds. The budget ran out before 26 of the last pull request runs were due, which is why that row is short.
Each cache hit is counted at what the fresh review of the same commit had cost. The gateway keeps its own hit and miss counters, and they matched our log to within three requests.
Why the first review always paid
Every diff went to Anthropic once. The push run always came first, and a cache can't answer something it has never seen. After that, the pull request run and every rerun of the same diff came straight from the cache. The diff hadn't changed, so there was no reason for the answer to change.
You can estimate this for your own pipeline in a minute. Count how many times the same diff gets reviewed. Two reviews per commit means about half are repeats. Reruns push it higher. If each commit is only ever reviewed once, the gateway saves you nothing on that step.
Answers stay cached for one hour. A job rerun the next morning goes to the model again, and the gateway keeps the fresh answer.
Doesn't Anthropic already cache prompts?
It does, and it was on for every request in this test. Claude Code turns prompt caching on by itself. It lets the model reuse the start of a prompt it saw recently and bills those input tokens at a much lower rate.
But the model still runs. You still pay for the output and for the rest of the input. The gateway skips the call completely, so a hit costs nothing at the provider, output included. With Fable 5.2 output is five times the price of input per token, so that matters.
The two stack. Prompt caching made each fresh review cheaper, and the gateway took the repeated ones off the bill. If you want the longer comparison, we wrote one on prompt caching vs semantic caching.
The LLM caching gateway is in every plan now
Starter, Performance and Scale all include the gateway. There is nothing to install and no extra charge. Each instance gets two private endpoints on port 8443, one for OpenAI and one for Anthropic.
https://<instance>.hotkv.io:8443/<secret>/openai/v1
https://<instance>.hotkv.io:8443/<secret>/anthropic
The secret in the path is generated for your instance, and you'll find it in the console. Your own API key still goes to the provider with each request, and the provider bills you for whatever the gateway forwards. The console's LLM gateway tab shows your hit rate, the tokens you saved and the tokens that went to the provider.
Each API key gets its own cache, so one key never receives another key's answers. Errors and refused answers are never stored. The cache lives in your instance's memory, on a machine that is yours alone, and the gateway code is public on GitHub if you want to read it. The plans and sizes page has the rest of what each tier includes.
What this test doesn't tell you
This was one workload and one model. We ran headless Claude Code in a simulated pipeline that replayed real commits on our own schedule. We didn't run it inside GitHub Actions or another CI service, and we didn't try other models or other prompts.
Interactive Claude Code sessions are a different story. Each session adds its own details to every request, so two sessions almost never send the same request, and an exact cache does little there. The gateway earns its keep where requests really repeat, in scripts, pipelines, batch jobs and agents with fixed steps.
We also didn't grade the reviews. A cached answer is the one the model gave to that exact request, so it's as good as the original was. If you care about answer quality with a semantic cache, our token savings benchmark goes into it.
Frequently asked questions
What is an LLM caching gateway?
It's a proxy that sits between your application and an LLM provider such as OpenAI or Anthropic. It stores answers, and when exactly the same request comes in again it returns the stored answer, so the provider is never called or paid. In your code, only the base URL changes.
How much did the gateway save on Claude Code reviews in CI?
Our run of 3,139 Fable 5.2 reviews over 1,333 Flask commits cost $85.02 instead of $200.38, which is 58% less. Every pull request run and every rerun of a diff came from the cache. The first review of each diff went to the model.
Does it replace Anthropic's prompt caching?
No, you keep both. Prompt caching discounts input tokens the model has seen recently, but the model still runs and you pay for the output. The gateway skips repeated calls entirely. Both were on in our test, so the 58% comes on top of what prompt caching already saved.
Is the gateway included in every HotKV Cloud plan?
Yes. Starter, Performance and Scale instances all include it at no extra cost, with endpoints for the OpenAI API and Anthropic's Messages API. The console shows each instance's gateway address along with its hit rate, the tokens saved and the tokens sent to the provider.
Can one customer receive another customer's cached answer?
No. Every API key has its own cache, and the cache lives in your own instance's memory. A stored answer only comes back for a request that matches exactly, down to the API key that made it. Errors and refused answers are never stored.
How long are answers cached?
For one hour. After that, the next identical request goes to the model again and the new answer is stored. That keeps answers fresh while still catching the repeats that matter in CI, like a pull request opened right after a push or a rerun of a failed job.
Does it work with interactive Claude Code sessions?
It works, but it won't save much. Each interactive session adds its own details to every request, so different sessions rarely send identical requests. The savings come from automation that repeats itself, such as CI steps, scheduled scripts, batch jobs and agents with fixed prompts.



Continue the conversation
Comments
Questions about the method? A different result on your hardware? Share what you found. Comments are reviewed before they appear.