-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
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:
-
User-Agent spoofing (line 178):
"claude-cli/2.1.2 (external, cli)" -
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
- Has anyone confirmed v1.1.36 / plugin v0.0.9 still works as of Jan 28, 2026?
- Would removing the
experimental.chat.system.transformhook from v0.0.10+ restore functionality? - 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 ~/.bashrcEnvironment
- 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)
lockieluke
Metadata
Metadata
Assignees
Labels
No labels