Same issue here.
Environment
opencode version: 1.18.31
app: Desktop (x-opencode-client: desktop)
user-agent: opencode/1.18.31 ai-sdk/provider-utils/4.0.23 runtime/node.js/24
OS: Windows
requestedModel: big-pickle (provider opencode)
stream: true, path /inference/openai/v1/chat/completions
country: BR
Details
The request is sent from the official Desktop app and still gets rejected with HTTP 403:
Generation.FreeTierError: OpenCode's free tier can only be used from within OpenCode
The x-opencode-client: desktop, x-opencode-session and x-opencode-request-id headers are present, so the client is clearly identifiable as official OpenCode. It behaves exactly like an external/curl request with a wrong User-Agent.
Reproduction: authenticate in Desktop 1.18.31, pick big-pickle, send any message.
Event metadata
{
"event": {
"id": "3b7a01ac-f0a8-47a5-bc5e-86ede6f03bdd",
"requestID": "msg_0c3e7a17b001jq7ajm0mTzPl20",
"workspaceID": "wrk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"startedAt": 1789993129648,
"finishedAt": 1789993129679,
"durationMs": 31,
"outcome": "rejected",
"category": "inference",
"protocol": "openai-chat",
"product": "standard",
"path": "/inference/openai/v1/chat/completions",
"method": "POST",
"stream": true,
"app": "desktop",
"sessionID": "ses_f3c185e88ffeAvrYnUKKarZS3k",
"userAgent": "opencode/1.18.31 ai-sdk/provider-utils/4.0.23 runtime/node.js/24",
"serviceAccountID": "svcacct_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"serviceAPIKeyID": "key_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"requestedModel": "big-pickle",
"provider": "opencode",
"statusCode": 403,
"errorCode": "Generation.FreeTierError",
"errorMessage": "OpenCode's free tier can only be used from within OpenCode",
"country": "BR",
"region": "São Paulo",
"city": "São Paulo",
"requestHeaders": {
"accept": "/",
"content-length": "35137",
"content-type": "application/json",
"user-agent": "opencode/1.18.31 ai-sdk/provider-utils/4.0.23 runtime/node.js/24",
"x-opencode-client": "desktop",
"x-opencode-request-id": "msg_0c3e7a17b001jq7ajm0mTzPl20",
"x-opencode-session": "ses_f3c185e88ffeAvrYnUKKarZS3k"
},
"responseHeaders": {
"content-length": "120",
"content-type": "application/json"
},
"metadata": {},
"attemptCount": 0,
"attempts": []
}
}