Gpt-5 Requests Hanging on Cloud

Hi,

I’m experiencing an issue where a prompt (~27,776 input tokens) consistently hangs when executed in our cloud environment. The request rarely returns a response, and when it does, it takes approximately 6 minutes.

The same prompt works reliably on my local machine every time. I initially used the OpenAI Python client with LangChain, but after encountering the issue I tested using a raw curl request and observed the same hanging behavior. When I run the exact same prompt with gpt-4.1, it works without any problems.

This suggests the issue may be specific to gpt-5 handling large-token requests in the cloud.

Thank you.

curl -v -X POST "https://api.openai.com/v1/responses" \

  --max-time 900 \

  -H "Content-Type: application/json" \

  -H "Authorization: Bearer $OPENAI_API_KEY" \

  -d @payload.json \

2>&1 | tee curl_debug.log

Note: Unnecessary use of -X or --request, POST is already inferred.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

* Host api.openai.com:443 was resolved.

* IPv6: (none)

* IPv4: 162.159.140.245, 172.66.0.243

*   Trying 162.159.140.245:443...

* Connected to api.openai.com (162.159.140.245) port 443

* ALPN: curl offers h2,http/1.1

} [5 bytes data]

* TLSv1.3 (OUT), TLS handshake, Client hello (1):

} [512 bytes data]

*  CAfile: /etc/ssl/certs/ca-certificates.crt

*  CApath: /etc/ssl/certs

{ [5 bytes data]

* TLSv1.3 (IN), TLS handshake, Server hello (2):

{ [122 bytes data]

* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):

{ [19 bytes data]

* TLSv1.3 (IN), TLS handshake, Certificate (11):

{ [2534 bytes data]

* TLSv1.3 (IN), TLS handshake, CERT verify (15):

{ [79 bytes data]

* TLSv1.3 (IN), TLS handshake, Finished (20):

{ [52 bytes data]

* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):

} [1 bytes data]

* TLSv1.3 (OUT), TLS handshake, Finished (20):

} [52 bytes data]

* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / X25519 / id-ecPublicKey

* ALPN: server accepted h2

* Server certificate:

*  subject: CN=api.openai.com

*  start date: Nov 14 00:26:50 2025 GMT

*  expire date: Feb 12 01:26:48 2026 GMT

*  subjectAltName: host "api.openai.com" matched cert's "api.openai.com"

*  issuer: C=US; O=Google Trust Services; CN=WE1

*  SSL certificate verify ok.

*   Certificate level 0: Public key type EC/prime256v1 (256/128 Bits/secBits), signed using ecdsa-with-SHA256

*   Certificate level 1: Public key type EC/prime256v1 (256/128 Bits/secBits), signed using ecdsa-with-SHA384

*   Certificate level 2: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using ecdsa-with-SHA384

} [5 bytes data]

* using HTTP/2

* [HTTP/2] [1] OPENED stream for https://api.openai.com/v1/responses

* [HTTP/2] [1] [:method: POST]

* [HTTP/2] [1] [:scheme: https]

* [HTTP/2] [1] [:authority: api.openai.com]

* [HTTP/2] [1] [:path: /v1/responses]

* [HTTP/2] [1] [user-agent: curl/8.5.0]

* [HTTP/2] [1] [accept: */*]

* [HTTP/2] [1] [content-type: application/json]

* [HTTP/2] [1] [authorization: Bearer __KEY_MASKED__]

* [HTTP/2] [1] [content-length: 121619]

} [5 bytes data]

> POST /v1/responses HTTP/2

> Host: api.openai.com

> User-Agent: curl/8.5.0

> Accept: */*

> Content-Type: application/json

> Authorization: Bearer __KEY_MASKED__

> Content-Length: 121619

> 

} [5 bytes data]

* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):

{ [238 bytes data]

* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):

{ [238 bytes data]

* old SSL session ID is stale, removing

{ [5 bytes data]

* We are completely uploaded and fine

{ [5 bytes data]

100  118k    0     0  100  118k      0    226  0:08:58  0:08:56  0:00:02     0< HTTP/2 502 

< date: Mon, 08 Dec 2025 16:04:15 GMT

< content-type: text/plain; charset=UTF-8

< content-length: 15

< strict-transport-security: max-age=31536000; includeSubDomains; preload

< x-content-type-options: nosniff

< x-frame-options: SAMEORIGIN

< referrer-policy: same-origin

< cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0

< expires: Thu, 01 Jan 1970 00:00:01 GMT

< set-cookie: _cfuvid=XXXXXX; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None

< server: cloudflare

< cf-ray: 9aad7240fed09712-AMS

< alt-svc: h3=":443"; ma=86400

< 

{ [15 bytes data]

100  118k    0    15  100  118k      0    226  0:08:58  0:08:56  0:00:02     3

* Connection #0 to host api.openai.com left intact

error code: 502