[BUG] Constant API Error and request timeouts

Status Closed — duplicate
Maintainer reply None cached
Activity 12 comments · opened Jun 12, 2025 · closed Jul 27, 2025

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [x] Other: Claude code
  • Claude CLI version: 1.0.21
  • Operating System: Ubuntu 24.04
  • Terminal: Gnome Terminal

Bug Description

This is what I keep getting today after one prompt:

⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10)
⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10)
⎿ API Error (Request timed out.) · Retrying in 4 seconds… (attempt 4/10)
⎿ API Error (Request timed out.) · Retrying in 9 seconds… (attempt 5/10)
⎿ API Error (Request timed out.) · Retrying in 20 seconds… (attempt 6/10)
⎿ API Error (Request timed out.) · Retrying in 37 seconds… (attempt 7/10)
⎿ API Error (Request timed out.) · Retrying in 36 seconds… (attempt 8/10)
⎿ API Error (Request timed out.) · Retrying in 37 seconds… (attempt 9/10)
⎿ API Error (Request timed out.) · Retrying in 37 seconds… (attempt 10/10)
⎿  API Error: Request timed out.

After this it stays offline permanently.

Steps to Reproduce

  1. Start Claude Code
  2. Write a 10-15 lines prompt
  3. Wait forever.

Expected Behavior

I expect it to work.

Actual Behavior

It's timed out and now it's permanently offline

Additional Context

Should I continue paying for this, upgrade to a more expensive plan or switch to something that actually works?

I got better results running local stuff with Ollama for free.

View original on GitHub ↗

12 Comments

Emasoft · 1 year ago

I think is the same problem that is making Claude Code unusable for days now.

!Image

dreamy32 · 1 year ago

Im cancelling my subscription and getting a key on openrouter. ffs

hwuscut · 1 year ago
Im cancelling my subscription and getting a key on openrouter. ffs

How to cancel my subscription? I want to do it too.

furkancak1r · 1 year ago

the problem is "env": { "MAX_THINKING_TOKENS": "32000" } , remove it

hwuscut · 1 year ago
"env": { "MAX_THINKING_TOKENS": "32000" }

Where can we find the "env": { "MAX_THINKING_TOKENS": "32000" }? Thanks.

furkancak1r · 1 year ago
> "env": { "MAX_THINKING_TOKENS": "32000" } Where can we find the "env": { "MAX_THINKING_TOKENS": "32000" }? Thanks.

.claude>settings.local.json if you have "env": { "MAX_THINKING_TOKENS": "32000" } delete it

hwuscut · 1 year ago
> > "env": { "MAX_THINKING_TOKENS": "32000" } > > > Where can we find the "env": { "MAX_THINKING_TOKENS": "32000" }? Thanks. .claude>settings.local.json if you have "env": { "MAX_THINKING_TOKENS": "32000" } delete it

I do not config the settings.local.json. I change the workplace to an empty one. Then start claude. The problem still exists.
cwd: /home

⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)
⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10)
⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10)
⎿ API Error (Request timed out.) · Retrying in 4 seconds… (attempt 4/10)
⎿ API Error (Request timed out.) · Retrying in 10 seconds… (attempt 5/10)
⎿ API Error (Request timed out.) · Retrying in 20 seconds… (attempt 6/10)
⎿ API Error (Request timed out.) · Retrying in 33 seconds… (attempt 7/10)
⎿ API Error (Request timed out.) · Retrying in 36 seconds… (attempt 8/10)
⎿ API Error (Request timed out.) · Retrying in 37 seconds… (attempt 9/10)
⎿ API Error (Request timed out.) · Retrying in 39 seconds… (attempt 10/10)
⎿ API Error: Request timed out.

furkancak1r · 1 year ago
> > > "env": { "MAX_THINKING_TOKENS": "32000" } > > > > > > Where can we find the "env": { "MAX_THINKING_TOKENS": "32000" }? Thanks. > > > .claude>settings.local.json if you have "env": { "MAX_THINKING_TOKENS": "32000" } delete it I do not config the settings.local.json. I change the workplace to an empty one. Then start claude. The problem still exists. cwd: /home ⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10) ⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10) ⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10) ⎿ API Error (Request timed out.) · Retrying in 4 seconds… (attempt 4/10) ⎿ API Error (Request timed out.) · Retrying in 10 seconds… (attempt 5/10) ⎿ API Error (Request timed out.) · Retrying in 20 seconds… (attempt 6/10) ⎿ API Error (Request timed out.) · Retrying in 33 seconds… (attempt 7/10) ⎿ API Error (Request timed out.) · Retrying in 36 seconds… (attempt 8/10) ⎿ API Error (Request timed out.) · Retrying in 37 seconds… (attempt 9/10) ⎿ API Error (Request timed out.) · Retrying in 39 seconds… (attempt 10/10) ⎿ API Error: Request timed out.

Maybe you should create an empty settings.local.json inside .claude folder, or try /logout

hwuscut · 1 year ago
create an empty settings.local.json
> > > > "env": { "MAX_THINKING_TOKENS": "32000" } > > > > > > > > > Where can we find the "env": { "MAX_THINKING_TOKENS": "32000" }? Thanks. > > > > > > .claude>settings.local.json if you have "env": { "MAX_THINKING_TOKENS": "32000" } delete it > > > I do not config the settings.local.json. I change the workplace to an empty one. Then start claude. The problem still exists. cwd: /home > ⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10) ⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10) ⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10) ⎿ API Error (Request timed out.) · Retrying in 4 seconds… (attempt 4/10) ⎿ API Error (Request timed out.) · Retrying in 10 seconds… (attempt 5/10) ⎿ API Error (Request timed out.) · Retrying in 20 seconds… (attempt 6/10) ⎿ API Error (Request timed out.) · Retrying in 33 seconds… (attempt 7/10) ⎿ API Error (Request timed out.) · Retrying in 36 seconds… (attempt 8/10) ⎿ API Error (Request timed out.) · Retrying in 37 seconds… (attempt 9/10) ⎿ API Error (Request timed out.) · Retrying in 39 seconds… (attempt 10/10) ⎿ API Error: Request timed out. Maybe you should create an empty settings.local.json inside .claude folder, or try /logout

The above methods do not work either.

furkancak1r · 1 year ago
> create an empty settings.local.json > > > > > "env": { "MAX_THINKING_TOKENS": "32000" } > > > > > > > > > > > > Where can we find the "env": { "MAX_THINKING_TOKENS": "32000" }? Thanks. > > > > > > > > > .claude>settings.local.json if you have "env": { "MAX_THINKING_TOKENS": "32000" } delete it > > > > > > I do not config the settings.local.json. I change the workplace to an empty one. Then start claude. The problem still exists. cwd: /home > > ⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10) ⎿ API Error (Request timed out.) · Retrying in 1 seconds… (attempt 2/10) ⎿ API Error (Request timed out.) · Retrying in 2 seconds… (attempt 3/10) ⎿ API Error (Request timed out.) · Retrying in 4 seconds… (attempt 4/10) ⎿ API Error (Request timed out.) · Retrying in 10 seconds… (attempt 5/10) ⎿ API Error (Request timed out.) · Retrying in 20 seconds… (attempt 6/10) ⎿ API Error (Request timed out.) · Retrying in 33 seconds… (attempt 7/10) ⎿ API Error (Request timed out.) · Retrying in 36 seconds… (attempt 8/10) ⎿ API Error (Request timed out.) · Retrying in 37 seconds… (attempt 9/10) ⎿ API Error (Request timed out.) · Retrying in 39 seconds… (attempt 10/10) ⎿ API Error: Request timed out. > > > Maybe you should create an empty settings.local.json inside .claude folder, or try /logout The above methods do not work either.

Sorry to hear that I don't know any other options

NellInc · 1 year ago

From Anthropic Support to me:

"The timeout issues with long todo lists appear to be related to the extended processing time required for complex multi-step tasks, which can exceed the default API timeout limits. As a workaround, you can increase the API timeout by setting the API_TIMEOUT_MS environment variable before launching Claude Code. For example, you can use the export API_TIMEOUT_MS=600000 command to set it for 10 minutes. The default appears to be 30 seconds (30000ms), but you can increase it significantly for complex tasks like long todo lists."

This worked for me personally.

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.