You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] "OpenCode's free tier can only be used from within OpenCode" error when using Custom Agents #50081
Describe the bug
I am encountering an error when attempting to use a custom agent configuration within OpenCode. The request fails, and the console outputs the following error message:
Error from provider (Console): OpenCode's free tier can only be used from within OpenCode
To Reproduce
Configure a custom agent (e.g., modifying the configuration to use a specific model or custom prompt).
Trigger the agent within the OpenCode environment.
Observe the error in the console output.
Expected behavior
The custom agent should execute normally using the available free tier, as it is being invoked from within the OpenCode application.
Actual behavior
The provider rejects the request, stating that the free tier can only be used "within OpenCode," despite the request originating from the OpenCode client.
Additional Context
It appears the provider's validation logic might be incorrectly identifying the custom agent request as an external or unauthorized source.
Attached is a screenshot of the specific error message.
I ran into this same issue yesterday while trying to run a custom agent. After digging around, it looks like this is a known side effect of OpenCode's V1 → V2 migration — agent configs defined the old way won't work under V2 without updating the permission format.
For reference, here's a simple code reviewer agent definition:
V1 (old) permission format:
---description: Primary review agent that validates implementation quality and creates comprehensive test scenariosmode: primarymodel: opencode/mimo-v2.5-freetemperature: 0.1permission:
read: allowedit: denybash: deny---
You are the Primary Review Agent responsible for validating implementation quality and creating comprehensive test scenarios.
V2 (new) permission format:
---description: Primary review agent that validates implementation quality and creates comprehensive test scenariosmode: primarymodel: opencode/mimo-v2.5-freepermissions:
- action: readresource: "*"effect: allow
- action: editresource: "*"effect: deny
- action: bashresource: "*"effect: deny---
You are the Primary Review Agent responsible for validating implementation quality and creating comprehensive test scenarios.
Switching to the V2 permission block (array of {action, resource, effect} objects instead of the flat permission map) fixed it for me. This isn't a bug on OpenCode's end — it's purely a migration issue on the agent config side.
Reproduces on 2.0.12 (macOS, Homebrew) — and the trigger narrows down to the agent's deny permissions, not the permission format. The V2 permissions array does not fix it here:
printf 'Reply with one word: ok' | opencode run --standalone --model opencode/muse-spark-1.3-contributor-free --format json --agent deny
→ {"type":"error","error":{"type":"provider.auth","message":"Error from provider (Console): OpenCode's free tier can only be used from within OpenCode","status":403}}
The same invocation with --agent build (or an agent without denies) answers normally; --standalone makes no difference.
Environment: opencode v2.0.12 (Homebrew opencode-v2), macOS 27.0 arm64. Suspect: with tools stripped by deny, the request no longer passes the console-side origin check.
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.
Activity
zzjcnn commentedon Sep 20, 2026
Neloy-Barman commentedon Sep 20, 2026
I ran into this same issue yesterday while trying to run a custom agent. After digging around, it looks like this is a known side effect of OpenCode's V1 → V2 migration — agent configs defined the old way won't work under V2 without updating the permission format.
For reference, here's a simple code reviewer agent definition:
V1 (old) permission format:
V2 (new) permission format:
Switching to the V2 permission block (array of
{action, resource, effect}objects instead of the flatpermissionmap) fixed it for me. This isn't a bug on OpenCode's end — it's purely a migration issue on the agent config side.Docs: https://opencode.ai/v2/docs/migrate-v1/#permissions-and-tools
qstmenu commentedon Sep 20, 2026
Got the same issue when running the "opencode agent create" command to make custom agent.
Neloy-Barman commentedon Sep 20, 2026
@qstmenu, try creating the agent config manually instead of using CMD.
Drasenix commentedon Sep 21, 2026
@Neloy-Barman Thank you ! It worked for me !
Neloy-Barman commentedon Sep 21, 2026
@Drasenix Welcome.
marco-rionaut commentedon Sep 22, 2026
Reproduces on 2.0.12 (macOS, Homebrew) — and the trigger narrows down to the agent's deny permissions, not the permission format. The V2
permissionsarray does not fix it here:f4nopermbereit(works)f4denyedit+shell→denyf4denyv1edit: deny,bash: denyMinimal repro:
.opencode/agent/deny.mdprintf 'Reply with one word: ok' | opencode run --standalone --model opencode/muse-spark-1.3-contributor-free --format json --agent deny{"type":"error","error":{"type":"provider.auth","message":"Error from provider (Console): OpenCode's free tier can only be used from within OpenCode","status":403}}The same invocation with
--agent build(or an agent without denies) answers normally;--standalonemakes no difference.Environment: opencode v2.0.12 (Homebrew
opencode-v2), macOS 27.0 arm64. Suspect: with tools stripped bydeny, the request no longer passes the console-side origin check.sekedus commentedon Sep 22, 2026
see my workaround here.
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊
SC0d3r commentedon Oct 17, 2026
I am constantly getting this error in opencode version v2.0.32
and i am not using any agent, its just a simple default build mode in opencode v2
sixfingerdev commentedon Oct 18, 2026
me too, in opencode 2