Call the gpt-3.5-turbo API, but connection timeout

When I call the OpenAI API, I encounter the following error message. How can I resolve it? Thank you.

$ curl https://api.openai.com/v1/chat/completions \
>  -H "Authorization: Bearer xxxx" \
>  -H "Content-Type: application/json" \
>  -d '{
>  "model": "gpt-3.5-turbo",
>  "messages": [{"role": "user", "content": "What is the OpenAI mission?"}]
>  }'
curl: (28) SSL connection timeout
(base)
1 Like

Have you tried increasing your own timeout threshold?

$ curl https://api.openai.com/v1/chat/completions
-H “Authorization: Bearer xxxx”
-H “Content-Type: application/json”
-m 60
-d ‘{
“model”: “gpt-3.5-turbo”,
“messages”: [{“role”: “user”, “content”: “What is the OpenAI mission?”}]
}’

or

$ curl https://api.openai.com/v1/chat/completions
-H “Authorization: Bearer xxxx”
-H “Content-Type: application/json”
–connect-timeout 30
-d ‘{
“model”: “gpt-3.5-turbo”,
“messages”: [{“role”: “user”, “content”: “What is the OpenAI mission?”}]
}’