# Claude API ECONNRESET: Connection Reset During Request

TL;DR: ECONNRESET is a transport-level failure. It does not prove your Claude prompt is invalid or that the API key is bad.

Target query: Claude API ECONNRESET
Likely fault area: network path
Run diagnosis: https://llmping.app/#diagnose

## What this error means

Claude API ECONNRESET means the TCP connection was closed unexpectedly by a peer, proxy, runtime, or network path before the response completed.

## Is it code, key, rate limit, or server-side?

Category: network
Likely fault area: network path

## Immediate checklist

- Check whether the reset occurs before headers, during streaming, or after a timeout.
- Compare local curl, production runtime curl, and a different network path.
- Review proxy, load balancer, keep-alive, and serverless timeout settings.
- Use idempotent retries only when your app can safely repeat the request.

## cURL test command

```bash
curl https://api.anthropic.com/v1/messages \
  --connect-timeout 10 \
  --max-time 60 \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model":"claude-3-5-haiku-latest","max_tokens":16,"messages":[{"role":"user","content":"ping"}]}'
```

## Common fixes

- Raise serverless timeout if streaming responses are cut off.
- Disable stale keep-alive reuse if a proxy frequently resets old sockets.
- Retry with backoff for transient resets, but record reset timing for debugging.
- If only one network region resets, route Claude calls from a different region.

## Related errors

- https://llmping.app/errors/anthropic/529/
- https://llmping.app/status/anthropic/
- https://llmping.app/errors/gemini/fetch-failed/
