Hey there, thanks for sharing your detailed question and welcome to the Streamlit community!
It seems likely that your Streamlit Community Cloud app is running into a network or platform-level limitation when making outbound HTTPS requests to api.anthropic.com, especially since the same request works elsewhere and the TCP/TLS handshake completes but the HTTP response body never arrives within 60 seconds.
My understanding is that Streamlit Community Cloud has resource and networking constraints that can affect outbound connections, including timeouts and possible throttling or proxying on long-lived HTTP responses. There’s no explicit documentation about outbound HTTP(S) response timeouts, but similar issues have been reported with other APIs and databases, often due to network latency, platform-level timeouts, or resource limits. If your request consistently times out only on Community Cloud, it’s likely due to these platform constraints rather than your code or the Anthropic API itself. You might consider optimizing your request for faster responses, or, if possible, deploying your app on a platform with more configurable network settings or fewer outbound restrictions. For more on resource and networking limits, see the Streamlit Community Cloud deployment docs and resource limits FAQ.
Sources: