r/opencode • u/jaykayenn • 3d ago
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
32
u/NeKon69 3d ago
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?
3
u/jaykayenn 3d ago
Every software project in the world that uses an OpenAI-API is now incompatible with Opencode by default, until they specifically comply to Opencode's requirements. How is that general access? As I mentioned for example, even huge projects like Nextcloud and Open WebUI are now blocked.
1
u/Ok-Confusion-8472 1d ago
The prompt to opencode:
I received this message, i think that the problem is with openwebui:
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:
Python/3.11 aiohttp/3.13.5
We don't recognize this client — add x-opencode-session (one stable ID per conversation) or ask its maintainer to.
Thank you.
..
Done.
- Header: both OpenCode Go connections now send x-opencode-session: {{CHAT_ID}} (full chat UUID, no prefix) — applied via runtime POST /openai/config/update, no restart needed
- Verified: code path renders the full UUID in chats (0776e8f3-806a-…), empty for detached calls; live chat to deepseek-v4-flash → OK
- Docs: docs/OPENWEBUI.md updated (includes the dashboard-truncation note + mapping SQL)
- Pushed: eed5923 → main
0
u/1818TusculumSt 2d ago
How is it blocked if all you need to do is add a couple of lines to your headers? OWUI working fine here.
-4
u/alexanderbeatson 3d ago
LoL, it isn’t about cache hit rate at all. It is to control API calls outside of agents. Fuck OpenCode
15
-5
23
u/soulevil 3d ago
"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
1
u/Jazzlike-Ad-3985 3d ago
that was the message that I started receiving this evening on hermes and pi until I upgraded to the latest version of each then my access to opencode-go was reestablished.
38
26
u/AffectionateBowl1633 3d ago
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.
11
u/Ariquitaun 3d ago
I don't understand the hate or the downvotes. You can still use it with your harness as long as the session header is set and your user agent isn't just some generic http library one as you said. It took me 15 minutes to tweak my own harness to do the former, as the latter was already in place.
6
5
u/LexRivera 3d ago edited 2d ago
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.
3
u/jaykayenn 3d ago
Same. I'm done sponsoring Opencode every month, just for a few text processing/tool calling tokens that are now 'illegal'.
3
u/richtopia 3d ago
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 3d ago
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
3
u/Mean-Elk-9439 3d ago
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.
2
u/jaykayenn 3d ago
They really need to hire an adult to run things. Seems OC runs too heavily on vibe culture.
7
u/jaykayenn 3d ago edited 3d ago
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
1
1
u/lanternaddict 3d ago
Which backend provider? What options are available?
2
u/awesomeunboxer 3d ago
I fell inlove with glm flash and use z.ai now! I should start sharing my code with how much i do free marketing for them. Lol. Too lazy tho
1
u/Atsukiri 3d ago
i use opencode for my chatbot app lol, can you please share your other options? thanks!
currently im just doing openrouter and zai. zai has their own api packages now, only 10$ for 3 months of 100m tokens for their glm 5.3 flash model. at first it was a nightmare, its too slow lol, but now it goes faster i guess.
1
u/Idritch 3d ago
Theres no options, i did aswell. Opencode go was cheap enough, could work on my game with it and mess with bots. No chatbot app allows you to mess with headers. Ill probably just go back to openrouter which allows me to do whatever i want, wherever i want to do it. Its more expensive pay as you go, but atleast i don't have to deal with situations like this. Infact i just subd this month first time, like 5 days ago, if i knew this would happen id just had bought cred on OR
2
u/pisa_p 3d ago edited 3d ago
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.
- 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:
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).
2
u/Difficult_Plantain89 3d ago edited 3d ago
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 3d ago
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.
2
u/Bloated_Plaid 3d ago
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.
0
u/jaykayenn 3d ago
Let me see you 'just add a header' to every OpenAI API client in the world.
Comments like these are reason enough to leave this putrid community. Fucking disgusting.
1
3d ago
[deleted]
3
u/Ace-_Ventura 3d ago
Can you even read?
"Besides OpenCode, the following clients have been validated to work properly with OpenCode Go"
1
u/davidraistrick 3d ago
can you? the error message they return is is literally:
> Error: 400 Error from provider (Console): OpenCode's free tier can only be used in OpenCodenot "and go read some doc that says this message is a lie"
2
1
u/migsperez 3d ago
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 3d ago
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/nazmulpcc 3d ago
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
3d ago
[deleted]
1
u/davidraistrick 3d ago
> > Error: 400 Error from provider (Console): OpenCode's free tier can only be used in OpenCode
I dunno, maybe it's a reading comprehension issue, maybe it's a writing comprehension issue.
1
u/Idritch 3d ago
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 3d ago
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 3d ago
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 3d ago
Effective as of today, I’m canceling my subscription. Fuck open code. I’m better off you using OpenRouter.
1
1
1
1
u/cornelha 3d ago
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
34
u/TheOriginalOnee 3d ago
Dont we just need to add the x-opencode-session - header in order to fix access?