Description
Bug Report: Claude Code returns HTTP 400 while OpenCode CLI works
Summary
Claude Code cannot communicate with OpenCode Zen API. Every prompt in Claude Code returns:
API Error: 400 Error from provider (Console): Upstream request failed
However, the OpenCode CLI works correctly using the same account and API key.
Environment
- OS: Windows 11
- Claude Code: 2.1.212
- OpenCode: 1.18.3
- Plugin: @opencode-ai/plugin 1.18.3
- Provider: OpenCode Zen API
Expected behavior
Claude Code should send prompts successfully through the OpenCode Zen API, just like the OpenCode CLI.
Actual behavior
Every prompt entered in Claude Code returns:
API Error: 400 Error from provider (Console): Upstream request failed
Steps to reproduce
- Install Claude Code 2.1.212.
- Install OpenCode 1.18.3.
- Authenticate with OpenCode Zen API.
- Launch Claude Code.
- Enter a simple prompt such as:
- Claude Code immediately returns:
API Error: 400 Error from provider (Console): Upstream request failed
Diagnostics performed
OpenCode CLI works
Output:
> build · deepseek-v4-flash-free
Hello. How can I help you?
Claude Doctor
- Installation successful
- No installation issues found
OpenCode
- Authentication successful
- Models load correctly
opencode models works
opencode run works
Configuration
opencode debug config returns a valid configuration.
Authentication is stored in:
C:\Users\USER\.local\share\opencode\auth.json
Configuration folder:
C:\Users\USER\.config\opencode
Additional observations
The issue only occurs in the Claude Code interactive interface.
The OpenCode CLI works correctly using the same provider and API key.
This suggests a compatibility issue between Claude Code 2.1.212 and the OpenCode Zen gateway (or the Anthropic-compatible request handling).
I can provide additional logs or test builds if needed.
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Description
Bug Report: Claude Code returns HTTP 400 while OpenCode CLI works
Summary
Claude Code cannot communicate with OpenCode Zen API. Every prompt in Claude Code returns:
However, the OpenCode CLI works correctly using the same account and API key.
Environment
Expected behavior
Claude Code should send prompts successfully through the OpenCode Zen API, just like the OpenCode CLI.
Actual behavior
Every prompt entered in Claude Code returns:
Steps to reproduce
Diagnostics performed
OpenCode CLI works
Output:
Claude Doctor
OpenCode
opencode modelsworksopencode runworksConfiguration
opencode debug configreturns a valid configuration.Authentication is stored in:
Configuration folder:
Additional observations
The issue only occurs in the Claude Code interactive interface.
The OpenCode CLI works correctly using the same provider and API key.
This suggests a compatibility issue between Claude Code 2.1.212 and the OpenCode Zen gateway (or the Anthropic-compatible request handling).
I can provide additional logs or test builds if needed.
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response