[BUG] Custom endpoint settings.json regression
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
We're just launching our GitButler integration, and we've had one user who is using a custom backend for CC via the https://github.com/ericc-ch/copilot-api project.
The project encourages you to configure CC in the .claude/settings.json as follows:
{
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:4141",
"ANTHROPIC_AUTH_TOKEN": "dummy",
"ANTHROPIC_MODEL": "gpt-4.1",
"ANTHROPIC_SMALL_FAST_MODEL": "gpt-4.1"
}
}
Since Claude 1.0.111, if you run claude -p "hello" you get an error like the following:
API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid bearer token"},"request_id":"req_011CT2e7G3LRMFXiwGdQrLLc"} · Please run /login
In the TUI this configuration still works as expected.
In version 1.0.110 this configuration works as expected with -p, so it's a very recent regression.
Of course, using a tool like copilot-api is not going to be a supported use case, but I imagine that this is going to be affecting enterprise users who might be using Amazon Bedrock or Google Vertex AI.
What Should Happen?
Claude should interpret the same as what it does in the TUI.
Error Messages/Logs
Steps to Reproduce
Using https://github.com/ericc-ch/copilot-api:
- Run
npx copilot-api@latest authto authenticatecopilot-apiwith GitHub - Run
npx copilot-api@latest startto start the proxy server - Add the following to your
.claude/settings.json
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:4141",
"ANTHROPIC_AUTH_TOKEN": "dummy",
"ANTHROPIC_MODEL": "gpt-4.1",
"ANTHROPIC_SMALL_FAST_MODEL": "gpt-4.1"
}
- Run
claude -p "hello"
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
1.0.110
Claude Code Version
1.0.111
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗