根因确认了:OpenCode 免费层只能走官方客户端,直接调 API 会 403(官方报错 FreeTierError)。绕过手法是把自己伪装成官方客户端:请求打 https://opencode.ai/inference/v1/responses,带上 User-Agent: opencode/latest/2.0.29/cli、x-opencode-session-id、x-session-affinity 头(Authorization: Bearer {Your Key}),body 里 model 用 muse-spark-1.3-contributor-free,且 tools 轴上必须带一个精确名为 read 的 function 工具;pi、zcode 等第三方客户端实测还要删掉 Session_id 和 x_session_id 两个头。另有佬友实测:真正的卡点现在是 IP 黑名单——官方客户端也会报"detected abusive traffic from this IP address",换(伪)家宽 IP 后能用,单个 IP 大约 8M tokens 后又 403。
来源: https://github.com/decolua/9router/issues/4781
|