Anthropic Subscription Key not working anymore #7800

Closed
opened 2026-02-16 18:08:16 -05:00 by yindo · 38 comments
Owner

Originally created by @robertfels on GitHub (Jan 28, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When attempting to use Anthropic models (Opus/Sonnet) after authenticating with my Anthropic subscription, I receive the following error:

This credential is only authorized for use with Claude Code and cannot be used for other API requests.

📅 The issue started around 6:00 AM UTC on January 28, 2026.

I have already tried logging out and back in — the issue persists.

I found similar issues reported previously where the suggested fix was to use the plugin opencode-anthropic-auth@0.0.7/0.0.8/latest. However, this workaround no longer resolves the problem.

Plugins

None

OpenCode version

1.1.37

Steps to reproduce

  1. Log in using Anthropic Subscription credentials
  2. Select an Anthropic model (Opus or Sonnet)
  3. Run any prompt
  4. Error appears: "This credential is only authorized for use with Claude Code and cannot be used for other API requests."

Fix in place! Should it be registered automatically or manually:

Add the following to ~/.config/opencode/opencode.json:

"plugin": ["opencode-anthropic-auth@latest"],

Screenshot and/or share link

Image

Operating System

macOS 26.2 (25C56)

Terminal

Terminal.app

Originally created by @robertfels on GitHub (Jan 28, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When attempting to use Anthropic models (Opus/Sonnet) after authenticating with my Anthropic subscription, I receive the following error: `This credential is only authorized for use with Claude Code and cannot be used for other API requests.` **📅 The issue started around 6:00 AM UTC on January 28, 2026.** I have already tried logging out and back in — the issue persists. I found similar issues reported previously where the suggested fix was to use the plugin `opencode-anthropic-auth@0.0.7/0.0.8/latest`. However, **this workaround no longer resolves the problem**. ### Plugins None ### OpenCode version [1.1.37](https://github.com/anomalyco/opencode/releases/tag/v1.1.37) ### Steps to reproduce 1. Log in using Anthropic Subscription credentials 2. Select an Anthropic model (Opus or Sonnet) 3. Run any prompt 4. Error appears: *"This credential is only authorized for use with Claude Code and cannot be used for other API requests."* ### ✅ Fix in place! Should it be registered automatically or manually: Add the following to `~/.config/opencode/opencode.json`: ```json "plugin": ["opencode-anthropic-auth@latest"], ``` ### Screenshot and/or share link <img width="1133" height="644" alt="Image" src="https://github.com/user-attachments/assets/1eb75bbc-dfdf-4651-b107-b92bdffbc156" /> ### Operating System macOS 26.2 (25C56) ### Terminal Terminal.app
yindo added the bug label 2026-02-16 18:08:16 -05:00
yindo closed this issue 2026-02-16 18:08:16 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 28, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #10936: This credential is only authorized for use with Claude Code (reported Jan 28, between 06:00-07:00 CET)
  • #7456: fix: Claude Code API credentials (discusses the same error and suggests detecting Claude Code-specific keys)
  • #7471: Claude Subscription is not working anymore (same error message and Anthropic login issue)
  • #7410: Broken Claude Max (similar Anthropic credential authorization error)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 28, 2026): This issue might be a duplicate of existing issues. Please check: - #10936: This credential is only authorized for use with Claude Code (reported Jan 28, between 06:00-07:00 CET) - #7456: fix: Claude Code API credentials (discusses the same error and suggests detecting Claude Code-specific keys) - #7471: Claude Subscription is not working anymore (same error message and Anthropic login issue) - #7410: Broken Claude Max (similar Anthropic credential authorization error) Feel free to ignore if none of these address your specific case.
Author
Owner

@shandilyaaryan commented on GitHub (Jan 28, 2026):

+1

@shandilyaaryan commented on GitHub (Jan 28, 2026): +1
Author
Owner

@marcdix commented on GitHub (Jan 28, 2026):

+1 - I also reported it here but closed it in favor of this one.

@marcdix commented on GitHub (Jan 28, 2026): +1 - I also reported it [here](https://github.com/anomalyco/opencode/issues/10936) but closed it in favor of this one.
Author
Owner

@nakdeyes commented on GitHub (Jan 28, 2026):

UGH! I was flying an hour or two ago and just settled down for an evening of robot coding 🥀 . What can I do to help? Claude Code is garbo tier compared to OpenCode

@nakdeyes commented on GitHub (Jan 28, 2026): UGH! I was flying an hour or two ago and just settled down for an evening of robot coding 🥀 . What can I do to help? Claude Code is garbo tier compared to OpenCode
Author
Owner

@Sandipbgn commented on GitHub (Jan 28, 2026):

+1

@Sandipbgn commented on GitHub (Jan 28, 2026): +1
Author
Owner

@hardme commented on GitHub (Jan 28, 2026):

+1

@hardme commented on GitHub (Jan 28, 2026): +1
Author
Owner

@robertfels commented on GitHub (Jan 28, 2026):

I've seen similar bug tickets here in the past with a solution like: "plugin": ["opencode-gemini-auth@0.0.7/0.0.8/latest"]. However, this solution doesn't seem to work currently either.

@robertfels commented on GitHub (Jan 28, 2026): I've seen similar bug tickets here in the past with a solution like: `"plugin": ["opencode-gemini-auth@0.0.7/0.0.8/latest"]`. However, this **solution doesn't seem to work** currently either.
Author
Owner

@marcdix commented on GitHub (Jan 28, 2026):

I cancelled my Claude Code Max subscription. IMO that's the step ye all should do and write as the reason that they lock out their paying customers from using a software that actually works (Claude Code turned into absolute garbage in the last 2 weeks).

@marcdix commented on GitHub (Jan 28, 2026): I cancelled my Claude Code Max subscription. IMO that's the step ye all should do and write as the reason that they lock out their paying customers from using a software that actually works (Claude Code turned into absolute garbage in the last 2 weeks).
Author
Owner

@mdaiter commented on GitHub (Jan 28, 2026):

https://github.com/anomalyco/opencode-anthropic-auth/issues/17#issuecomment-3752059576
^this worked for me, from @geohot

@mdaiter commented on GitHub (Jan 28, 2026): https://github.com/anomalyco/opencode-anthropic-auth/issues/17#issuecomment-3752059576 ^this worked for me, from @geohot
Author
Owner

@LunVT1k commented on GitHub (Jan 28, 2026):

+1

@LunVT1k commented on GitHub (Jan 28, 2026): +1
Author
Owner

@robertfels commented on GitHub (Jan 28, 2026):

@mdaiter that worked for me! Thanks

@robertfels commented on GitHub (Jan 28, 2026): @mdaiter that worked for me! Thanks
Author
Owner

@konradbachowski commented on GitHub (Jan 28, 2026):

+1

@konradbachowski commented on GitHub (Jan 28, 2026): +1
Author
Owner

@konradbachowski commented on GitHub (Jan 28, 2026):

anomalyco/opencode-anthropic-auth#17 (comment) ^this worked for me, from @geohot

also worked xD the weirdest hack i've seen today haha

@konradbachowski commented on GitHub (Jan 28, 2026): > [anomalyco/opencode-anthropic-auth#17 (comment)](https://github.com/anomalyco/opencode-anthropic-auth/issues/17#issuecomment-3752059576) ^this worked for me, from [@geohot](https://github.com/geohot) also worked xD the weirdest hack i've seen today haha
Author
Owner

@mihnearad commented on GitHub (Jan 28, 2026):

I tried the trick with custom build prompt but I get the same API error. Any other step I missed ?

Image
@mihnearad commented on GitHub (Jan 28, 2026): I tried the trick with custom build prompt but I get the same API error. Any other step I missed ? <img width="911" height="175" alt="Image" src="https://github.com/user-attachments/assets/4a6c2007-1c43-4f1d-a186-0e70b5ca8b81" />
Author
Owner

@robertfels commented on GitHub (Jan 28, 2026):

Now the workaround stopped working for me again

@robertfels commented on GitHub (Jan 28, 2026): Now the workaround stopped working for me again
Author
Owner

@robertfels commented on GitHub (Jan 28, 2026):

I tried the trick with custom build prompt but I get the same API error. Any other step I missed ?

Seems not to be stable

@robertfels commented on GitHub (Jan 28, 2026): > I tried the trick with custom build prompt but I get the same API error. Any other step I missed ? Seems not to be stable
Author
Owner

@mihnearad commented on GitHub (Jan 28, 2026):

I tried the trick with custom build prompt but I get the same API error. Any other step I missed ?

Seems not to be stable

It seems so, thank you. Was not sure if it's my fault

@mihnearad commented on GitHub (Jan 28, 2026): > > I tried the trick with custom build prompt but I get the same API error. Any other step I missed ? > > Seems not to be stable It seems so, thank you. Was not sure if it's my fault
Author
Owner

@meganechan commented on GitHub (Jan 28, 2026):

+1

@meganechan commented on GitHub (Jan 28, 2026): +1
Author
Owner

@vijay-joshi commented on GitHub (Jan 28, 2026):

+1

@vijay-joshi commented on GitHub (Jan 28, 2026): +1
Author
Owner

@mihnearad commented on GitHub (Jan 28, 2026):

I’m really curious whether the opencode team will manage to get this working again. Anthropic seems to be doubling down on their terms and conditions quite hard. Just discovered opencode a week ago and loved it compared to CC

@mihnearad commented on GitHub (Jan 28, 2026): I’m really curious whether the opencode team will manage to get this working again. Anthropic seems to be doubling down on their terms and conditions quite hard. Just discovered opencode a week ago and loved it compared to CC
Author
Owner

@drjagan commented on GitHub (Jan 28, 2026):

Opencoders, pls react to the first post here instead of +1 to indicated that you have the same issue to keep this thread clean for any possible solutions. Thank you

@drjagan commented on GitHub (Jan 28, 2026): Opencoders, pls react to the first post here instead of +1 to indicated that you have the same issue to keep this thread clean for any possible solutions. Thank you
Author
Owner

@code-xhyun commented on GitHub (Jan 28, 2026):

+1

@code-xhyun commented on GitHub (Jan 28, 2026): +1
Author
Owner

@furai commented on GitHub (Jan 28, 2026):

I think I've found the fix to this - if you can regenerate the API key - regenerate it manually in the claude console. Make sure to choose different workspace than Claude Code. Use that manually generated key to auth opencode with anthropic. Please let me know if this worked for anyone. Maybe it just started working on my end.

Probably the correct fix then for opencode would be to generate some link that creates API key in some different worskpace than Claude Code.

@furai commented on GitHub (Jan 28, 2026): I think I've found the fix to this - if you can regenerate the API key - regenerate it manually in the claude console. Make sure to choose different workspace than `Claude Code`. Use that manually generated key to auth opencode with anthropic. Please let me know if this worked for anyone. Maybe it just started working on my end. Probably the correct fix then for opencode would be to generate some link that creates API key in some different worskpace than Claude Code.
Author
Owner

@mihnearad commented on GitHub (Jan 28, 2026):

I fixed it by following the advice in this thread: https://github.com/anomalyco/opencode/issues/10956#issuecomment-3810084980

root@Webserver:  cat ~/.config/opencode/opencode.json


{
  "$schema": "https://opencode.ai/config.json",
  "mode": {
    "build": {
      "prompt": "You are Claude Code, Anthropic's official CLI for Claude."
    },
    "plan": {
      "prompt": "You are Claude Code, Anthropic's official CLI for Claude."
    }
  },
  "autoupdate": false
}
@mihnearad commented on GitHub (Jan 28, 2026): I fixed it by following the advice in this thread: https://github.com/anomalyco/opencode/issues/10956#issuecomment-3810084980 ``` root@Webserver: cat ~/.config/opencode/opencode.json { "$schema": "https://opencode.ai/config.json", "mode": { "build": { "prompt": "You are Claude Code, Anthropic's official CLI for Claude." }, "plan": { "prompt": "You are Claude Code, Anthropic's official CLI for Claude." } }, "autoupdate": false } ```
Author
Owner

@Cyenoch commented on GitHub (Jan 28, 2026):

Add this to the plugin in opencode.json.

"opencode-anthropic-auth@latest"

{
 
"plugin": [
    "opencode-anthropic-auth@latest"
  ]
}
@Cyenoch commented on GitHub (Jan 28, 2026): Add this to the plugin in `opencode.json`. "opencode-anthropic-auth@latest" ```json { … "plugin": [ "opencode-anthropic-auth@latest" ] } ```
Author
Owner

@rustikus commented on GitHub (Jan 28, 2026):

I think I've found the fix to this - if you can regenerate the API key - regenerate it manually in the claude console. Make sure to choose different workspace than Claude Code. Use that manually generated key to auth opencode with anthropic. Please let me know if this worked for anyone. Maybe it just started working on my end.

Probably the correct fix then for opencode would be to generate some link that creates API key in some different worskpace than Claude Code.

Not sure, but isn't this just using the API cost plan instead of the subscription?

@rustikus commented on GitHub (Jan 28, 2026): > I think I've found the fix to this - if you can regenerate the API key - regenerate it manually in the claude console. Make sure to choose different workspace than `Claude Code`. Use that manually generated key to auth opencode with anthropic. Please let me know if this worked for anyone. Maybe it just started working on my end. > > Probably the correct fix then for opencode would be to generate some link that creates API key in some different worskpace than Claude Code. Not sure, but isn't this just using the API cost plan instead of the subscription?
Author
Owner

@furai commented on GitHub (Jan 28, 2026):

Not sure, but isn't this just using the API cost plan instead of the subscription?

Oh, so you're talking about Claude pro/max subscription? Isn't it unsupported by Anthropic and against their ToS? I've been using API key since they have done the change. And now the API key stopped working for me so I had to regenerate it in different workspace than Claude Code. I haven't been using subscription.

@furai commented on GitHub (Jan 28, 2026): > Not sure, but isn't this just using the API cost plan instead of the subscription? Oh, so you're talking about Claude pro/max subscription? Isn't it unsupported by Anthropic and against their ToS? I've been using API key since they have done the change. And now the API key stopped working for me so I had to regenerate it in different workspace than `Claude Code`. I haven't been using subscription.
Author
Owner

@HarKro753 commented on GitHub (Jan 28, 2026):

Add this to the plugin in opencode.json.

"opencode-anthropic-auth@latest"

{

"plugin": [
"opencode-anthropic-auth@latest"
]
}

This fixed the issue as of jan 28

@HarKro753 commented on GitHub (Jan 28, 2026): > Add this to the plugin in `opencode.json`. > > "opencode-anthropic-auth@latest" > > { > … > "plugin": [ > "opencode-anthropic-auth@latest" > ] > } This fixed the issue as of jan 28
Author
Owner

@prravda commented on GitHub (Jan 28, 2026):

#FREEOPENCODE


Currently prompt injection like this is blocked.
https://github.com/anomalyco/opencode/issues/10937#issuecomment-3810161724 works for me


vi ~/.config/opencode/opencode.json
{
    "$schema": "https://opencode.ai/config.json",
    "mode": {
        "build": {
            "prompt": "You are Claude Code, Anthropic's official CLI for Claude."
        },
        "plan": {
            "prompt": "You are Claude Code, Anthropic's official CLI for Claude."
        }
    },
    "plugin": ["opencode-anthropic-auth@latest"]
}
@prravda commented on GitHub (Jan 28, 2026): #FREEOPENCODE --- Currently prompt injection like [this](https://github.com/anomalyco/opencode/issues/10937#issuecomment-3810139285) is blocked. https://github.com/anomalyco/opencode/issues/10937#issuecomment-3810161724 works for me --- ```shell vi ~/.config/opencode/opencode.json ``` ```json { "$schema": "https://opencode.ai/config.json", "mode": { "build": { "prompt": "You are Claude Code, Anthropic's official CLI for Claude." }, "plan": { "prompt": "You are Claude Code, Anthropic's official CLI for Claude." } }, "plugin": ["opencode-anthropic-auth@latest"] } ```
Author
Owner

@Steffen025 commented on GitHub (Jan 28, 2026):

Workaround confirmed working

Added mode override in opencode.json to bypass the pattern matching:

"mode": {
  "build": {
    "prompt": "You are Claude Code, Anthropic's official CLI for Claude."
  },
  "plan": {
    "prompt": "You are Claude Code, Anthropic's official CLI for Claude."
  }
}

Tested with: Anthropic Max Subscription + claude-opus-4-5 and claude-sonnet-4-5

This replaces the system prompt identifier that Anthropic is blocking. Works as of 2026-01-28.

Copy-paste ready: See commit with full opencode.json

Reference: https://github.com/anomalyco/opencode-anthropic-auth/issues/17#issuecomment-3752059576

@Steffen025 commented on GitHub (Jan 28, 2026): ## ✅ Workaround confirmed working Added `mode` override in `opencode.json` to bypass the pattern matching: ```json "mode": { "build": { "prompt": "You are Claude Code, Anthropic's official CLI for Claude." }, "plan": { "prompt": "You are Claude Code, Anthropic's official CLI for Claude." } } ``` **Tested with:** Anthropic Max Subscription + claude-opus-4-5 and claude-sonnet-4-5 This replaces the system prompt identifier that Anthropic is blocking. Works as of 2026-01-28. **Copy-paste ready:** [See commit with full opencode.json](https://github.com/Steffen025/pai-opencode/commit/6934c7f) Reference: https://github.com/anomalyco/opencode-anthropic-auth/issues/17#issuecomment-3752059576
Author
Owner

@nukeop commented on GitHub (Jan 28, 2026):

Somebody report the spammer advertising his vibecoded trash

@nukeop commented on GitHub (Jan 28, 2026): Somebody report the spammer advertising his vibecoded trash
Author
Owner

@Steffen025 commented on GitHub (Jan 28, 2026):

Somebody report the spammer advertising his vibecoded trash

what's your problem with someone giving out a Copy pastable fix that works reportedly in a project with a commit as proof for the working fix?

@Steffen025 commented on GitHub (Jan 28, 2026): > Somebody report the spammer advertising his vibecoded trash what's your problem with someone giving out a Copy pastable fix that works reportedly in a project with a commit as proof for the working fix?
Author
Owner

@nukeop commented on GitHub (Jan 28, 2026):

There is already a fix, it's to use the latest version of the plugin. You're a spammer creating spam repos thinking your vibecoded dumpster fire is some secret nobody knows, and you're trying to advertise them in fucking github issues of all places, and it's obvious.

@nukeop commented on GitHub (Jan 28, 2026): There is already a fix, it's to use the latest version of the plugin. You're a spammer creating spam repos thinking your vibecoded dumpster fire is some secret nobody knows, and you're trying to advertise them in fucking github issues of all places, and it's obvious.
Author
Owner

@Steffen025 commented on GitHub (Jan 28, 2026):

@nukeop Hey, sorry if my activity came across the wrong way. That wasn't the
intention.

I shared the commit link as proof that the workaround works.
When I hit an issue, found a solution, and saw others
struggling with the same problem, my instinct was to share what worked.

I'm relatively new to actively contributing in open source communities.
If there's a better way to share workarounds, I'm genuinely open to
learning. But I have to say - terms like "vibecoded trash" and "dumpster
fire" aren't exactly the kind of feedback that helps newcomers
understand the norms here.

If the fix is already in the latest version - great! That's helpful
information. A simple "this is already fixed in version X" would have
been enough. Thank you.

@Steffen025 commented on GitHub (Jan 28, 2026): @nukeop Hey, sorry if my activity came across the wrong way. That wasn't the intention. I shared the commit link as proof that the workaround works. When I hit an issue, found a solution, and saw others struggling with the same problem, my instinct was to share what worked. I'm relatively new to actively contributing in open source communities. If there's a better way to share workarounds, I'm genuinely open to learning. But I have to say - terms like "vibecoded trash" and "dumpster fire" aren't exactly the kind of feedback that helps newcomers understand the norms here. If the fix is already in the latest version - great! That's helpful information. A simple "this is already fixed in version X" would have been enough. Thank you.
Author
Owner

@nukeop commented on GitHub (Jan 28, 2026):

And now he's copy-pasting output from his AI... I hate the new internet

@nukeop commented on GitHub (Jan 28, 2026): And now he's copy-pasting output from his AI... I hate the new internet
Author
Owner

@Steffen025 commented on GitHub (Jan 28, 2026):

@nukeop
Fair point about the plugin - I checked it out. Unfortunately, as of today there's Issue #32 showing v0.0.13 is broken again ("Credential authorization error"). The plugin has been in a constant cat-and-mouse game with Anthropic's detection (Issues #12, #17, now #32).

Our workaround is simpler - just a system prompt override. Less moving parts, less things that can break. Whether it's more elegant is debatable, but it works right now.

As for using AI to help with this: yes, I do. It's a tool. It helped me research the plugin's issue history, compare approaches, and document the solution. I don't see how that's a problem - if anything, it's exactly what these tools are good for.

Anyway, I'm not here to argue. Just sharing what worked for us. If the plugin gets fixed and works better, great - happy to update my approach.

@Steffen025 commented on GitHub (Jan 28, 2026): @nukeop Fair point about the plugin - I checked it out. Unfortunately, as of today there's Issue #32 showing v0.0.13 is broken again ("Credential authorization error"). The plugin has been in a constant cat-and-mouse game with Anthropic's detection (Issues #12, #17, now #32). Our workaround is simpler - just a system prompt override. Less moving parts, less things that can break. Whether it's more elegant is debatable, but it works right now. As for using AI to help with this: yes, I do. It's a tool. It helped me research the plugin's issue history, compare approaches, and document the solution. I don't see how that's a problem - if anything, it's exactly what these tools are good for. Anyway, I'm not here to argue. Just sharing what worked for us. If the plugin gets fixed and works better, great - happy to update my approach.
Author
Owner

@nukeop commented on GitHub (Jan 28, 2026):

I'm not reading your copy-pasted slop, stop spamming

@nukeop commented on GitHub (Jan 28, 2026): I'm not reading your copy-pasted slop, stop spamming
Author
Owner

@robertfels commented on GitHub (Jan 28, 2026):

Fixed in this issue: https://github.com/anomalyco/opencode-anthropic-auth/issues/17#issuecomment-3752059576

@robertfels commented on GitHub (Jan 28, 2026): Fixed in this issue: https://github.com/anomalyco/opencode-anthropic-auth/issues/17#issuecomment-3752059576
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7800