Hi everyone,
I’m facing a confusing issue with the OpenAI API when deploying on Render, and I wanted to document it clearly in case it helps others.
What’s happening
-
OpenAI API calls work perfectly on local machine
-
The same API key fails on Render
-
Error returned:
AuthenticationError: 401 Your IP is not authorized to make this request type: ip_not_authorized -
Response headers show Cloudflare (cf-ray, server: cloudflare)
What I verified
-
API key is valid and active
-
Billing is enabled
-
Key works locally
-
Environment variables are correctly set on Render
-
DNS workaround (
NODE_OPTIONS=--dns-result-order=ipv4first) did not help -
No visible settings in the dashboard for:
-
IP Allow List
-
Network access
-
Restrict by IP
-
Important observation
Even though no IP restriction is visible in the UI, the error strongly indicates an organization-level IP restriction / network policy is being enforced.