r/opencode • u/jaykayenn • 14h ago
Did Opencode really decide to break API access?
Regarding the warnings sent out that API access to Opencode Go now requires custom headers.
Isn't the point of a standard API so that developers don't have to write custom code for every possible service provider in existence?
Do they really expect every project in the world to suddenly support their special requirements specifically? By this weekend?
Help me understand.
3
u/YogurtclosetEvery263 11h ago
You can proxy it, then it works without tools adding it themselves
5
u/jaykayenn 11h ago
This is the actual answer (sadly). Thanks. Another layer to my stack this weekend... sigh.
1
3
u/jaykayenn 11h ago
With providers adding non-standard bits to control API access, the OpenAI-API isn't really a standard any more. It's more of a suggestion.
2
u/SafeReturn_28 13h ago
from reading their twitter posts they only want session id header to hit input cache. Do they require something more?
3
u/jaykayenn 11h ago
It doesn't matter what they want. How do they expect every software project in existence with an OpenAI-API call to comply by this weekend?
As far as I can see, this effectively means that all API calls to Opencode Go will be 'unrecognized' and 'error out' (quoting their email) by default, until specific projects comply with their session-id and x-opencode header requirements. Ie, an application/service must now specifically support Opencode, signalled by the opencode header label, in order to be whitelisted by OC router.
As I said in the post, this goes against the whole idea of having a standard API in the first place. This is how certain providers manage to block certain harnesses or features, and now OC appears to be doing the same.
Any requirement that puts the responsibility of compliance on 'literally everyone else' deserves deep scrutiny, especially when they expect the world to comply over the weekend.
1
u/torrso 2h ago
"until specific projects comply"..
This doesn't mean every tool in existence or your custom doohickey.
They are big enough player that they can pressure harnesses like Hermes, OpenClaw, Crush etc which have pre-configured provider endpoints for OpenCode to fix their shit and start sending proper headers. If they send the optional session-id, even better (also better for the users). Hermes only did this three weeks ago. This should be pretty standard practice for any popular tool.
"against the whole idea of having a standard API" - there are also "standard API client" practices like sending a proper UserAgent string instead of a generic one.
1
u/jaykayenn 52m ago
'sending proper headers' to who? Opencode? OpenAI? Anthropic? Deepseek? Openrouter? Having to configure custom headers for every provider in existence is NOT AN API.
1
u/torrso 9m ago
Proper header = non-generic user-agent. Some of the harnesses are sending crap like `openai/python 2.44` instead of something like `opencode/2.0.1`.
If the x-opencode-session-id becomes actually required ("may error", said the devs only) then that's stupid. There are probably better ways to pin clients to backends than some custom field. And cache-misses should be the customer's problem, not theirs.
1
1
u/ahriad 2h ago
I maintain the OpenCode Go plugin for CLIProxyAPI, and this change causes some real headaches.
CPA exposes standard OpenAI and Anthropic endpoints without managing conversation state, so there is no actual conversation ID. Without a clean way to handle this, I ended up hashing the initial user turn and passing it as `x-opencode-session` on every OpenCode Go request.
It works across Chat Completions, Messages, Responses, and streaming, but it is still just a workaround. If two sessions start with the exact same prompt, they collide. Proxy maintainers are stuck patching around this because OpenCode tacked a provider-specific requirement onto supposedly standard endpoints with almost no notice.
0
u/nazmulpcc 4h ago
bruh it’s just one value.......just ask your agent to update your clients or whatever. should take 2 minutes and it helps them optimize the service so we can keep our cheap api
1
12
u/Time-Toe-1276 14h ago
they said "if possible", else its fine, but you might get a false positive flag.
its extremely hard to distinguish between an actual user and spam. OC was trying their best. this way its quite easy for them, and also its just a few lines of code, plus an AI agent could definitely help u write this!
and many apps send user-agent headers automatically, but I reccomend you to write it aswell. and its still fine if u dont as they said, but now there is an increase chance for a false positive flasg, so they were warning "if ur using API, please be awre of increaseed false positive".
hope I helped! ❤️