Fix Timeout / Request Timed Out in Claude Code and Codex CLI
Step-by-step fixes for the "Timeout / Request Timed Out" error when connecting Claude Code or Codex CLI to DeepSeek, OpenRouter, and other providers.
Error output
Error: Request timed out after 600000ms.
Anthropic API Error: 529 Overloaded
Common variations
codex: request timed out after 10 minutes
Error: TimeoutError: Request timed out
at Object.fetch (node:internal/…)
The exact text varies by agent version and provider. Match the status code and the message above.
Quick diagnosis
A timeout right after a small prompt points at the network; a timeout after a huge prompt points at the model.
Claude Code
claude /status Codex CLI
codex exec "hi" Common causes
- The model is slow (long reasoning, large context) and the client gave up.
- A very long prompt or huge context extends time to first token.
- Restricted or congested network to the provider region.
- The provider is overloaded (529) during peak hours.
Fix by scenario
1 Times out on huge prompts or repos
- Shorten the prompt or narrow the context (smaller repo scope, targeted files).
- Split long tasks into smaller steps instead of one giant request.
- Use a model with a larger context window or higher speed for bulk work.
2 Times out on small prompts too
- This points at the network path — run the curl test from the same shell.
- Check if the provider is overloaded (529) before changing config.
- Retry during off-peak hours to confirm it is load-related.
3 Timeouts after a config change
- A new model may reason much longer — lower the reasoning effort or switch models.
- A proxy or VPN change can add latency — re-run the curl timing test.
- Compare against the previous working model before assuming the endpoint is at fault.
Agent-specific fixes
Claude Code
- Fix
- Retry the request, shorten the prompt or context, and switch to deepseek-v4-flash for long sessions. Region-based issues may need a different network.
- Verify
- Re-run the request when the network is idle and confirm it completes.
Codex CLI
- Fix
- Reduce context (smaller repo scope), lower reasoning effort for simple tasks, or switch to a faster model. Check for provider overload (529) before changing config.
- Verify
- Run `codex exec "hi"` with a short prompt to isolate the network path from the workload.
Claude Code vs Codex CLI at a glance
| Claude Code | Codex CLI | |
|---|---|---|
| Small-prompt timeout | Network path likely | Network path likely |
| Large-prompt timeout | Model speed/context | Model speed/context |
| Overload signal | 529 Overloaded | 529 Overloaded |
Prevent it from happening again
- Prefer faster models for routine work and keep slow reasoning models for hard problems.
- Keep prompts and context lean; big context is the most common timeout trigger.
- Run long sessions off-peak or with retry logic in place.
Related errors
Related setup guides
Frequently asked questions
Can I increase the timeout?
Most clients use a fixed client-side timeout. The practical fixes are a faster model, a shorter prompt, or a better network path to the provider.
Timeout and 529 at the same time — what does that mean?
529 means the provider is overloaded; the timeout is the client giving up while waiting. Wait, retry off-peak, or switch to a less loaded model or endpoint.