Skip to content

Solution for "User location is not supported for the API use" on Vercel

Posted on:December 25, 2023 at 01:00 AM

When deploying Gemini Pro Chat on Vercel, some users might encounter the error “User location is not supported for the API use”. This issue arises due to certain Vercel edge function nodes being in locations not supported by Google. While Gemini Pro Chat, based on the Astro 2 framework, doesn’t support modifying edge function locations, there’s a workaround involving the use of a proxy, specifically the palm proxy, which is based on the Next.js framework.

Table of contents

Open Table of contents

Understanding the Issue

The issue stems from Vercel’s edge function nodes being located in regions unsupported by Google’s API. Since Astro 2, the framework used by Gemini Pro Chat, does not allow changing the edge function location, a different approach is needed.

Deploying Palm Proxy

  1. Visit the palm-proxy repository.
  2. Click the “Deploy With Vercel” button.
  3. After deployment, Vercel will assign a domain (e.g.,

Configuring Gemini Pro Chat

  1. In your Gemini Pro Chat project settings on Vercel, add a new environment variable named API_BASE_URL.
  2. Set the value of API_BASE_URL to the domain you received from the palm proxy deployment (

Finalizing the Deployment

  1. Redeploy your Gemini Pro Chat project on Vercel.
  2. This setup should circumvent the location issue by routing API requests through the palm proxy.

Special thanks to antergone for providing this solution. By following these steps, you can successfully deploy Gemini Pro Chat on Vercel without encountering the “User location is not supported for the API use” error.