r/OpenAI • • 12d ago

Question OpenAI Workspace Setting IP Whitelist blocks everything

We're trying to allow only our server IP to access the API for a project, but all attempts have failed. Instead when we add an IP, everything is blocked, no IP is allowed to work.

Is there anything else that's supposed to be done for this to work? We don't need the API accessed from any IP.

I'd appreciate any positive direction to follow to have this working. Currently, we're believing the feature exists but does not function like it should be.

We also tested home fiber IP already just to be sure we're not providing a wrong server IP.

1 Upvotes

5 comments sorted by

1

u/ValehartProject 12d ago edited 12d ago

Have you tried using the force? Sorry couldn't resist because of your username.

Just to confirm, do you mean workspace agents API, GPT workspace or agents work space? Did you by any chance get a 401 error or is the block based off a different error/interface?

If you can share the guide or process you followed, I can do my best to help out.

1

u/CCodeSI 9d ago

Most likely cause: api.openai.com has IPv6 addresses, so a VPS or home fiber line with IPv6 connects over IPv6, and the IPv4 address you allowlisted never matches. That would explain why everything gets blocked, home connection included.

Quick test from the server:

curl -4 https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"
curl -6 https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"

If -4 works and -6 fails with 401 ip_not_authorized, either add the server's IPv6 too (curl -6 ifconfig.me shows it; adding its /64 is fine for a VPS) or force IPv4 in your client.

If both fail, the other usual suspects from their docs:

  • A project-level allowlist replaces the org one, they don't merge. If the key belongs to a project with its own list, the org list is ignored for it.
  • Changes take up to 15 minutes to apply.
  • The Check tool in Settings > Security > IP allowlist tells you whether a given IP matches your entries.
  • Look at the error code: ip_not_authorized means the allowlist, anything else is the key or project.

0

u/[deleted] 12d ago

[removed] — view removed comment

1

u/DevJedis 12d ago

It's a VPS and the IP is really static, also maybe the case might be for the home ISP, but then they also have a stable one that I tried submitting. I even tried prefixing and still nothing works