Skip to content

Anthropic blocking requests after v0.0.10 - "credential only authorized for Claude Code" #33

@ErcinDedeoglu

Description

@ErcinDedeoglu

Problem

Starting January 28, 2026, Anthropic began blocking API requests made through OpenCode with the error:

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

Affected versions: OpenCode 1.1.37+ (which uses [email protected]+)
Working version: OpenCode 1.1.36 (which uses [email protected])

Root Cause Analysis

Version Mapping

OpenCode Version Plugin Version Status
v1.1.36 [email protected] ✅ Reportedly works
v1.1.37 [email protected] ❌ Blocked

Key Difference: System Prompt Injection

The only functional change between v0.0.9 and v0.0.10 was commit a931d12 ("add spoof"):

// Added in v0.0.10
"experimental.chat.system.transform": (input, output) => {
  if (input.model.providerID === "anthropic") {
    output.system.unshift(
      "You are Claude Code, Anthropic's official CLI for Claude.",
    );
  }
},

Spoofing Present in Both Versions

Both v0.0.9 and v0.0.10 already include:

  1. User-Agent spoofing (line 178):

    "claude-cli/2.1.2 (external, cli)"
  2. Text replacement (lines 195-196):

    .replace(/OpenCode/g, 'Claude Code')
    .replace(/opencode/gi, 'Claude')

Hypothesis

Anthropic appears to be detecting and blocking the explicit system prompt injection added in v0.0.10, rather than the User-Agent header or text replacement that existed in v0.0.9.

However, this is unconfirmed. Other possibilities:

  • Anthropic may have tightened detection across the board
  • Token-level restrictions may have changed
  • Request fingerprinting may have been implemented

Questions

  1. Has anyone confirmed v1.1.36 / plugin v0.0.9 still works as of Jan 28, 2026?
  2. Would removing the experimental.chat.system.transform hook from v0.0.10+ restore functionality?
  3. Is there a legitimate way to use Anthropic Pro/Max OAuth credentials with OpenCode without spoofing?

Workaround

For now, users can downgrade to OpenCode 1.1.36:

opencode upgrade 1.1.36
export OPENCODE_DISABLE_AUTOUPDATE=1  # Add to ~/.bashrc

Environment

  • OpenCode versions tested: 1.1.36, 1.1.37+
  • Plugin versions analyzed: 0.0.9, 0.0.10
  • Date of block: January 28, 2026
  • Auth type: Anthropic OAuth (Pro/Max subscription)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions