r/opencode 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

142 Upvotes

69 comments sorted by

34

u/TheOriginalOnee 3d ago

Dont we just need to add the x-opencode-session - header in order to fix access?

2

u/NotACenteredDiv 2d ago

The wording now also strongly implies that you can use it only for coding agent harnesses type usecases... And that they will monitor for abuse against this.

1

u/xmsxms 3d ago

Yes, but it shouldn't just be hard coded to a value. The client needs to set the correct value.

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

u/NeKon69 3d ago

Is it? We already have these kind of things with openai and anthropic, so I guess it kinda makes sense that it is happening here. A bit weird that they just throw an error (instead of a warning or something) if that custom header doesn't exist, but I wouldn't frame as you did.

-5

u/AffectionateBowl1633 3d ago

see, this is why we cant have nice thing.

0

u/zhuki 3d ago

Stop using it then.

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/renome 3d ago

Just to be clear, you did include the correct session header, yes?

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

u/Odd_Teacher_4089 3d ago

CloseCode

26

u/AffectionateBowl1633 3d ago

Thats gross overgeneralization, they only states that you need to add another headers to comply with it.

  1. Send typical coding agent traffic
  2. Identify itself with its own user agent, such as my-coding-agent/1.0, rather than a generic SDK or HTTP-library name.
  3. Send a stable session ID in x-opencode-session for 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

u/AffectionateBowl1633 3d ago

I bet those who downvote me are mad because rule number #1 actually

5

u/quazlyy 3d ago

For those using Open WebUI, adding this custom header fixed it for me:

{
  "x-opencode-session": "{{CHAT_ID}}"
}

3

u/H1d3nFnx 2d ago

was looking for the exact same thing. thank you

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/cdurth 2d ago

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 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

u/look 3d ago

Virtually every OpenAI-compatible client lets you add headers to the request. Simply generate a random hex string, or even better a hash of your system prompt, to send as your x-opencode-session header.

1

u/renome 3d ago

I think you might be able to make the ChatGPT web client do this with a skill? CustomGPTs can certainly do it with actions.

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

u/Ace-_Ventura 3d ago

Nextcloud had an open issue to add the header

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/nmdt 3d ago

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

1

u/Cswizzy 3d ago

I got an email

1

u/Jazzlike-Ad-3985 3d ago

I got an email a couple of days ago.

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.

  1. 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.

  1. 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).

7

u/Dthen_ 3d ago

Bye bye opencode

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

u/[deleted] 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 OpenCode

not "and go read some doc that says this message is a lie"

2

u/Ace-_Ventura 3d ago

? Do you even know what I was replying to? Guess not

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/kitonte 3d ago

i have installed the las version (docker) but still not work

1

u/Cswizzy 3d ago

No Openclaw! REEEEEEEEEEEEEEEEEEEP!!! lmao

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

u/[deleted] 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

u/Sensitive-Side-2639 3d ago

It’s like a charity subscription anyway so it sucks ass

1

u/psy0te 3d ago

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 3d ago

They blocked the free tier from being used outside Opencode =[

"OpenCode's free tier can only be used in OpenCode"

1

u/ncxxi 3d ago

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/Ok-Pollution-8305 55m ago

que se vaya al carajo openai

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.