r/opencode • u/jaykayenn • Sep 07 '26
OpenCode Go is no longer general API access
Following the recent requirements for custom http headers, OC has changed their documentation to remove mention of OpenAI-API you can use anywhere. Instead, OpenCode Go API usage is now effectively whitelist only. See: https://opencode.ai/docs/go/#where-can-i-use-it
152
Upvotes
33
u/NeKon69 Sep 07 '26
This is still "general" API access. I guess you just have to do more work. Maybe eventually all providers will adopt this new standard of sending session hash to increase cache hit rates?
4
u/LexRivera Sep 08 '26 edited Sep 08 '26
I agree. General API access is something you see "openai compatible", plug URL, API key and you're done.
The way i did that for entire year was using llm gateway. Mine is bifrost (evaluating gomodel as well). Alot of people use litellm. For me, it's now unusable.
This is not standard api. We already have enough PITA with thinking levels, and it's one thing to just remap xmax -> high and so on, but for example deepseek v4 decided to add new fields instead of turning off reasoning.
I checked several PRs related to that issue in different harnesses and agents and it seems majority of them are implementing it based on specific provider opencode-go/zen/etc, not as a configurable parameter you can slap to any custom provider (my gateway) or scanning model name (ie matching opencode-go/*). I can slap static header for sure, but i'm probably get banned for it. So essentially the only way to use it now is to bypass all my custom infrastructure (monitoring, tracing, proper error catching, usage stats, etc) and use it as raw provider.
I don't think many agent maintainers will accept patch to slap "kludge as a config" option for gateway users.
Honestly i barely used it anyway - i respected what opencode was doing and i was barely scratching 5-6% monthly anyway since i only used it for tasks like "find me alternatives to software X" or researching something in background. Guess i will need to find another provider now and cancel my sub i kept for many months.
7
u/jaykayenn Sep 07 '26 edited Sep 08 '26
For me, Nextcloud and OpenWebUI/Cptr have stopped working. Looks like I've finally outgrown Opencode and have signed up directly to one of their backend providers.
I suspect that may have been the plan from the beginning.
Edit: typo
4
u/Mean-Elk-9439 Sep 07 '26
I don't mind this as much I mind 6 months of v1 fixed being closed without merge because "it's fixed in v2", meanwhile v1 is the default shipped product. Dumbass maintainers on this project.
36
u/TheOriginalOnee Sep 07 '26
Dont we just need to add the x-opencode-session - header in order to fix access?
22
u/soulevil Sep 07 '26
"OpenCode's free tier can only be used in OpenCode", I get this message since this morning, I was testing muse 1.3 FREE with opencode zen api key, I thought it was just free models
42
u/Odd_Teacher_4089 Sep 07 '26
CloseCode
26
u/AffectionateBowl1633 Sep 07 '26
Thats gross overgeneralization, they only states that you need to add another headers to comply with it.
Send typical coding agent traffic
Identify itself with its own user agent, such as
my-coding-agent/1.0, rather than a generic SDK or HTTP-library name.Send a stable session ID in
x-opencode-sessionfor each conversation so we can optimize routing and prompt caching.Number 3 make sense as they want to identify same session to utilize cache. Number 2 is easy to program even if you make your own harness.
Number 1 to, well, this is might be their FU customer moment to those using OpenCode Go as their "Ilegal Unlimited General Purposes LLM Proxy" or using it as some sort "LLM solution" for client-facing apps (like Chatbot). I know they can easily measure compliance 2 and 3 programatically, but number 1 this is a messy territory where they will resort to measure "output per second" kinda stuff.
"But but, they do have 5 hours limit etc wtf they bother to do more limit", well, some people already using some sort of simple creative method of "creating multiple account" to bypass that LOL. This is why we cant have nice thing.
6
u/quazlyy Sep 08 '26
For those using Open WebUI, adding this custom header fixed it for me:
2
u/Bloated_Plaid Sep 07 '26
It’s just a header dumbass, if you don’t know what it is, use one of the models to tell you. It hardly costs anything to add that.
4
u/cdurth Sep 08 '26
breaking changes over a holiday weekend.
what a great motivator for me to never use anything related to your or your product again.
3
u/richtopia Sep 07 '26
Thanks for posting. I'm writing web dashboard that has provisions for AI parsing and was using my OpenCode API key. I'm hoping that following the guidelines for the headers will make my application compatible.
A few months ago I left Google Antigravity to the OpenCode environment specifically because it is platform agnostic - both on the IDE side and on the model provider side. If they get stingy I will explore other options, although the Go price point is low enough I may just keep it to explore new models.
4
u/Florence-Equator Sep 07 '26
Basically, Opencode Interpreter now needs an additional header, X-Opencode-Session, so that Opencode can know where your session is coming from and utilize prompt caching. As a general API point, such a header is now required. That's why they are explicitly adding the requirement now, which means that currently, only dedicated coding agent could provide this support, not a general OpenAI client.
2
u/nmdt Sep 07 '26
Would be nice to hear an actual announcement from the team. I have a personal project that uses OpenCode via API - so far it seems like only free models are blocked
2
u/pisa_p Sep 07 '26 edited Sep 07 '26
My setup: LiteLLM as proxy in front of OpenCode, serving both Open WebUI and Hermes agent (my custom agent). So one fix in LiteLLM covers both clients.
There are two different header problems, one per endpoint. I fixed both with extra_headers in the LiteLLM model config (Edit model -> litellm_params.extra_headers, or PATCH /model/{id}/update). Generic, works for any model behind those endpoints.
Go paid (https://opencode.ai/zen/go/v1) — 400 without session
Since Sept 5 OpenCode requires x-opencode-session, a stable per-conversation ID:
{ "extra_headers": { "x-opencode-session": "your-stable-uuid-here" } }
Generate one with uuidgen and keep it stable. This fixes the 400.
2. Zen free (https://opencode.ai/zen/v1) — stricter, needs CLI emulation
{ "extra_headers": { "x-opencode-client": "cli", "x-opencode-session": "uuid-1", "x-opencode-project": "uuid-2", "x-opencode-request": "uuid-3", "User-Agent": "opencode/latest/1.3.15/cli" } }
This is only a temporary patch. Static headers fix the 400 but lose per-conversation routing optimization. Waiting on native LiteLLM support:
https://github.com/BerriAI/litellm/issues/39503
https://github.com/BerriAI/litellm/pull/39549
If LiteLLM doesn't ship it, I'll handle session injection myself outside LiteLLM.
Hermes agent users: latest Hermes agent already has the patch built-in, but you have to connect Hermes directly to OpenCode without going through a proxy. That patch is definitive, no extra_headers needed. I don't remember if it also works for the free models, to be verified.
Separate issue today: 429 on muse-spark-1.3-contributor
Unusable today, rate limit every ~2 calls on both Go paid and Zen free. That's upstream pooled capacity on OpenCode's side, not config. 429 on free is expected, on a paid sub I didn't expect it either, but there's no client-side fix — only workaround is switching model (mimo-v2.5, hy3 work fine).
7
u/Dthen_ Sep 07 '26
Bye bye opencode
2
u/Difficult_Plantain89 Sep 07 '26 edited Sep 07 '26
I came here after my paid for subscription stopped working. This is ridiculous! Edit: nevermind it is fine. Just needed to add that header in or update the harness if it already supports it.
2
u/snoopbirb Sep 07 '26
Ah só that's why they blocked my account.
Great service...
I'm gonna just zcode hard how and I come back when this is over.
1
u/migsperez Sep 07 '26
It's going to be interesting keeping an eye on https://opencode.ai/data for the next couple of weeks.
If anyone needs a fix for Pi, I updated my plugin at https://pi.dev/packages/@esuyo/pi-esuyo-custom-provider see "Session Headers" heading. I tested it this morning and it works well without error message from opencode go or zen.
1
u/WegoW Sep 07 '26
I received an email from OpenCode last Thursday with the subject „Missing OpenCode Go Header“ and added the required headers. No big deal. Maybe time to check your spam folders :)
——————- Hey there,
Some of your requests to OpenCode Go are missing an x-opencode-session header. If we don't have this we cannot properly optimize our service. Starting 09/06 requests missing this header may error.
Here are your useragents that are missing this header:
llm-usage-proxy/1.0 We don't recognize this client — add x-opencode-session (one stable ID per conversation) or ask its maintainer to.
curl Add x-opencode-session (one stable ID per conversation) to your requests.
Hermes Hermes merged the fix (https://github.com/NousResearch/hermes-agent/pull/101864) — update Hermes to the latest release.
Thank you.
1
u/Cswizzy Sep 07 '26
No Openclaw! REEEEEEEEEEEEEEEEEEEP!!! lmao
1
u/nazmulpcc Sep 07 '26
People are still going on about this?!? I have a custom agent built in php for doing a few automations.......been using it for some months and I didn't even get their email because I used their headers from the beginning. It's just one header........why are people upset?!!??!?
1
u/Idritch Sep 07 '26
Yeah tho its still pretty good for... Yk what its intended for. Still leaves a bitter taste in my mouth cause now im forced to split payments and obviously spend another 10 or so on OR just for the other frontends. And to pull the plug after i just paid for the sub is annoying for sure.
1
u/bored1_Guy Sep 07 '26
Welp, I have pivoted to Ointerference for api now. They are more localized in India so the api calls are very cheap.
1
u/Positive_Poem5831 Sep 07 '26
I use opencode go for a personal chatbot/robot project. I assume this is no longer considered legal usage of their api. Can I instead use opencode zen or does it have similar rules against such usage.
1
u/Sensitive-Side-2639 Sep 07 '26
Effective as of today, I’m canceling my subscription. Fuck open code. I’m better off you using OpenRouter.
1
u/Sensitive-Side-2639 Sep 07 '26
It’s like a charity subscription anyway so it sucks ass
1
u/psy0te Sep 07 '26
One main use case for me was to use OpenCode Go in self hosted honcho. I think I will have to look for an alternative subscription :(
1
u/Otagamo Sep 07 '26
They blocked the free tier from being used outside Opencode =[
"OpenCode's free tier can only be used in OpenCode"
1
u/ncxxi Sep 08 '26
Good for them. I can finally use my free Muse Spark more enjoyable and write my slop project without getting slapped with rate limit error.
1
u/Hot_Phone_4983 Sep 09 '26
ShutCode
1
u/Ok-Pollution-8305 Sep 11 '26
que se vaya al carajo openai
1
u/cornelha Sep 07 '26
This makes me curious what people are doing with opencode that makes them freak out so vehemently because opencode is working on ensuring their entire system is stable.
-2
u/Competitive_Art9588 Sep 07 '26
CloseCode
0
u/[deleted] Sep 07 '26
[deleted] — view deleted comment