OpenCode error
OpenCode: This credential is only authorized for use with Claude Code and cannot...
This credential is only authorized for use with Claude Code and cannot be used for other API requests.Status: By designLast verified 3 documented fixes5 sources
What it means
Anthropic rejected a Claude Pro/Max subscription credential because it was used outside Claude Code. OpenCode's providers docs say plugins exist that let you use Claude Pro/Max models with OpenCode, and that "Anthropic explicitly prohibits this."
Causes
- Signing in to Anthropic with Claude Pro/Max OAuth through the opencode-anthropic-auth plugin (#10982, reported on v1.1.39).
- Anthropic prohibits using Claude Pro/Max subscriptions in third-party tools (official providers docs).
How to fix it
- Fix 1.
For the January 2026 regression reported on v1.1.39, a maintainer replied that it was fixed in "1.1.40" (the v1.1.40 release notes include "Bump plugins").
Terminalopencode upgrade - Fix 2.
As of v1.3.0, OpenCode no longer ships these plugins (release notes: "Removed anthropic oauth plugin", PR #18186). Use an Anthropic API key instead: run /connect, select Anthropic, then choose "Manually enter API Key".
Slash command/connect - Fix 3.
The docs list subscriptions that work in OpenCode with zero setup: ChatGPT Plus, GitHub Copilot and GitLab Duo.
More OpenCode errors
All 17 OpenCode errorsProviderModelNotFoundErrorStatus: By designProviderInitErrorStatus: WorkaroundAI_APICallErrorStatus: WorkaroundAI_APICallError: messages.13: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01CfJCsh21fK1pAXsXWYJYBA, toolu_01NoqnwsaxoK3AYM2FyrxmjN. Each `tool_use` block must have a corresponding `tool_result` block in the next message.Status: Fixed in releasemessages.3.content.0.type: Expected `thinking` or `redacted_thinking`, but found `tool_use`. When `thinking` is enabled, a final `assistant` message must start with a thinking block (preceeding the lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disable `thinking`.Status: WorkaroundError: Unexpected error, check log file at [user-home]/.local/share/opencode/log/2025-08-26T215857.log for more detailsStatus: WorkaroundAI_RetryError: Failed after 4 attempts. Last error: Too Many RequestsStatus: Workaroundundefined: The provided model identifier is invalid.Status: Fixed in release
Related reading
- Give Every Agent PR a Live Preview: Railway Environments for AI Pull RequestsRailway preview environments for agent pull requests: an isolated copy of your whole stack for every PR, so you verify agent changes by running them.
- Put an AI Reviewer on Every Pull Request: A Webhook Build with OpenCode and RailwayBuild an AI pull request reviewer on Railway: a webhook service runs OpenCode headless on every PR diff and posts findings as a review, never touching the code.
- Claude Opus 5.5 Developer Guide: Pricing, API, Claude CodeClaude Opus 5.5 costs $4/$20 per million tokens with $0.20 cache reads. SDK examples, Claude Code setup, and when to pick it over Sonnet 5.5 or Haiku 5.5.
- Make Your Coding Agents Talk: Voice Summaries with the Rime CLIThe Rime CLI streams text-to-speech from your terminal so Claude Code, Codex, Devin and OpenCode can speak a summary after each step. Install, flags and prompt.
- pi vs Claude Code vs OpenCode: Picking Your Agentic CLIpi vs Claude Code vs OpenCode vs Codex CLI: a verified capability matrix and pick-X-if verdicts for choosing your main agentic coding harness.
- Slack Code vs Claude Code vs Cursor vs OpenCode: When Agents Belong in ChatSlack Code gives coding agents their own Slack channels with diffs, previews, and an audit log. When it beats Claude Code, Cursor, or OpenCode, and when not.
FAQ
What does "This credential is only authorized for use with Claude Code and cannot..." mean in OpenCode?
Anthropic rejected a Claude Pro/Max subscription credential because it was used outside Claude Code. OpenCode's providers docs say plugins exist that let you use Claude Pro/Max models with OpenCode, and that "Anthropic explicitly prohibits this."
How do I fix "This credential is only authorized for use with Claude Code and cannot..."?
There are 3 documented fixes. Start with the first: For the January 2026 regression reported on v1.1.39, a maintainer replied that it was fixed in "1.1.40" (the v1.1.40 release notes include "Bump plugins").
Is this OpenCode error fixed?
Status: By design. Expected behavior, not a bug. The documented fixes change the setup that triggers it. Affected versions: v1.1.39 regression fixed in v1.1.40. The bundled Anthropic OAuth plugin was removed in v1.3.0 (2026-03-22).
Sources
Last verified against 5 sources: official docs, maintainer replies and release notes.
Newsletter
Fixes for the tools you use, weekly
One email per week. New coding agent releases, what broke, and how developers are working around it.