Google's page on available regions lists the countries and territories where the Gemini API and AI Studio are available. A visitor from outside the list may see that the region is not supported, and for Colab the restriction follows the region the Colab instance runs in. The terms say you may only access the services within an available region, and that you must be 18 or older.
A proxy does not make a region available: it only changes the network address a request leaves from. Use one when your own network requires it, or when you are working in a listed country and want a stable exit that matches where the account is. Do not use one to reach a service where Google does not offer it; that is against the terms and can put the account at risk.
# 1) Test the proxy login outside Python (HTTP port)
curl -x "http://LOGIN:PASSWORD@HOST:2222" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
"https://generativelanguage.googleapis.com/v1beta/models"
# 2) Same proxy for the SDK: set it before the program starts
export HTTPS_PROXY="http://LOGIN:PASSWORD@HOST:2222"
export NO_PROXY="localhost,127.0.0.1"
python app.py
Example only: replace LOGIN, PASSWORD and HOST with the values from My assets and use your own key. Not run against Google on the writing machine.
Python SDK: a proxy in the client arguments
# pip install google-genai
from google import genai
from google.genai import types
# base_url: only if you run your own gateway in front of the API
# client_args / async_client_args: passed to the HTTP client (shape taken from the SDK README)
http_options = types.HttpOptions(
client_args={"proxy": "http://LOGIN:PASSWORD@HOST:2222"},
async_client_args={"proxy": "http://LOGIN:PASSWORD@HOST:2222"},
)
client = genai.Client(http_options=http_options) # key from GEMINI_API_KEY
print(client.models.generate_content(model="MODEL_NAME", contents="Say hi").text)
The client_args shape is taken from the Google Gen AI SDK README (shown there for SOCKS5); check it against your installed version. Replace the placeholders and the model name.
Base URL: only for your own gateway
The SDK's base_url sends requests to an endpoint you choose, such as an API gateway. It is not a network proxy and it does not make a region available. REST calls use the host generativelanguage.googleapis.com and carry the key in the x-goog-api-key header, so a gateway has to forward that header.
If you only wanted your traffic to leave through a particular IP, you do not need a base URL: HTTPS_PROXY or the client arguments are enough.
Check Is your country on the official available-regions list, and is the account of an adult?
Fix Compare with the list; in Colab the region of the Colab instance counts. If you are outside the list, the service is not offered to you.
Stop when Do not keep changing proxies: the decision is Google's, not the network's.
403 PERMISSION_DENIED with FREE_TIER_VERIFICATION_REQUIRED
Check Has the project been verified, or does it have billing?
Fix Verify the project or set up billing as the troubleshooting page says. A new key in the same project does not help, because eligibility is per project.
400 failed_precondition
Check Is a prerequisite such as billing missing?
Fix Check the project's billing status. The docs say not to retry 400, 402 or 403 errors.
407 or the connection times out through the proxy
Check Are host, port and login right, and does curl through the same proxy work?
Fix Use the curl test above, then see the proxy authentication guide.
A stable exit that matches your account
If you work in a country where Gemini is available and want one fixed address that matches the region of your account, a static ISP IP does not rotate during the lease: US$0.50 for 1 day or US$7.99 for 30 days (about US$0.27 a day). Choose HTTP for HTTPS_PROXY and the SDK; HTTP uses port 2222 and SOCKS5 port 3333 on proxy.proxy302.com.
There is no free trial; the smallest purchase is one IP for one day. A proxy does not change Google's region rules or your account's eligibility.
Check your country against the official available-regions list and confirm the account is eligible.
Step 2
Buy a static ISP IP in the country where you actually work and copy host, port, username and password from My assets.
Step 3
Test the login with the curl command, then set HTTPS_PROXY (or the client arguments) before your program starts.
Step 4
Call the API once and confirm it answers; if you get a 403, read the message, not the network.
Expected result A normal response, or a clear 4xx message about the project.
FAQ
How do I use a proxy with Google AI Studio?
For the site, set the operating system or browser proxy. For API calls, set HTTPS_PROXY before the program starts, or pass a proxy in the SDK's client arguments.
A 403 is often about the project: verification, free-tier eligibility or billing. Eligibility is checked per Google Cloud project, so a new key does not change it.
How to set up a proxy for the Gemini web app, Google AI Studio and the Gemini API, and how to diagnose common errors. A proxy does not change Google's terms.
Whether Gemini works depends on the separate web app and API region lists, the account region, the payments profile country, the account type and age, and the network address a request leaves from. Who decides each one, and an order for checking them.
Read on 14 November 2026: the Gemini API and Google AI Studio are available in the listed countries and territories, and the list includes the United Kingdom and Switzerland; a visitor from an unlisted region may see that the region may not be supported; for Colab, restrictions follow the region of the Colab instance.
Read on 14 November 2026: you must be 18 or older to use the APIs; the Services may only be accessed within an available region; only Paid Services may be used when making API clients available to users in the European Economic Area.
Read on 14 November 2026: keys are read from GEMINI_API_KEY or GOOGLE_API_KEY (GOOGLE_API_KEY wins if both are set); REST requests send the key in the x-goog-api-key header to generativelanguage.googleapis.com; for client-side apps the page recommends a backend proxy server so that the key stays on your server.
Read on 14 November 2026: a 403 PERMISSION_DENIED can mean the project needs verification (FREE_TIER_VERIFICATION_REQUIRED), is not eligible for the free tier (eligibility is evaluated per Google Cloud project, not per key or location), has an outstanding balance, or the key was reported as leaked.
Read on 14 November 2026: failed_precondition (400) means a prerequisite such as billing is not met; permission_denied (403) means no key permission or a restricted project; do not retry 400, 402 or 403 errors.
Read on 14 November 2026: HttpOptions takes base_url to route requests through a custom endpoint such as an API gateway proxy; client_args and async_client_args are passed to the HTTP client, with a proxy entry shown for SOCKS5; the SDK reads HTTPS_PROXY from the environment (example: http://username:password@proxy_uri:port).
Proxy302 product facts and price list
Product observation · Confirmed on:
Product facts file of the site (values checked on 10 November 2026): protocols and ports, prices in US$ (1 PTC = US$1), lease terms, quantity limits, no free trial.
Ready to try it?
Create an account, top up once, then pick rotating residential, static ISP or datacenter IPs and have one running in your browser within minutes.