Skip to content

Anthropic Subscription Key not working anymore #10937

Closed

Description

@robertfels

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 [email protected]/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

Activity

  1. github-actions commented on Jan 28, 2026

    @github-actions
    Contributor

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

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

  2. shandilyaaryan commented on Jan 28, 2026

    @shandilyaaryan

    +1

  3. marcdix commented on Jan 28, 2026

    @marcdix

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

  4. nakdeyes commented on Jan 28, 2026

    @nakdeyes

    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

  5. Sandipbgn commented on Jan 28, 2026

    @Sandipbgn

    +1

  6. 2333xb commented on Jan 28, 2026

    @2333xb

    +1

  7. robertfels commented on Jan 28, 2026

    @robertfels
    Author

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

  8. marcdix commented on Jan 28, 2026

    @marcdix

    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).

  9. mdaiter commented on Jan 28, 2026

    @mdaiter
  10. robertfels commented on Jan 28, 2026

    @robertfels
    Author

    @mdaiter that worked for me! Thanks

  11. konradbachowski commented on Jan 28, 2026

    @konradbachowski

    +1

  12. konradbachowski commented on Jan 28, 2026

    @konradbachowski

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

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

  13. 11 remaining items

  14. Cyenoch commented on Jan 28, 2026

    @Cyenoch

    Add this to the plugin in opencode.json.

    "opencode-anthropic-auth@latest"

    {
     …
    "plugin": [
        "opencode-anthropic-auth@latest"
      ]
    }
  15. rustikus commented on Jan 28, 2026

    @rustikus

    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?

  16. furai commented on Jan 28, 2026

    @furai
    Contributor

    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.

  17. HarKro753 commented on Jan 28, 2026

    @HarKro753

    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

  18. prravda commented on Jan 28, 2026

    @prravda

    #FREEOPENCODE


    Currently prompt injection like this is blocked.
    #10937 (comment) 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"]
    }
  19. Steffen025 commented on Jan 28, 2026

    @Steffen025

    ✅ 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

  20. nukeop commented on Jan 28, 2026

    @nukeop

    Somebody report the spammer advertising his vibecoded trash

  21. Steffen025 commented on Jan 28, 2026

    @Steffen025

    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?

  22. nukeop commented on Jan 28, 2026

    @nukeop

    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.

  23. Steffen025 commented on Jan 28, 2026

    @Steffen025

    @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.

  24. nukeop commented on Jan 28, 2026

    @nukeop

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

  25. Steffen025 commented on Jan 28, 2026

    @Steffen025

    @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.

  26. nukeop commented on Jan 28, 2026

    @nukeop

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

  27. robertfels commented on Jan 28, 2026

    @robertfels
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions