Back to articles
Fixing "invalid token" in OpenCode: A Working Claude (Anthropic) OAuth Solution

Fixing "invalid token" in OpenCode: A Working Claude (Anthropic) OAuth Solution

via Dev.to Webdevrokeyxuhleremny1

If you're using OpenCode with Anthropic’s Claude and suddenly started seeing errors like: invalid token authentication failed unauthorized request You're not alone. But here's the good news — there is a working solution, and you can get everything running again in just a couple of minutes. 🚀 The Solution (Works Right Now) I built a small open-source plugin that restores Claude access inside OpenCode using OAuth: 👉 https://github.com/rokeyxuhleremny1/invalid-token-opencode What it does Lets you log in with your Claude Pro / Max account Restores access to all Anthropic models Fixes broken token flows Requires no Claude Code installation Handles authentication automatically ⚡ Quick Setup Install the plugin: npm install -g opencode-anthropic-oauth Add it to your config: { "plugin" : [ "opencode-anthropic-oauth" ] } Then run: /connect or: oc auth login Select: Anthropic → Claude Pro/Max Complete the browser login → paste the code → done. ✅ Claude is working again. 🧠 How It Works Instead of

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
7 views

Related Articles