Gemini API Unauthorized Error Regional Restriction

I am developing a chatbot that impersonates an animated character using the Gemini API in a Cloudflare Workers environment.

Recently, when I make Gemini API requests with my account, I receive a 401 (Unauthorized) error along with a message stating “regional restriction.” Additionally, when I try to access Google AI Studio with the same account, I am forcibly redirected to the regional restriction information page (Available regions for Google AI Studio and Gemini API  |  Google AI for Developers).

I have tried accessing under the following conditions:

Access region:

Mostly South Korea

When using VPN, only Japan/US IP addresses are used
(I understand that South Korea, Japan, and the US are all officially supported regions for Gemini.)

Request environment:

Using Cloudflare Workers

Using prompts for impersonating an animated character (the content is not provocative or inappropriate; it is simply instructions regarding the character’s speech style and background settings. The prompt is intentionally set to reject inappropriate or offensive content.)

Other details:

There have been no large-scale or repeated requests. For simple operational tests, I have sent a few meaningless short messages a couple of times. (There has been no rapid, repeated sending—only a few messages sent once or twice for feature testing.)

The problem is currently ongoing, so I am wondering if my account has been temporarily restricted, or if there is another cause.

If there are any solutions or additional information required, please advise.

Solved

Hi,

Welcome to the Forum!!

Could you please tell us the actual region (without VPN) you are trying to access Gemini?