OpenCode GPT-6.2 setup: the system prompt is cacheable from 2.3.2 on
As of November 19, 2026, OpenCode 2.3.2 (released November 18, 2026) sends the GPT-6.2 system prompt as a leading developer message instead of putting it in the Responses instructions field, so it is cached from the second step on instead of being re-billed as uncached input on every step. The fix covers the Responses routes the changelog lists; when the baseURL is a custom gateway such as QCode, confirm it in your usage log. Setup in short: set options.baseURL on the openai provider to https://api.qcode.cc/openai/v1 (https://asia.qcode.cc/openai/v1 in mainland China). By the official OpenAI rates, cached input for gpt-6.2-sol is $0.10 per 1M tokens, 1/20 of its $2.00 input price.
Updated 2026-11-19
Point this tool at the QCode endpoint — one key for Claude, GPT and Chinese models.
- Billed per token — live rates on /models
- Pay by card (Visa / Mastercard), Apple Pay, Google Pay or crypto
- Self-service: top up and activate instantly
Four numbers behind the caching fix
OpenCode release that carries the fix
OpenCode 2.3.2 shipped on 2026-11-18 under the title GPT-6.2 Prompt Caching: the system prompt now travels as a developer message on OpenAI (API key and ChatGPT sign-in), GitHub Copilot, Zen, Azure, and OpenRouter routes.
Sol cached input per 1M tokens
Official OpenAI rates: gpt-6.2-sol is $2.00 input, $10.00 output, $0.10 cached input; gpt-6.2-astra is $8.00 input, $40.00 output, $0.40 cached input. Cache writes are billed separately, at $2.50 for gpt-6.2-sol with 30-minute retention.
Sample bill for a 50-step session
Take a 20,000-token system prompt plus tool definitions across 50 steps: fully uncached that is 1,000,000 tokens, about $2.00 at the gpt-6.2-sol rate. Cached from step two it is roughly $0.04 + $0.098 ≈ $0.14 at official rates, an illustration that excludes cache write fees.
Verify the hit yourself after upgrading
Run a few steps, then read the QCode dashboard usage log and check whether cached input shows up from the second step. The changelog routes never name a custom-baseURL OpenAI-compatible gateway, so the usage log itself is what tells you whether cached input appears.
What actually changed in OpenCode's GPT-6.2 prompt caching
As of 2026-11-19 the problem was the shape of the request, not the model. OpenCode's built-in openai provider talks to the Responses interface, and GPT-6.2 does not cache a system prompt placed in the Responses instructions field. The changelog puts it plainly: 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.
Every OpenCode agent ships its own system prompt and tool definitions, and that prefix is resent on each of the dozens of steps in a real session, so the whole prefix was billed again and again at the uncached input rate. Version 2.3.2 moves the prompt into a leading developer message, which makes it a cacheable prefix billed at the cached input rate from the second step on.
Three releases between 2026-11-17 and 2026-11-18
The 2026-11-17 v1.19.6 release lets OpenCode 1 offer the upgrade to OpenCode 2.0: the download runs in the background and you pick Restart to upgrade, Upgrade on quit, or Later, with sessions, projects, and settings kept, though plugins written for OpenCode 1 need an update. On 2026-11-18, v2.3.1 moves a shell command whose timeout expires to the background instead of killing it, makes timeout: 0 mean the 120-second default, writes compaction summaries in the background (turn it off with compaction.background: false; an unused background summary still costs tokens), and shows GPT 6.2 Sol and GPT 6.2 Astra in the model picker when you sign in with ChatGPT. The same day, v2.3.2 fixed the GPT-6.2 prompt caching problem above and stopped webfetch structured output from repeating the url and format it was called with.
Three release points: background jobs to the caching fix
OpenCode v2.3.0 made subagents background by default and folded each run of tool calls and thoughts into one collapsible activity row.
v1.19.6 lets OpenCode 1 offer the upgrade to OpenCode 2.0, downloaded in the background and installed when you choose, with sessions and settings kept but OpenCode 1 plugins needing an update.
Two releases in one day: v2.3.1 moves timed-out shell commands to the background, writes compaction summaries in the background, and shows GPT 6.2 Sol and Astra after ChatGPT sign-in; v2.3.2 sends the GPT-6.2 system prompt as a developer message so it is cached from the second step on.
What is confirmed vs what OpenAI and OpenCode have not published
Confirmed (changelog text and official rates)
Verified as of 2026-11-19
- 1The OpenCode 2.3.2 entry (2026-11-18) states that GPT-6.2 models do not cache a system prompt sent in the Responses instructions field, and that OpenCode now sends it as a leading developer message on every Responses route, including OpenAI (API key and ChatGPT sign-in), GitHub Copilot, Zen, Azure, and OpenRouter.
- 2v2.3.1 the same day moved timed-out shell commands to the background, made timeout: 0 the 120-second default, and wrote compaction summaries in the background (disable with compaction.background: false; unused summaries still cost tokens).
- 3Official OpenAI rates:
gpt-6.2-solat $2.00 input, $0.10 cached input, $10.00 output;gpt-6.2-astraat $8.00 input, $0.40 cached input, $40.00 output. - 4QCode's OpenCode doc lists the OpenAI endpoint
https://api.qcode.cc/openai/v1and saves the key through /connect.
Common misreadings and details nobody has published
Two things the changelog does not say
- 1it gives no saving figure and only states that the prompt is cached from the second step on, so upgrading to 2.3.2 is not an automatic fixed-percentage cut to the bill
- 2it never names a custom-baseURL OpenAI-compatible gateway, so with an endpoint like QCode you read your own usage log instead of assuming a hit. Still unpublished: whether OpenCode will surface a cache hit rate in its own UI, and how long each gateway keeps cached prefixes.
Stay on the old build and wait vs upgrade and check the usage log
Stay on the old build and wait for someone else
The system prompt stays in the instructions field and every step is billed as uncached input; the longer the prompt and tool definitions and the more steps in a session, the larger the repeated portion. The only thing certain while waiting is that the billing shape has not changed.
Upgrade past 2.3.2, then verify against your own usage
After the upgrade the system prompt becomes a leading developer message and, per the changelog, should be able to go at the cached input rate from the second step on; then read your usage log to see whether cached input appears, and let measurement rather than guesswork tell you what it saved.
Six steps from a clean install to a verified cache hit
- 1Check the version first: run opencode
--version, and if it is below 2.3.2, upgrade. OpenCode 2 installs with curl -fsSLhttps://opencode.ai/v2/install| bash or npm install -g @opencode/cli, and an existing OpenCode 1 install can run opencode upgrade--major. - 2Edit
~/.config/opencode/opencode.jsonand set options.baseURL for the openai provider tohttps://api.qcode.cc/openai/v1(usehttps://asia.qcode.cc/openai/v1in mainland China, with no trailing slash), then reference models as openai/gpt-6.2-soland openai/gpt-6.2-astra. - 3In OpenCode type /connect, choose OpenAI, choose Manually enter API Key, and paste your QCode cr_ key; for Claude as well, run /connect again, choose Anthropic, and use the anthropic provider address from QCode's OpenCode doc, which is not the same address Claude Code uses (
https://api.qcode.cc/api). - 4Use /models to select openai/
gpt-6.2-soland run a few real steps rather than a single one-line prompt. - 5Open the QCode dashboard usage log and check whether cached input appears from the second step; if everything is still billed as input, recheck the version and whether the request really went down the Responses route.
- 6For Chinese models, create a separate provider: QCode's Responses interface does not serve them, so per the doc use chat/completions with the same
https://api.qcode.cc/openai/v1baseURL, for exampleglm-5.3. In the V1 format (options.baseURL under provider, which is the shape QCode's doc shows) that provider's package is @ai-sdk/openai-compatible; only native OpenCode 2 config (settings.baseURL under providers) uses @opencode/ai/providers/openai-compatible, with @opencode/ai/providers/openai-compatible/responses as the Responses variant.
One endpoint in QCode, with models and rates on /models
One QCode cr_ key covers both endpoints inside OpenCode: GPT-6.2 Sol and GPT-6.2 Astra go through the OpenAI endpoint https://api.qcode.cc/openai/v1 (https://asia.qcode.cc/openai/v1 in mainland China, no trailing slash), and the Claude line uses the anthropic provider address given in QCode's OpenCode doc. Model IDs and live per-token rates are on /models. Not ready for a monthly plan? Pay-as-you-go Packs start at $4 for a one-time quota you use within 7 days; if you already have a Personal Plan, add a booster pack when you need more quota.
Frequently asked questions
What is the minimum I have to change to run GPT-6.2 in OpenCode with a QCode key?
Three things: config file, key, model. Set options.baseURL for the openai provider in ~/.config/opencode/opencode.json to https://api.qcode.cc/openai/v1 (https://asia.qcode.cc/openai/v1 in mainland China), run /connect inside OpenCode, pick OpenAI, pick Manually enter API Key and paste your cr_ key, then choose openai/gpt-6.2-sol or openai/gpt-6.2-astra with /models. Run /exit and reopen once; a normal reply to one question means the wiring works.
I already upgraded to 2.3.2, so why does the bill still look expensive?
Check three things: that opencode --version really reports 2.3.2 or newer, that requests actually go down the Responses route instead of being handled by another provider or an old plugin, and that the bill contains input, output, and cache writes on top of cached input, where gpt-6.2-sol cache writes cost $2.50 per 1M tokens at 30-minute retention on official OpenAI rates. Also note that the repeated prefix only gets large when the system prompt plus tool definitions are long and the session has many steps; a short session has little to save.
How is GPT-6.2 prompt caching priced in OpenCode, and how much does it actually save?
On official OpenAI rates, gpt-6.2-sol is $2.00 per 1M input tokens and $0.10 for cached input; gpt-6.2-astra is $8.00 input and $0.40 cached input. Take an illustration: a 20,000-token system prompt plus tool definitions over 50 steps is 1,000,000 tokens fully uncached, about $2.00 on Sol, while caching from the second step gives roughly $0.04 + $0.098 ≈ $0.14 at official rates, excluding cache write fees. Real savings depend on prefix length, step count, and how often the cache is written, so no fixed percentage is quoted here.
Do GLM, DeepSeek, or Kimi models need a separate provider in OpenCode?
Yes. QCode's OpenCode doc states that the built-in openai provider uses the Responses interface while QCode's Responses interface does not serve Chinese models, so you create a separate provider over chat/completions with the same https://api.qcode.cc/openai/v1 baseURL, for example glm-5.3. In the V1 format documented there (options.baseURL under provider) that provider's package is @ai-sdk/openai-compatible; @opencode/ai/providers/openai-compatible belongs to native OpenCode 2 config (settings.baseURL under providers), where @opencode/ai/providers/openai-compatible/responses is the Responses variant, and the two formats are not mixed. Which IDs you can call, and at what rate, is on /models.
Should opencode.json use options.baseURL or settings.baseURL?
It depends on which config generation you run. OpenCode 1 and configs kept in the V1 format write options.baseURL under provider, which is exactly the shape QCode's doc shows for the two providers. If you only use OpenCode 2 and prefer the native format, write settings.baseURL under providers; OpenCode 2 normalizes fields in memory and never rewrites your source file. OpenCode's own providers doc uses settings.baseURL to override a catalog provider endpoint. The address is the same in both forms.
Does the 2.3.2 caching fix still apply when the baseURL points at a gateway like QCode?
Nobody official has said. The 2.3.2 changelog lists OpenAI (API key and ChatGPT sign-in), GitHub Copilot, Zen, Azure, and OpenRouter, and never names a custom-baseURL OpenAI-compatible gateway. The only sound approach is measurement: after upgrading to 2.3.2 or newer, run a few steps and read the QCode dashboard usage log to see whether cached input appears from the second step. If it does, that part is billed at the cached input rate; if it does not, it is still billed as uncached input.
Sources
OpenCode official changelog (https://opencode.ai/changelog: v2.3.0 2026-11-13, v1.19.6 2026-11-17, v2.3.1 and v2.3.2 2026-11-18); OpenCode official providers doc (https://opencode.ai/docs/providers, 2026-11-19); OpenAI official pricing page (https://developers.openai.com/api/docs/pricing) and the gpt-6.2-sol model page (2026-11-19); QCode official OpenCode integration doc (docs.qcode.cc, English and Chinese editions); community material: the CC Switch 4.0.35 release note (2026-11-18) and V2EX threads (2026-11-14, 2026-11-17). All checked on 2026-11-19.
Wire GPT-6.2 into OpenCode and check the caching yourself
Create a QCode cr_ key, point the openai provider in opencode.json at the QCode endpoint, and call gpt-6.2-sol or gpt-6.2-astra on per-token billing; live per-model rates are on /models.
Related reading
Pay-as-you-go Packs: no monthly plan, valid 7 days
Buy a one-time quota valid for 7 days or add a booster pack to a Personal Plan; per-model rates are on /models.
OpenCode Go Pricing and Limits (Nov 2026): $10 · Plus $40
OpenCode Go costs $10/month while Go Plus is $40 and Go Teams $20 per member. Per-model limits: 20% per 5 hours, 50% a week. How to pay, what to do next.
GPT-6.2 Sol vs GPT-6.2 Astra: Official Pricing, Benchmarks & Codex Guide (2026-11)
Head-to-head comparison of OpenAI's 2026-11-17 gpt-6.2-sol ($2/$10) and gpt-6.2-astra ($8/$40): 1,050,000 context, cutoffs, FrontierCode 2.0, AA-3D, >272K surcharge, reasoning_effort rule, and QCode setup.
Crypto payment guide
Nine coins, 56 networks, zero platform fee for AI coding API credits.
QCode.cc is an independent API access service with no affiliation to OpenAI, Anthropic, or any other model vendor, and is not endorsed by them. Release details and behaviour described here follow the OpenCode changelog, and every dollar figure is an official OpenAI API rate; the models QCode currently serves and its live per-token rates are listed on qcode.cc/models.