[BUG] API Error 404 / ECONNREFUSED
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?
I asked claude to help me setup using ollama for local model usage, to which it gave me instructions I followed (now gone). After restarting Claude, it keeps spitting out 404's and "Unable to connect to API (ECONNREFUSED) errors. /doctor doesn't help, and I have no idea what's happening. I undid the env vars I was told to set, to no avail. Running the Ollama server seems to have something to do with it and reinstalling claude-code didn't fix it. I can no longer use Claude-Code and don't know what to do at all. I have no ability to use local models and no ability to use claude. I have used /logout to logout and login again to no avail. The UI says I am using the API but I am a Pro subscription user. No idea what to do now.
What Should Happen?
When I prompt claude it should reply and not get 404's. I think the config is somehow stuck using the API method and won't change itself. Seems to be the only explaination but I have no idea how to fix that.
Error Messages/Logs
▐▛███▜▌ Claude Code v2.1.12
▝▜█████▛▘ Sonnet 4.5 · API Usage Billing
▘▘ ▝▝
/model to try Opus 4.5
❯ /login
⎿ Login interrupted
❯ hi
⎿ API Error: 404 404 page not found
❯ hi
⎿ API Error: Connection error.
✻ Cogitated for 2m 59s
Steps to Reproduce
Set the env vars as instructed in docs for Ollama local model usage, then prompt the model. It also was giving errors that the model could not use tools. No idea why.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.12
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
I am an Arch user, using kitty with fish as my shell. /doctor warns of two install locations which may be true? I used both the npm install and the yay -S while troubleshooting. I don't know if that has anything to do with it. Really not sure why it seems so stuck.
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗