ระบุตำแหน่งสำหรับการเข้าถึงโมเดล

คลิกผู้ให้บริการ Gemini API เพื่อดูเนื้อหาและโค้ดของผู้ให้บริการนั้นๆ ในหน้านี้


โมเดล Generative AI ของ Google พร้อมให้บริการในบางภูมิภาค

เมื่อเริ่มต้นบริการแบ็กเอนด์ Vertex AI Gemini API ในโค้ด คุณสามารถระบุตำแหน่งของโมเดลที่กำลังเข้าถึง ในคำขอได้โดยไม่บังคับ หากไม่ได้ระบุสถานที่ตั้ง ค่าเริ่มต้นจะเป็น us-central1 ดูรายการสถานที่ที่พร้อมให้บริการในส่วนท้ายของหน้านี้

ดูข้อมูลเกี่ยวกับglobalตำแหน่ง

หากต้องการเข้าถึงโมเดล Gemini 2.0 และ Gemini 2.5 Vertex AI Gemini API รองรับglobalตำแหน่ง ซึ่งหมายความว่าคำขอของคุณจะได้รับการจัดการโดยโมเดลที่พร้อมใช้งานในพูลทั่วโลก การตั้งค่าตำแหน่งเป็น global สำหรับคำขอจะช่วยปรับปรุงความพร้อมใช้งานโดยรวม พร้อมทั้งลดข้อผิดพลาดเกี่ยวกับทรัพยากรหมด (429)

นอกจากนี้ โมเดลGemini 2.5 เวอร์ชันตัวอย่างและเวอร์ชันทดลองที่เปิดตัวหลังจากเดือนมิถุนายน 2025 มักจะเข้าถึงได้ในglobalสถานที่ตั้งเท่านั้น

ตัวอย่างโค้ด

โปรดทราบว่าตัวอย่างเหล่านี้แสดงการเข้าถึงโมเดล Gemini แต่คุณยังระบุตำแหน่งเมื่อเข้าถึงโมเดล Imagen ได้ด้วย

แทนที่ LOCATION ด้วยรหัสสถานที่ (เช่น europe-west4) จากรายการสถานที่ที่พร้อมให้บริการในหน้านี้ในภายหลัง

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");

// ...

ประเทศที่ให้บริการ

Google Cloud ใช้ ภูมิภาค Google Cloud จะจัดเก็บข้อมูลลูกค้าในภูมิภาคที่คุณระบุสำหรับฟีเจอร์ Generative AI ที่พร้อมให้บริการโดยทั่วไปทั้งหมดใน Vertex AI เท่านั้น

Generative AI ใน Vertex AI พร้อมให้บริการในภูมิภาคต่อไปนี้ บางรุ่นและ/หรือบางเวอร์ชันอาจไม่มีให้บริการในบางพื้นที่ (ดูความพร้อมให้บริการโดยละเอียดได้ใน เอกสารประกอบของ Google Cloud)

รุ่น Gemini 2.0 และ Gemini 2.5 (ยกเว้น Gemini 2.0 Flash Live) ยังมีให้บริการในสถานที่ global ด้วย สำหรับโมเดล Imagen ระบบไม่รองรับตำแหน่ง global

สหรัฐอเมริกา

  • โคลัมบัส รัฐโอไฮโอ (us-east5)
  • ดัลลัส รัฐเท็กซัส (us-south1)
  • ไอโอวา (us-central1)
  • ลาสเวกัส รัฐเนวาดา (us-west4)
  • มองก์คอร์เนอร์ เซาท์แคโรไลนา (us-east1)
  • เวอร์จิเนียตอนเหนือ (us-east4)
  • ออริกอน (us-west1)

แคนาดา

  • มอนทรีออล (northamerica-northeast1)

อเมริกาใต้

  • เซาเปาลู บราซิล (southamerica-east1)

ยุโรป

  • เบลเยียม (europe-west1)
  • ฟินแลนด์ (europe-north1)
  • แฟรงก์เฟิร์ต เยอรมนี (europe-west3)
  • ลอนดอน สหราชอาณาจักร (europe-west2)
  • มาดริด สเปน (europe-southwest1)
  • มิลาน อิตาลี (europe-west8)
  • เนเธอร์แลนด์ (europe-west4)
  • ปารีส ฝรั่งเศส (europe-west9)
  • วอร์ซอ โปแลนด์ (europe-central2)
  • ซูริก สวิตเซอร์แลนด์ (europe-west6)

เอเชียแปซิฟิก

  • ชางฮัวเคาน์ตี ไต้หวัน (asia-east1)
  • ฮ่องกง จีน (asia-east2)
  • มุมไบ อินเดีย (asia-south1)
  • โซล เกาหลี (asia-northeast3)
  • สิงคโปร์ (asia-southeast1)
  • ซิดนีย์ ออสเตรเลีย (australia-southeast1)
  • โตเกียว ญี่ปุ่น (asia-northeast1)

ตะวันออกกลาง

  • ดัมมาม ซาอุดีอาระเบีย (me-central2)
  • โดฮา กาตาร์ (me-central1)
  • เทลอาวีฟ อิสราเอล (me-west1)