##  Issue Summary
text
##  Issue Summary
new_line
new_line
**Space:** [
text
**Space:** [
chunchu-08/LLM-Comparison-Hub
`chunchu-08/LLM-Comparison-Hub`
inline_code
](
text
](
https://huggingface.co/spaces/chunchu-08/LLM-Comparison-Hub
chunchu-08/LLM-Comparison-Hub
space
resource
https://huggingface.co/spaces/chunchu-08/LLM-Comparison-Hub
)  
text
)  
new_line
**Hardware:** Paid CPU Upgrade (8 vCPU, 32 GB RAM)  Free tier CPU- It worked fine two days ago but now it is not working either on free tier CPU or Paid CPU
text
**Hardware:** Paid CPU Upgrade (8 vCPU, 32 GB RAM)  Free tier CPU- It worked fine two days ago but now it is not working either on free tier CPU or Paid CPU
new_line
**Model:** 
text
**Model:** 
gpt-4
`gpt-4`
inline_code
 via 
text
 via 
openai>=1.0.0
`openai>=1.0.0`
inline_code
 SDK  
text
 SDK  
new_line
**Error:**
text
**Error:**
new_line
new_line
 GPT-4 call works perfectly on local machine with same key:
text
 GPT-4 call works perfectly on local machine with same key:
new_line
text
``
inline_code
`python
text
`python
new_line
   from openai import OpenAI
text
   from openai import OpenAI
new_line
   client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
text
   client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
new_line
   client.chat.completions.create(
text
   client.chat.completions.create(
new_line
       model="gpt-4",
text
       model="gpt-4",
new_line
       messages=[{"role": "user", "content": "Hello GPT-4"}]
text
       messages=[{"role": "user", "content": "Hello GPT-4"}]
new_line
   )
text
   )
new_line
Claude and Gemini models work fine in the same Space
text
Claude and Gemini models work fine in the same Space
new_line
new_line
.env is loaded correctly using load_dotenv()
text
.env is loaded correctly using load_dotenv()
new_line
new_line
No IP restrictions set on OpenAI key
text
No IP restrictions set on OpenAI key
new_line
new_line
Logs just show Connection error. — no traceback
text
Logs just show Connection error. — no traceback
new_line
new_line
 What I’ve Tried
text
 What I’ve Tried
new_line
Tested OPENAI_API_KEY locally — works
text
Tested OPENAI_API_KEY locally — works
new_line
new_line
Added logging using test_openai_connection.py
text
Added logging using test_openai_connection.py
new_line
new_line
 Restarted Space and tested again
text
 Restarted Space and tested again
new_line
new_line
Confirmed Claude/Gemini give valid outputs
text
Confirmed Claude/Gemini give valid outputs
new_line
new_line
GPT-4 fails silently
text
GPT-4 fails silently
new_line
new_line
 My Questions
text
 My Questions
new_line
Has Hugging Face introduced outbound network restrictions to api.openai.com recently?
text
Has Hugging Face introduced outbound network restrictions to api.openai.com recently?
new_line
new_line
Does even paid CPU Space share outbound IP pools that are rate-limited by OpenAI?
text
Does even paid CPU Space share outbound IP pools that are rate-limited by OpenAI?
new_line
new_line
Any recommended workaround?
text
Any recommended workaround?
new_line
new_line
https://cdn-avatars.huggingface.co/v1/production/uploads/1583856921041-5dd96eb166059660ed1ee413.png
https://huggingface.co/huggingface
huggingface
org
resource
https://huggingface.co/huggingface
new_line
new_line
@louie
mention
louie
text
new_line
new_line
@nateraw
mention
nateraw
text
new_line
new_line
@julien-c
mention
julien-c
text
##  Issue Summary

**Space:** [`chunchu-08/LLM-Comparison-Hub`](https://huggingface.co/spaces/chunchu-08/LLM-Comparison-Hub)  
**Hardware:** Paid CPU Upgrade (8 vCPU, 32 GB RAM)  Free tier CPU- It worked fine two days ago but now it is not working either on free tier CPU or Paid CPU
**Model:** `gpt-4` via `openai>=1.0.0` SDK  
**Error:**

 GPT-4 call works perfectly on local machine with same key:
   ```python
   from openai import OpenAI
   client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
   client.chat.completions.create(
       model="gpt-4",
       messages=[{"role": "user", "content": "Hello GPT-4"}]
   )
Claude and Gemini models work fine in the same Space

.env is loaded correctly using load_dotenv()

No IP restrictions set on OpenAI key

Logs just show Connection error. — no traceback

 What I’ve Tried
Tested OPENAI_API_KEY locally — works

Added logging using test_openai_connection.py

 Restarted Space and tested again

Confirmed Claude/Gemini give valid outputs

GPT-4 fails silently

 My Questions
Has Hugging Face introduced outbound network restrictions to api.openai.com recently?

Does even paid CPU Space share outbound IP pools that are rate-limited by OpenAI?

Any recommended workaround?

https://huggingface.co/huggingface

@louie 

@nateraw 

@julien-c 
👍
John6666
649e8bba402ad391e61e2dec
/avatars/b0cff3d48eb8f5c611a9bfb5d41c6ece.svg
xcu
xcu
user
6640bbd0220cfa8cbfdce080
https://cdn-avatars.huggingface.co/v1/production/uploads/6640bbd0220cfa8cbfdce080/wiAHUu5ewawyipNs0YFBR.png
John Smith
John6666
user