On GPT-6.2 a system prompt sent as instructions is billed uncached on every step. A ten-minute check, and the fix.
This article was first published on Medium. The canonical URL is https://medium.com/@r3dtuxedo/your-system-prompt-was-never-cached-77c7bebe41fd.
One block of the prompt kept being paid for again and again.
TL;DR
- OpenCode 2.3.2 fixed a bug where GPT-6.2 never cached the system prompt. The prompt was sent in the Responses API
instructionsfield, so every step re-billed it as fresh input. On GitHub Copilotgpt-6.2-sol, uncached input per step fell from about 14,000 tokens to 3.- This is documented behaviour, not a glitch. OpenAI says that from GPT-6.2 on, top-level
instructionsare appended after the input and billed at the uncached rate every time. Reusable instructions belong in the first developer message.- "We use caching" and "our prefix is cached" are different claims. A session hit rate of 70% can hide the largest stable block never being cached. Read the token counts per step, not the average.
- Second half: on GPT-6.2, editing anything earlier in the conversation makes the API drop the reasoning items that followed it. So the rule is append, never edit.
Prompt caching is the cheapest speed-up in agent work. Cached input on GPT-6.2 Sol costs $0.10 per million tokens against $2.00 for fresh input, a 95% discount. Most harnesses turn it on and move on.
That is why one line in a release note caught my eye. On 18 November, OpenCode shipped v2.3.2 with this entry: "GPT-6.2 models don't cache a system prompt sent in the Responses instructions field, so every step re-billed it as uncached input." OpenCode now sends it as a leading developer message on every Responses route, including OpenAI, GitHub Copilot, Zen, Azure and OpenRouter. On Copilot's gpt-6.2-sol, the release says uncached input per step dropped from about 14,000 tokens to 3.
Nothing here needed an unusual setup. The harness had a system prompt and caching was on. The biggest stable block in every request was simply never part of the cache.
Caching being on and your prompt being cached are two different facts. Only the token counts tell you the second one.
What the model actually reads
To see why, you need the order in which the request is assembled. OpenAI's prompt caching guide lists it: a hidden OpenAI system message, then tool definitions, then your developer message, then the conversation history. And one rule governs everything: "Cache reuse requires the entire rendered prefix to match."
The top-level instructions field is not part of the prefix on GPT-6.2 and later.
For GPT-6.2 and later, the guide says top-level instructions are for guidance "that applies only to the current request". The API "append[s] these instructions after input, beyond eligible cache breakpoints". Then comes the sentence that explains the OpenCode bug: OpenAI "bills those instruction tokens at the uncached input-token rate on every request, even if you repeat identical instructions."
So the field does what the docs say. It is a good place for something like "on the final turn, summarise your findings". It is the wrong place for a 14,000-token system prompt you send every step. The fix OpenAI gives is plain: "put reusable instructions in the first developer message in input".
| Where the prompt goes | Position in the request | Cached on GPT-6.2? | Billed as |
|---|---|---|---|
Top-level instructions
|
After the input | No | Fresh input, every request |
First developer message in input
|
Start of the prefix | Yes | Cache write once, then cache reads |
| Later developer message | Where you append it | Yes, from the next request | Same as history |
| Timestamp or user data inside the first message | Start of the prefix | Breaks the cache | Rewritten every request |
The hit rate that looks fine
A dashboard hit rate does not catch this, which is why it can survive so long. Here is a worked example with assumed numbers, not measurements. A system prompt of 14,000 tokens. Each step adds 2,000 tokens of history. At step 20 the request carries 14,000 + 20 x 2,000 = 54,000 input tokens.
-
Prompt in
instructions: the history before this step, 38,000 tokens, is cached. The 14,000-token prompt and the 2,000 new tokens, 16,000 in all, are fresh. Hit rate: 70%. - Prompt as the first developer message: 52,000 tokens are cached. Only the 2,000 new tokens are fresh. Hit rate: 96%.
At the Sol list rates of $2.00 and $0.10 per million, that one step costs about $0.036 against $0.009. About 3.9 times more, for what looks like a healthy 70%.
Illustrative arithmetic on assumed token counts, at GPT-6.2 Sol list prices.
Over a 50-step session the same pattern costs about $1.40 for the system prompt alone (50 x 14,000 tokens at $2.00 per million). Sent as a developer message, it costs about $0.10: one cache write at $2.50 per million, then 49 reads at $0.10. Those are API list prices on my assumptions. I don't know how GitHub Copilot or your plan counts the same tokens, and a subscription may hide this entirely. It matters most when you pay per token.
How to check yours in ten minutes
Do not trust the average. Log the numbers per step.
OpenAI Responses API. Every response has usage.input_tokens and usage.input_tokens_details.cached_tokens. The guide's example shows request 1 with 12,000 input tokens, 0 cached and 12,000 written, and request 2 with 15,000 input, 12,000 cached and 3,000 written. Three details help you read it:
- The first step of a new prefix shows zero cached tokens. That is a cache write, not a failure.
- Reported
cached_tokensexcludes the hidden system tokens and rounds down to a multiple of 128. - A prefix must reach the minimum cacheable length, 1,024 tokens for GPT-5.6 and later, before it can be cached at all.
So look at step 2 and at step 10. If your biggest stable block is cached, the uncached count at step 2 should be close to only what you added. If it equals your system prompt plus the new message, you have the OpenCode bug.
Claude. The mechanism differs, but the check is the same. Anthropic's prompt caching docs say the prefix covers tools, then system, then messages, and that "if both cache_creation_input_tokens and cache_read_input_tokens are 0, the prompt was not cached". They also list a common mistake: putting the breakpoint on a block that contains a timestamp. Each request then writes a new cache entry and never reads one. Cached entries live at least 5 minutes by default, or 1 hour at extra cost.
A small script. I wrote a short script that runs the same eight-step conversation twice, once with the prompt in instructions and once as a developer message, and prints the cached and uncached counts per step. It is in the gist below. I have not run it against the live API, since I don't have a key on the machine I wrote this on. I tested only its output formatting with mock data, so treat it as a starting point and check the field names against your SDK version.
https://gist.github.com/br4vesirrobin/665f0d8df6e7e5c12619d2d83c00586f
The second half: append, don't edit
Fixing where the system prompt lives gets you the cache. The next problem is what your harness does to the history later.
OpenAI has a page called Keep the prefix unchanged, and it carries a stronger warning than the caching guide. It says: "Starting with newer frontier models, the API will drop reasoning items that follow a prefix change as part of our safeguards." When that happens, "the model may have to redo some reasoning, which can increase token usage, cost, and latency", and if it can't recover the lost reasoning, "output quality may also drop".
So a cache miss is no longer the only price of editing history. You can also throw away reasoning you already paid for. A prefix change, per the page, includes shortening a tool result, rewriting a developer message or replacing older turns with a summary.
OpenAI's 20 November post on adversarial distillation gives the reason. With GPT-6.2 Astra and Sol, "we tie a model's protected reasoning to the conversation history that produced it". If an earlier message is rewritten, "our API drops the reasoning that followed it". In OpenAI's own test, attacks that recover protected reasoning from an earlier request succeeded 54.0% of the time against GPT-6 Astra and 0.2% against GPT-6.2 Astra. That is OpenAI's internal number, not an independent one. The point for you is that OpenAI frames this as a safeguard, not a bug.
The guide's advice is to append instead of edit. Most things you would normally change have an append-only form:
| What you want to change | Instead of this | Do this |
|---|---|---|
| Reasoning effort | Change reasoning.effort
|
Append a configuration_update item with the new effort. Keep the original setting |
| Output schema | Change text.format
|
Append a configuration_update item with the new schema |
| Available tools | Change the tools parameter |
Add with an additional_tools item, or restrict with tool_choice and allowed_tools
|
| Developer instructions | Edit the first developer message | Append a new developer message at the end |
| Compaction | Home-grown summary placed before recent turns | OpenAI compaction via /responses/compact keeps later reasoning. For custom compaction, put the compacted item at the end |
| Long tool outputs | Truncate old ones later | Shorten before the first send, or use compaction |
The compaction row deserves a second look. OpenCode's release note says compaction through /responses/compact now reads the same cached prefix. The guide says custom compaction changes the prefix, and that you can either accept dropped reasoning or place the compacted item at the end. Cache misses are "difficult to avoid" there.
To audit your own harness, OpenAI points to two tools. Set prompt_cache_options.comparison_response_id to an earlier response ID to see why a cache miss happened. And read input_transformations in the response to see which reasoning items the API removed and why. A prefix_mismatch entry means something earlier in the input was changed. Diagnostics report only the first difference they find and "can't verify whether the model reused reasoning".
One more small trap from the caching guide: it says changing the top-level reasoning.effort setting "can rewrite instructions in the hidden system instructions", so mid-session changes should go through configuration_update. (My previous article on which effort setting is worth it is about the choice at the start of a session.)
Your checklist
Paste it into your harness repo's README.
If you build harnesses, two questions are worth asking in code review. Where does this prompt go? And does anything touch the earlier history after it was sent? If you only use a harness, ask its maintainers the first one.
What I could not back
- I could not verify the 14,000-to-3 figure myself. It comes from the OpenCode release note, for GitHub Copilot's
gpt-6.2-sol. - I did not run the script against a live API.
- The step-20 example uses assumed token counts. Real harnesses differ.
- I don't know how plan-based billing, including ChatGPT and Copilot subscriptions, counts cached and uncached tokens.
- OpenAI says diagnostics report the first identified difference on a best-effort basis.
Sources
- OpenCode, v2.3.2 release notes (18 Nov 2026).
- OpenAI, Prompt caching guide, Keep the prefix unchanged and API pricing. Read 28 Nov 2026.
- OpenAI, Introducing GPT-6.2 Astra and Sol and Combatting adversarial distillation (20 Nov 2026).
- Anthropic, Prompt caching. Read 28 Nov 2026.
Top comments (0)