opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Free models fail inside official OpenCode TUI with "free tier can only be used from within OpenCode" (Windows, v2.0.32)

Open mirabhakta opened this issue 1 month ago • 75 comments

Description

Bug description

OpenCode's free models suddenly stopped working inside the official OpenCode terminal application on Windows.

Every request immediately returns:

Error: OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building.

I am already using the official OpenCode CLI/TUI, so the error appears incorrect.

The issue originally occurred during a normal development session. It persists across existing sessions, brand-new sessions, different free models, and an isolated standalone instance outside my project.

Troubleshooting already performed

  • Upgraded OpenCode to v2.0.32.
  • Restarted OpenCode.
  • Successfully reauthenticated with opencode auth login opencode.
  • Confirmed OpenCode Console credentials were stored using opencode auth list.
  • Created a brand-new session outside my project directory.
  • Launched with opencode --standalone.
  • Selected the built-in Build agent.
  • Tested DeepSeek V4.1 Flash Free and Nemotron 3.5 Lightning Free. Both return the identical error.
  • Checked the resolved configuration using opencode debug config:
    • Configuration parses successfully.
    • V2 permissions configuration is present.
    • No global or Build-agent deny rules detected by the checks performed.
    • No legacy Zen provider override detected.
    • No OPENCODE_PERMISSION environment override detected.
  • Confirmed no MCP servers are configured.

Reauthentication, upgrading, switching models, and starting fresh sessions did not resolve the issue.

Additional context

The free models were working normally before this issue appeared. I was able to complete development tasks using DeepSeek V4.1 Flash Free earlier.

Plugins

No MCP servers are currently configured (opencode mcp list returns "No MCP servers configured"). I previously evaluated code-review-graph but fully uninstalled the integration before this issue. Other global OpenCode plugins have not been verified.

OpenCode version

2.0.32

Steps to reproduce

  1. On Windows, install or upgrade the official OpenCode CLI to v2.0.32.

  2. Authenticate successfully using opencode auth login opencode.

  3. Open PowerShell and run:

    cd $HOME
    opencode --standalone
    
  4. In the OpenCode TUI, select the built-in Build agent.

  5. Select DeepSeek V4.1 Flash Free.

  6. Submit: Hello. Reply with one sentence. Do not modify any files.

  7. Observe the error: OpenCode's free tier can only be used from within OpenCode.

The same issue also occurs in ordinary OpenCode sessions without --standalone.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

PowerShell on Windows

mirabhakta avatar Oct 17 '26 05:10 mirabhakta

Thanks for the detailed report and for all the troubleshooting you've already done!

This error comes from the Zen gateway, and it has several known causes that have nothing to do with where you run OpenCode. You've already ruled out a missing Console login. Some of the other causes are easy to miss in a config check, so could you share the following?

  1. The full output of opencode debug config, with any API keys or tokens removed. In particular, check whether read or shell/bash is denied anywhere in any form ("deny", {"*": "deny"}, an agent-level permission, or an old-style "tools": { "bash": false }). Also check whether there's a provider entry pointing at https://opencode.ai/zen/v1. Each of these is known to cause exactly this error.
  2. Your plugins: any plugin entries in your global config (%USERPROFILE%\.config\opencode\opencode.json / opencode.jsonc), and any files in %USERPROFILE%\.config\opencode\plugin(s)\. Since you recently uninstalled code-review-graph, please check that nothing from it is left over.
  3. A log from one failing request: run opencode --print-logs --standalone, send one prompt, and paste the lines around the error, again with any tokens removed.

You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know when you're done.

Related issues, ordered from most to least likely to cover your problem:

  • #55435: same error on Windows after it had been working; still there after reinstalling. For some people, removing a leftover zen/v1 provider override or signing in again fixed it.
  • #51241: free models fail with this error when read or shell is denied in any form, including "*": "deny".
  • #50627 / #51193: the same thing when shell is denied on an agent.
  • #55616: same error on Windows with v2.0.29; cause not confirmed yet.
  • #52917: the error appears when no Console credential is stored, which opencode auth login opencode fixes.

opencode-agent[bot] avatar Oct 17 '26 05:10 opencode-agent[bot]

Same here. I found another resolution of this issue, but I can not ensure whether it's useful. https://github.com/anomalyco/opencode/issues/55737#issuecomment-6195211953

PrinOrange avatar Oct 17 '26 06:10 PrinOrange

Thanks for the detailed report and for all the troubleshooting you've already done!

This error comes from the Zen gateway, and it has several known causes that have nothing to do with where you run OpenCode. You've already ruled out a missing Console login. Some of the other causes are easy to miss in a config check, so could you share the following?

  1. The full output of opencode debug config, with any API keys or tokens removed. In particular, check whether read or shell/bash is denied anywhere in any form ("deny", {"*": "deny"}, an agent-level permission, or an old-style "tools": { "bash": false }). Also check whether there's a provider entry pointing at https://opencode.ai/zen/v1. Each of these is known to cause exactly this error.
  2. Your plugins: any plugin entries in your global config (%USERPROFILE%\.config\opencode\opencode.json / opencode.jsonc), and any files in %USERPROFILE%\.config\opencode\plugin(s)\. Since you recently uninstalled code-review-graph, please check that nothing from it is left over.
  3. A log from one failing request: run opencode --print-logs --standalone, send one prompt, and paste the lines around the error, again with any tokens removed.

You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know when you're done.

Related issues, ordered from most to least likely to cover your problem:

Thanks for following up so fast. I've now captured a failing request using OpenCode v2.0.32 on Windows.

Configuration

The configuration documents I inspected contain:

  • An OpenCode provider override defining the DeepSeek V4.1 Flash Free model's context limit.
  • Two local Qwen providers using 127.0.0.1 endpoints.
  • No visible opencode.ai/zen/v1 provider override.
  • No visible legacy tools restrictions or explicit read, shell, or bash deny rules.

The resolved configuration parsed successfully. My diagnostic checks detected zero global and Build-agent deny rules.

Plugins

The debug log reports 12 initialized plugins, all with built-in opencode.* names. I found no evidence of code-review-graph loading during this request.

Failing request log

The session starts successfully, but the model request fails almost immediately:

level=ERROR
message="Failed to drain Session"
cause="AI.Error: OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building."

[cause]: AI.Error.Authentication:
OpenCode's free tier can only be used from within OpenCode.

The client subsequently reports session.step.failed and session.execution.failed.

Additional verification

  • OpenCode Console login succeeded.
  • Both DeepSeek V4.1 Flash Free and Nemotron 3.5 Lightning Free fail identically.
  • The issue occurs with the built-in Build agent in a new standalone session outside my project.
  • Updating OpenCode and reauthenticating did not resolve it.

The logs appear to show a successful official CLI/server startup followed by an authentication-classified error during model inference.

Could you advise what additional diagnostics would distinguish an incorrect request/client signature from a Zen gateway authorization issue?

mirabhakta avatar Oct 17 '26 06:10 mirabhakta

Thanks for the details and the log. I tried to reproduce this on v2.0.32 (Linux) a few minutes ago, against the real Zen gateway, and free models worked:

  • opencode run -m opencode/deepseek-v4.1-flash-free "Say hello in one word" replied normally. So did nemotron-3.5-lightning-free and big-pickle.
  • It also worked after I added a config like yours: a provider.opencode override setting the context limit for DeepSeek V4.1 Flash Free, plus a local provider on 127.0.0.1.

I ran these signed out, because I don't have a Console account to test with. Since signed-out requests work, there are two likely explanations: the gateway had a short problem (another commenter saw the same error signed out around 06:13 UTC), or it's specific to your signed-in Console account.

You asked how to tell a client problem from a gateway or account problem. These two checks should answer that:

  1. Try again now, in case it was temporary.
  2. Try once signed out: run opencode auth logout opencode, start a new session and send one prompt to DeepSeek V4.1 Flash Free. Afterwards, run opencode auth login opencode to sign back in.
    • If it works signed out but fails signed in, your client is fine and the problem is on your account's side. #56112 is a similar case: a free model was switched off for one account in the Console. Only the team can check that. Please email [email protected] with the time you saw the error, and keep account details out of this issue.
    • If it still fails signed out, please reply here with the time (UTC), the full error and your rough region.

Related: #55435 and #55616 (same error on Windows) and #56112 (free model switched off for a signed-in account).

opencode-agent[bot] avatar Oct 17 '26 06:10 opencode-agent[bot]

I completed both requested checks, but unfortunately the issue persists.

Results:

  1. Retested while signed in: Still fails with the same error.
  2. Signed out using opencode auth logout opencode: Started a fresh standalone session and tested DeepSeek V4.1 Flash Free. The exact same error occurred.
  3. Signed back in: Successfully reauthenticated through OpenCode Console, restarted OpenCode, and tested again. Still fails.

Environment:

  • OS: Windows
  • Terminal: PowerShell
  • OpenCode: v2.0.32
  • Region: Southern California, United States
  • Latest troubleshooting timestamp: 2026-10-17 06:22:13 UTC
  • Earlier captured failure: 2026-10-17 06:10:01 UTC

Error:

OpenCode's free tier can only be used from within OpenCode.
Download it at https://opencode.ai and keep building.

The error occurs inside the official OpenCode TUI, including when launched with opencode --standalone.

Since this reproduces both signed in and signed out, it doesn't appear to be specific to my Console account.

Given that the Linux tests succeed, could this be related to Windows client identification, request headers, or a gateway validation issue affecting Windows clients?

I'm happy to run further targeted diagnostics if needed!

mirabhakta avatar Oct 17 '26 06:10 mirabhakta

Same issue here on arch and ubuntu, only happened after upgrading to v2.0.31 before it was fine. Might be coincidencal, don't know of you changed something on the server at the same time.

Btw opencode-go/longcat-2.5-preview-free -> works fine opencode/deepseek-v4.1-flash-free -> does not work opencode/space-bunny-free -> does not work opencode/big-pickle -> does not work

SjurWarEagle avatar Oct 17 '26 06:10 SjurWarEagle

Thanks for running those checks so quickly. Since it fails for you even signed out, your Console account isn't the cause.

I tried again on v2.0.32 (Linux, signed out, no config) against the real Zen gateway between 07:19 and 07:21 UTC. DeepSeek V4.1 Flash Free, Space Bunny Free, Big Pickle and Nemotron 3.5 Lightning Free all replied normally. So did opencode run --standalone with your exact prompt. My earlier runs at 06:17–06:19 UTC also worked, while yours failed at 06:22 UTC.

The same client version works from here and fails for you, and @SjurWarEagle sees it on Linux too. So it doesn't look Windows-specific. It looks more like the gateway treats some networks, regions or times differently. That check runs on the gateway, not in the client code here, so a maintainer will need to look at the gateway logs. Your timestamps (06:10:01 and 06:22:13 UTC) and region will help with that.

Two more checks would help narrow it down:

  1. Try a different network, for example a phone hotspot, with any VPN, proxy or corporate network turned off. Then run opencode run -m opencode/deepseek-v4.1-flash-free "Say hello in one word" and note whether it works or fails, and the time in UTC.
  2. If it still fails, run the same command with --print-logs --log-level debug added, and paste the lines around the error here, with any tokens or keys removed.

Related: #55435 and #55616 (same error, cause not confirmed).

opencode-agent[bot] avatar Oct 17 '26 07:10 opencode-agent[bot]

[torsten@acer ~]$ opencode run --standalone --print-logs --log-level debug  --model 'opencode/deepseek-v4.1-flash-free'  'hi' 
timestamp=2026-10-17T07:37:43.152Z level=INFO run=482b1846 message="spawning process" command=/home/torsten/.opencode/bin/opencode args="[\"serve\",\"--stdio\",\"--port\",\"0\"]" cwd=/home/torsten role=cli
timestamp=2026-10-17T07:37:43.555Z level=INFO run=088867ac message="cli starting" version=2.0.32 channel=latest local=false args="[\"serve\",\"--stdio\",\"--port\",\"0\"]" role=cli
timestamp=2026-10-17T07:37:44.533Z level=INFO run=088867ac message="watcher subscribe" path=/home/torsten/.config/opencode type=directory ignores=3 http.span=150 role=server
timestamp=2026-10-17T07:37:44.545Z level=INFO run=088867ac message="watcher subscribe" path=/home/torsten/.opencode type=directory ignores=3 http.span=162 role=server
timestamp=2026-10-17T07:37:44.548Z level=INFO run=088867ac message="watcher subscribe" path=/etc type=entries ignores=0 http.span=165 role=server
timestamp=2026-10-17T07:37:44.552Z level=INFO run=088867ac message="watcher started" path=/etc type=entries backend=node ignores=0 http.span=169 role=server
timestamp=2026-10-17T07:37:44.553Z level=INFO run=088867ac message="watcher subscribe" path=/ type=entries ignores=0 http.span=170 role=server
timestamp=2026-10-17T07:37:44.555Z level=INFO run=088867ac message="watcher started" path=/ type=entries backend=node ignores=0 http.span=172 role=server
timestamp=2026-10-17T07:37:44.556Z level=INFO run=088867ac message="watcher subscribe" path=/home type=entries ignores=0 http.span=173 role=server
timestamp=2026-10-17T07:37:44.558Z level=INFO run=088867ac message="watcher started" path=/home type=entries backend=node ignores=0 http.span=175 role=server
timestamp=2026-10-17T07:37:44.559Z level=INFO run=088867ac message="watcher subscribe" path=/home/torsten type=entries ignores=0 http.span=176 role=server
timestamp=2026-10-17T07:37:44.562Z level=INFO run=088867ac message="watcher started" path=/home/torsten type=entries backend=node ignores=0 http.span=179 role=server
timestamp=2026-10-17T07:37:44.635Z level=INFO run=088867ac message="watcher started" path=/home/torsten/.config/opencode type=directory backend=inotify ignores=3 http.span=252 role=server
timestamp=2026-10-17T07:37:44.637Z level=INFO run=088867ac message="watcher started" path=/home/torsten/.opencode type=directory backend=inotify ignores=3 http.span=254 role=server
timestamp=2026-10-17T07:37:44.666Z level=INFO run=088867ac message="location services booted" directory=/home/torsten workspaceID=undefined durationMs=277 http.span=283 role=server
timestamp=2026-10-17T07:37:46.987Z level=INFO run=088867ac message="watcher subscribe" path=/home/torsten/.config/opencode/AGENTS.md type=file ignores=0
timestamp=2026-10-17T07:37:46.989Z level=INFO run=088867ac message="watcher started" path=/home/torsten/.config/opencode/AGENTS.md type=file backend=node ignores=0 http.span=2606 role=server
timestamp=2026-10-17T07:37:46.991Z level=INFO run=088867ac message="watcher subscribe" path=/home/torsten/AGENTS.md type=file ignores=0
timestamp=2026-10-17T07:37:46.994Z level=INFO run=088867ac message="watcher started" path=/home/torsten/AGENTS.md type=file backend=node ignores=0 http.span=2611 role=server
timestamp=2026-10-17T07:37:47.163Z level=INFO run=088867ac message="watcher subscribe" path=/home/torsten/.config/opencode/skill type=file ignores=0
timestamp=2026-10-17T07:37:47.165Z level=INFO run=088867ac message="watcher started" path=/home/torsten/.config/opencode/skill type=file backend=node ignores=0 http.span=2782 role=server
timestamp=2026-10-17T07:37:47.176Z level=INFO run=088867ac message="watcher subscribe" path=/home/torsten/.config/opencode/skills type=file ignores=0
timestamp=2026-10-17T07:37:47.177Z level=INFO run=088867ac message="watcher started" path=/home/torsten/.config/opencode/skills type=file backend=node ignores=0 http.span=2794 role=server
timestamp=2026-10-17T07:37:47.182Z level=INFO run=088867ac message="watcher subscribe" path=/home/torsten/.opencode/skill type=file ignores=0
timestamp=2026-10-17T07:37:47.183Z level=INFO run=088867ac message="watcher started" path=/home/torsten/.opencode/skill type=file backend=node ignores=0 http.span=2800 role=server
timestamp=2026-10-17T07:37:47.189Z level=INFO run=088867ac message="watcher subscribe" path=/home/torsten/.opencode/skills type=file ignores=0
timestamp=2026-10-17T07:37:47.190Z level=INFO run=088867ac message="watcher started" path=/home/torsten/.opencode/skills type=file backend=node ignores=0 http.span=2807 role=server
timestamp=2026-10-17T07:37:47.270Z level=INFO run=088867ac message=event event.id=evt_148cba206001sC19MN4twcO4Ru event.created=1792222667270 event.type=provider.updated event.location.directory=/home/torsten event.location.workspaceID=undefined event.data={} http.span=2887 role=server
timestamp=2026-10-17T07:37:47.331Z level=INFO run=088867ac message=event event.id=evt_148cba243001bBELMbJYnhcjXW event.created=1792222667331 event.type=model.updated event.location.directory=/home/torsten event.location.workspaceID=undefined event.data={} http.span=2948 role=server
timestamp=2026-10-17T07:37:47.341Z level=INFO run=088867ac message=event event.id=evt_148cba24c0010ADphUgyZ7RVCZ event.created=1792222667340 event.type=agent.updated event.location.directory=/home/torsten event.location.workspaceID=undefined event.data={} http.span=2958 role=server
timestamp=2026-10-17T07:37:47.345Z level=INFO run=088867ac message=event event.id=evt_148cba250001linh5NfC30Zc2p event.created=1792222667344 event.type=command.updated event.location.directory=/home/torsten event.location.workspaceID=undefined event.data={} http.span=2962 role=server
timestamp=2026-10-17T07:37:48.657Z level=ERROR run=088867ac message="Failed to drain Session" cause="AI.Error: OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building.\n    at zz (/$bunfs/root/chunk-z3j5zn3a.js:6:3619)\n    at <anonymous> (/$bunfs/root/chunk-z3j5zn3a.js:6:3312)\n    at SessionStep.attempt (/$bunfs/root/chunk-wje5hx83.js:383:3574)\n    at SessionStep.attempt (definition) (/$bunfs/root/chunk-wje5hx83.js:368:302)\n    at SessionRunner.runStep (/$bunfs/root/chunk-wje5hx83.js:383:2672)\n    at SessionRunner.runStep (definition) (/$bunfs/root/chunk-wje5hx83.js:383:2826)\n    at SessionRunner.drain (/$bunfs/root/chunk-3fwa7k0x.js:18:2552)\n    at SessionRunner.drain (definition) (/$bunfs/root/chunk-wje5hx83.js:383:516)\n    at ServerProcess.start (/$bunfs/root/chunk-f2pr1npd.js:2:7534)\n    at ServerProcess.start (definition) (/$bunfs/root/chunk-wje5hx83.js:454:25665) {\n  [cause]: AI.Error.Authentication: OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building.\n      at kf (/$bunfs/root/chunk-z3j5zn3a.js:6:574)\n      at zz (/$bunfs/root/chunk-z3j5zn3a.js:6:3630)\n      at <anonymous> (/$bunfs/root/chunk-z3j5zn3a.js:6:3312)\n}" role=server sessionID=<sessionid>
Error: OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building.
timestamp=2026-10-17T07:37:48.710Z level=INFO run=088867ac message="Sent HTTP response" http.span=1823 role=server http.method=GET http.url=/api/event http.status=200
timestamp=2026-10-17T07:37:48.889Z level=INFO run=088867ac message="watcher stopped" path=/home/torsten/.config/opencode/skill type=file http.span=4506 role=server
timestamp=2026-10-17T07:37:48.890Z level=INFO run=088867ac message="watcher stopped" path=/home/torsten/.config/opencode/skills type=file http.span=4507 role=server
timestamp=2026-10-17T07:37:48.891Z level=INFO run=088867ac message="watcher stopped" path=/home/torsten/.opencode/skill type=file http.span=4508 role=server
timestamp=2026-10-17T07:37:48.892Z level=INFO run=088867ac message="watcher stopped" path=/home/torsten/.opencode/skills type=file http.span=4509 role=server
timestamp=2026-10-17T07:37:48.912Z level=INFO run=088867ac message="watcher stopped" path=/home/torsten/AGENTS.md type=file http.span=4529 role=server
timestamp=2026-10-17T07:37:48.914Z level=INFO run=088867ac message="watcher stopped" path=/home/torsten/.config/opencode/AGENTS.md type=file http.span=4531 role=server
timestamp=2026-10-17T07:37:48.954Z level=INFO run=088867ac message="watcher stopped" path=/etc type=entries http.span=4571 role=server
timestamp=2026-10-17T07:37:48.955Z level=INFO run=088867ac message="watcher stopped" path=/ type=entries http.span=4572 role=server
timestamp=2026-10-17T07:37:48.956Z level=INFO run=088867ac message="watcher stopped" path=/home type=entries http.span=4573 role=server
timestamp=2026-10-17T07:37:48.956Z level=INFO run=088867ac message="watcher stopped" path=/home/torsten type=entries http.span=4573 role=server
timestamp=2026-10-17T07:37:48.958Z level=INFO run=088867ac message="watcher stopped" path=/home/torsten/.config/opencode type=directory http.span=4575 role=server
timestamp=2026-10-17T07:37:48.959Z level=INFO run=088867ac message="watcher stopped" path=/home/torsten/.opencode type=directory http.span=4576 role=server

does not work. using mobile hotspot, logged out of opencode go sub

SjurWarEagle avatar Oct 17 '26 07:10 SjurWarEagle

Confirming this on Windows, Desktop app v2.0.32 (official opencode-desktop-win-x64.exe installer). A few data points that may help narrow it down:

  • Genuinely the official client. The Desktop app runs the shared background service (opencode-cli.exe, confirmed via /api/info). No npm/third-party client involved.
  • Signed in with a valid Console session. Stored credential is type: oauth, server https://opencode.ai/console, orgName: Personal, created 2026-10-17, expires 30 days out (not expired). Re-authenticating with a fresh device-code sign-in did not help, and signing out / --standalone reproduce it the same way.
  • Config is clean — the #55435 workaround doesn't apply here. There is no manual opencode provider entry pointing at https://opencode.ai/zen/v1 anywhere (global opencode.jsonc only defines my own custom providers + local models). So the rejection isn't coming from a stray zen/v1 override.
  • Zen gateway is reachable, but free-tier inference403s. From my network, https://opencode.ai/zen/v1/models returns HTTP 200, yet free-tier model requests are rejected — and per #55995 that403 surfaces as AI.Error.Authentication ("...can only be used from within OpenCode"). This lines up with #56334's finding that the403 is network/eligibility-dependent at the hosted gateway rather than in the client.
  • Timeline: free-tier models worked through ~Oct 10 and began failing ~Oct 17 with no client-side change. My own custom providers are unaffected.

Happy to provide any non-sensitive details (version strings, timings, response headers) if useful — just say what would help.

melodiw82 avatar Oct 17 '26 07:10 melodiw82

I did let opencode (with go-sub) fetch the http-requests, that's why the "prompt" is a bit strange.

Request:
POST /inference/openai/v1/chat/completions HTTP/1.1
Authorization: Bearer public
Content-Type: application/json
User-Agent: opencode/latest/2.0.32/cli
b3: <xxx>
traceparent: 00-e58a8b04e76fec58804e7d236e4d753b-c1ac674d88eb28e3-01
x-opencode-client: cli
x-opencode-project: <xxx>
x-opencode-session: <xxx>
x-opencode-session-id: <xxx>
x-session-affinity: <xxx>
x-session-id: ses_<xxx>
Connection: keep-alive
Accept: */*
Host: opencode.ai
Accept-Encoding: gzip, deflate, br, zstd
Content-Length: 2367

{"model":"deepseek-v4.1-flash-free","messages":[{"role":"system","content":"You are a title generator. You output ONLY a thread title. Nothing else.\n\n<task>\nGenerate a brief title that would
help the user find this conversation later.\n\nFollow all rules in <rules>\nUse the <examples> so you know what a good title looks like.\nYour output must be:\n- A single line\n- <=50 characters
\n- No explanations\n</task>\n\n<rules>\n- you MUST use the same language as the user message you are summarizing\n- Title must be grammatically correct and read naturally - no word salad\n- Nev
er include tool names in the title (e.g. \"read tool\", \"bash tool\", \"edit tool\")\n- Focus on the main topic or question the user needs to retrieve\n- Vary your phrasing - avoid repetitive p
atterns like always starting with \"Analyzing\"\n- When a file is mentioned, focus on WHAT the user wants to do WITH the file, not just that they shared it\n- Keep exact: technical terms, number
s, filenames, HTTP codes\n- Remove: the, this, my, a, an\n- Never assume tech stack\n- Never use tools\n- NEVER respond to questions, just generate a title for the conversation\n- The title shou
ld NEVER include \"summarizing\" or \"generating\" when generating a title\n- DO NOT SAY YOU CANNOT GENERATE A TITLE OR COMPLAIN ABOUT THE INPUT\n- Always output something meaningful, even if th
e input is minimal.\n- If the user message is short or conversational (e.g. \"hello\", \"lol\", \"what's up\", \"hey\"):\n  -> create a title that reflects the user's tone or intent (such as Gre
eting, Quick check-in, Light chat, Intro message, etc.)\n</rules>\n\n<examples>\n\"debug 500 errors in production\" -> Debugging production 500 errors\n\"refactor user service\" -> Refactoring u
ser service\n\"why is app.js failing\" -> app.js failure investigation\n\"implement rate limiting\" -> Rate limiting implementation\n\"how do I connect postgres to my API\" -> Postgres API conne
ction\n\"best practices for React hooks\" -> React hooks best practices\n\"@src/credential.ts can you add refresh token support\" -> Credential refresh token support\n\"@utils/parser.ts this is
broken\" -> Parser bug fix\n\"look at @config.json\" -> Config review\n\"@App.tsx add dark mode toggle\" -> Dark mode toggle in App\n</examples>"},{"role":"user","content":"hi"}],"stream":true,"
stream_options":{"include_usage":true}}
Response:
HTTP/1.1 403 Forbidden
Date: Sat, 17 Oct 2026 07:52:53 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Cf-Placement: remote-IAD
x-opencode-log-id: <xxx>
Content-Encoding: br
Server: cloudflare
CF-RAY: a4bdb9f2bd4f255d-EWR

....D.9.M...n.,L!%........1h.f.`...).MC...ׯ~{/ԕN.Y..R.. yi)[
v N.....t..\Q   .[KA.M.s.9q랕I...5...c....
.
...\U....b..g.ˆՓ.bd...

Parsed body of response:

{"type":"error","error":{"type":"FreeTierError","message":"OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building."}}

SjurWarEagle avatar Oct 17 '26 07:10 SjurWarEagle

Fresh repro on Windows, Desktop app v2.0.32 (official installer), signed-in Console session — still failing, adding one more confirmed UTC timestamp for gateway-log correlation.

Command:

opencode run --standalone --print-logs --log-level debug --model "opencode/deepseek-v4.1-flash-free" "hi"

Result — fails immediately, 2026-10-17T08:17:24.812Z (UTC):

timestamp=2026-10-17T08:17:24.812Z level=ERROR run=<redacted> message="Failed to drain Session"
cause="AI.Error: OpenCode's free tier can only be used from within OpenCode. Download it at
https://opencode.ai and keep building. ... [cause]: AI.Error.Authentication: OpenCode's free tier
can only be used from within OpenCode."
Error: OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building.

Notes:

  • The --print-logs output surfaces the client-side error but does not dump the raw gateway HTTP request — @SjurWarEagle's proxy capture above (the actual POST /inference/openai/v1/chat/completions → 403 FreeTierError) is the better source for the wire-level detail. This is just one more confirmed failing timestamp on a different machine/network for the gateway-log lookup.
  • Confirms the failure on the Desktop app (not just the CLI/TUI), signed-in, Windows, at the timestamp above.

melodiw82 avatar Oct 17 '26 08:10 melodiw82

Looks like they replaced the Free tier exceeded usage message with "Error: OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building."

raymelon avatar Oct 17 '26 08:10 raymelon

19. Looks like they replaced the Free tier exceeded usage message with "Error: OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building."

yes this is true

obvirm avatar Oct 17 '26 08:10 obvirm

Image happens also with v1 on my side. have you tried calling the endpoint from an external ip so not from inside the company network?

SjurWarEagle avatar Oct 17 '26 08:10 SjurWarEagle

@SjurWarEagle Yes — just re-tested from an external IP (off the company network) and it's still the same.

opencode run --standalone --print-logs --log-level debug --model "opencode/deepseek-v4.1-flash-free" "hi"

Failed at 2026-10-17T09:04:06.550Z (UTC) with the identical error:

message="Failed to drain Session" cause="AI.Error: OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building."

So moving off the company network didn't change anything — consistent with this not being a simple on-prem/proxy issue.

melodiw82 avatar Oct 17 '26 09:10 melodiw82

23. @SjurWarEagle Yes — just re-tested from an external IP (off the company network) and it's still the same.

@melodiw82 oh sorry did not mean you, I forgot the @opencode-agent because they wrote

I tried again on v2.0.32 (Linux, signed out, no config) against the real Zen gateway between 07:19 and 07:21 UTC. DeepSeek V4.1 Flash Free, Space Bunny Free, Big Pickle and Nemotron 3.5 Lightning Free all replied normally.

if it is failing for all of us, but working on their side, maybe their routing is different and not ours.

SjurWarEagle avatar Oct 17 '26 09:10 SjurWarEagle

Same issue on

Version: 2.0.32 (latest) Date: 2026-10-17T09:49:23.593Z OS: macOS 25.6.0 (arm64) Model: opencode/glm-5.3-flash-free

Image

naylin-dev avatar Oct 17 '26 09:10 naylin-dev

I also installed OpenCode on a second computer, but I encountered the same error there. This suggests that the issue is not specific to my computer or local installation.

I’m still experiencing the problem with the free models. Could this be an account-side issue or a problem with the free-tier service?

parnazalagheband avatar Oct 17 '26 10:10 parnazalagheband

Additional test on the official Windows Desktop app (v2.0.32): Beam Free and Nemotron 3.5 Super VL Free both fail on the first message in a fresh session with the same free-tier error. OpenCode Console authentication succeeds. I temporarily removed my custom local Ollama/OpenAI-compatible provider configuration and restarted the OpenCode service; the error persisted. The configuration has been restored. This does not appear to be caused by that local provider setup.

tomgirod84-afk avatar Oct 17 '26 11:10 tomgirod84-afk

I removed opencode and its config fully from the computer and re-installed it. But the issue still persists in both terminal and desktop version.

melodiw82 avatar Oct 17 '26 11:10 melodiw82