Frequently getting AI_APICallError: Cannot connect to API: other side closed #9547
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Hi @karl-spark 👋 The failure at ~270s is almost certainly an upstream idle/processing timeout (“other side closed”) from the provider/proxy in front of grok-4-fast-reasoning. Your call runs long (38k tokens in, heavy reasoning), and the server closes the HTTP/2 stream before it finishes. **What to try (works in practice):
2. Reduce work per call
3. Harden the client 4. Runtime limits 5. If it persists TL;DR: It’s a long-running call getting closed upstream. Stream, cap tokens, and shrink the prompt (or split the job). |
Beta Was this translation helpful? Give feedback.
-
|
This discussion was automatically locked because it has not been updated in over 30 days. If you still have questions about this topic, please ask us at community.vercel.com/ai-sdk |
Beta Was this translation helpful? Give feedback.

Hi @karl-spark 👋
The failure at ~270s is almost certainly an upstream idle/processing timeout (“other side closed”) from the provider/proxy in front of grok-4-fast-reasoning. Your call runs long (38k tokens in, heavy reasoning), and the server closes the HTTP/2 stream before it finishes.
**What to try (works in practice):