Click your Gemini API provider to view provider-specific content and code on this page. |
Google's generative AI models are available in specific regions.
When initializing the Vertex AI Gemini API backend service in your code,
you can optionally specify the location for the model that you're accessing
in your requests. If you don't specify a location, the default is us-central1
.
See the list of available locations later on this page.
Learn about the global
location
For accessing Gemini 2.0 and Gemini 2.5 models, the
Vertex AI Gemini API supports a global
location, which means your
request will be handled by an available model anywhere in the global pool.
Setting the location to global
for your requests can improve overall
availability while reducing resource exhausted (429) errors.
Also, Gemini 2.5 preview and experimental models released after
June 2025 are only accessible in the global
location.
Code samples
Note that these samples show accessing a Gemini model, but you can also specify a location when accessing an Imagen model.
Replace LOCATION with the location code (for example, europe-west4
)
from the list of available locations later on this page.
Swift
// ...
// Initialize the Vertex AI Gemini API backend service
// Specify the location for where you want to access the model
let ai = FirebaseAI.firebaseAI(backend: .vertexAI(location: "LOCATION"))
// Create a `GenerativeModel` instance with a model that supports your use case
let model = ai.generativeModel(modelName: "MODEL_NAME")
// ...
Kotlin
// ...
// Initialize the Vertex AI Gemini API backend service
// Specify the location for where you want to access the model
val model = Firebase.ai(backend = GenerativeBackend.vertexAI(location = "LOCATION"))
.generativeModel("MODEL_NAME")
// ...
Java
// ...
// Initialize the Vertex AI Gemini API backend service
// Specify the location for where you want to access the model
GenerativeModel ai = FirebaseAI.getInstance(GenerativeBackend.vertexAI("LOCATION"))
.generativeModel("MODEL_NAME");
GenerativeModelFutures model = GenerativeModelFutures.from(ai);
// ...
Web
// ...
// Initialize FirebaseApp
const firebaseApp = initializeApp(firebaseConfig);
// Initialize the Vertex AI Gemini API backend service
// Specify the location for where you want to access the model
const ai = getAI(firebaseApp, { backend: new VertexAIBackend('LOCATION') });
// Create a `GenerativeModel` instance with a model that supports your use case
const model = getGenerativeModel(ai, { model: 'MODEL_NAME' });
// ...
Dart
// ...
// Initialize the Vertex AI Gemini API backend service
// Specify the location for where you want to access the model
final ai = await FirebaseAI.vertexAI(location: 'LOCATION');
// Create a `GenerativeModel` instance with a model that supports your use case
final model = ai.generativeModel(model: 'MODEL_NAME');
// ...
Unity
// ...
// Initialize the Vertex AI Gemini API backend service
// Specify the location for where you want to access the model
var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.VertexAI(location: "LOCATION"));
// Create a `GenerativeModel` instance with a model that supports your use case
var model = ai.GetGenerativeModel(modelName: "MODEL_NAME");
// ...
Available locations
Google Cloud uses regions. Google Cloud only stores customer data in the region that you specify for all generally-available features of Generative AI on Vertex AI.
Generative AI on Vertex AI is available in the following regions. Some models and/or specific versions may not be available in all locations (for detailed location availability, see the Google Cloud documentation).
Gemini 2.0 and Gemini 2.5 models are also available in a
global
location. The global
location is not supported for
Imagen models.
United States
- Columbus, Ohio (
us-east5
) - Dallas, Texas (
us-south1
) - Iowa (
us-central1
) - Las Vegas, Nevada (
us-west4
) - Moncks Corner, South Carolina (
us-east1
) - Northern Virginia (
us-east4
) - Oregon (
us-west1
)
Canada
- Montréal (
northamerica-northeast1
)
South America
- Sao Paulo, Brazil (
southamerica-east1
)
Europe
- Belgium (
europe-west1
) - Finland (
europe-north1
) - Frankfurt, Germany (
europe-west3
) - London, United Kingdom (
europe-west2
) - Madrid, Spain (
europe-southwest1
) - Milan, Italy (
europe-west8
) - Netherlands (
europe-west4
) - Paris, France (
europe-west9
) - Warsaw, Poland (
europe-central2
) - Zürich, Switzerland (
europe-west6
)
Asia Pacific
- Changhua County, Taiwan (
asia-east1
) - Hong Kong, China (
asia-east2
) - Mumbai, India (
asia-south1
) - Seoul, Korea (
asia-northeast3
) - Singapore (
asia-southeast1
) - Sydney, Australia (
australia-southeast1
) - Tokyo, Japan (
asia-northeast1
)
Middle East
- Dammam, Saudi Arabia (
me-central2
) - Doha, Qatar (
me-central1
) - Tel Aviv, Israel (
me-west1
)