Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenAI 403 Forbidden country, region, or territory errors by executing query on Edge Functions located in the US #1872

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jerichosy
Copy link

From Vercel docs:

By default, Edge Functions execute in the region that is geographically closest to the incoming request,

This can cause issues when the Edge Functions execute in a region that is unsupported by OpenAI, like so:
image
This has also been noted by Vercel themselves: https://vercel.com/changelog/openai-will-not-support-the-hong-kong-region-hkg1-for-functions

To fix, execute on the Edge Functions located in the US instead. This is also best practice acdg. to OpenAI's docs (and Vercel's docs) since that's where their servers are located anyway which will minimize roundtrip times.

See https://vercel.com/changelog/openai-will-not-support-the-hong-kong-region-hkg1-for-functions (unsure if our edge was actually on HKG but same issue).

Query from US servers instead since that's where OpenAI's servers are located anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant