Starting November 2, 2026, Firebase App Check enforcement will be required to use Firebase AI Logic. Learn more.
Model updates:
Gemini 4 Argon is now available to use with
Firebase AI Logic!
Learn more.
Gemini 2.5 models are limited to projects that actively used them in the
past. For the Agent Platform Gemini API, these models will
shut down for all projects in October 2026. To avoid
service disruptions, update to a newer model (like
gemini-4-argon,
gemini-3.8-flash, or
gemini-nano-banana-2.1).
Any stable Gemini Live API 2.5 models are not impacted.
Learn more.
如果發現不相符,請取得新的 Firebase 設定檔/物件,然後取代應用程式中的設定檔/物件。新的設定檔/物件應包含應用程式和 Firebase 專案的有效 API 金鑰。
400 錯誤:Service agents are being provisioned ... Service agents are needed to read the Cloud Storage file provided.
如果嘗試使用 Cloud Storage for Firebase 網址傳送多模態要求,可能會遇到下列 400 錯誤: Service agents are being provisioned ... Service agents are needed to read the Cloud Storage file provided.
這項錯誤的原因是,專案啟用 Agent Platform API 時,未正確自動佈建必要的服務代理。這是部分專案的已知問題,我們正在設法全面修正。
以下是修正專案和正確佈建這些服務代理的解決方法,讓您可以在多模態要求中加入 Cloud Storage for Firebase 網址。您必須是專案的擁有者,且只需為專案完成這組工作一次。
403 錯誤:PERMISSION_DENIED: Firebase AI Logic has been deactivated in this project. To resume using Firebase AI Logic, you must enforce Firebase App Check. Learn more: https://firebase.google.com/docs/ai-logic/app-check
如果收到 403 - PERMISSION_DENIED 錯誤,指出 Firebase AI Logic has been deactivated in this project. To resume using
Firebase AI Logic, you must enforce Firebase App Check. Learn more:
https://firebase.google.com/docs/ai-logic/app-check,表示 Firebase 專案已判定為不活躍,且您未對 Firebase AI Logic 強制執行 App Check。
「閒置專案」是指已啟用 Firebase AI Logic,但最近沒有任何 Firebase AI Logic 用量的專案。
由於您未對 Firebase AI Logic 強制執行 App Check,專案容易遭到 Gemini API 濫用。為保護您的專案,Firebase 已停用 Firebase AI Logic,直到您為 Firebase AI Logic 強制執行 App Check 為止。
如果您已強制執行 App Check,但仍收到這項錯誤,請檢查 Firebase AI Logic
是否已
開啟重送保護功能 (包括「僅限監控」模式)。
開啟重放攻擊防護機制後,只有有限使用權杖會視為通過 Firebase AI Logic 驗證,一般工作階段符記無法清除這項錯誤。請在應用程式中啟用有限使用權杖,或關閉 Firebase AI Logic 的重送防護功能,重新傳送要求,並等待約一天後再重新開啟重送防護功能 (專案活動每天都會重新評估)。
如果發現不相符,請取得新的 Firebase 設定檔/物件,然後取代應用程式中的設定檔/物件。新的設定檔/物件應包含應用程式和 Firebase 專案的有效 API 金鑰。
403 錯誤:Requests to this API firebasevertexai.googleapis.com ... are blocked.
如果收到 403 錯誤,指出 Requests to this API firebasevertexai.googleapis.com ... are blocked.,通常表示應用程式 Firebase 設定中的 API 金鑰設有限制,無法呼叫必要的 API。
如要修正這個問題,請前往 Google Cloud 控制台更新 API 金鑰限制,納入必要的 API。如果是 Firebase AI Logic,請務必確認 Firebase AI Logic API (firebasevertexai.googleapis.com) 已列入可使用 API 金鑰呼叫的 API 清單。
步驟如下:
在 Google Cloud 控制台中,依序開啟「APIs & Services」(API 和服務) >「Credentials」(憑證) 面板。
選取應用程式設定使用的 API 金鑰 (例如 iOS 應用程式的「iOS 金鑰」)。
在「編輯 API 金鑰」頁面,找到「API 限制」部分。
確認已選取「限制金鑰」選項。如果沒有,表示金鑰未受限制,這可能不是錯誤來源。
在「Selected APIs」(所選 API) 下拉式選單中,搜尋並選取「
Firebase AI Logic API」,將其新增至可使用 API 金鑰呼叫的所選
API 清單。
按一下 [儲存]。
變更最多可能需要五分鐘才會生效。
404 錯誤:Firebase AI Logic genai config not found
如果收到 404 錯誤,指出 Firebase AI Logic genai config not found,通常表示 Firebase AI Logic 的設定有誤或遺漏。
以下是造成這項錯誤最可能的原因:
您尚未為 Gemini API 供應商設定 Firebase 專案。
操作步驟:
在 Firebase 控制台中,依序前往「AI Services」(AI 服務) >
「AI Logic」。按一下「Get started」(開始使用),然後選取您選擇的 Gemini API 供應商。啟用 API 後,Firebase 就會為該供應商設定專案。完成工作流程後,請再次嘗試要求。
如果您最近才在 Firebase 控制台中完成 Firebase AI Logic 設定工作流程,則所有適用區域中的所有必要後端服務,可能都還無法使用 Firebase AI Logic 設定。
處理方式:
稍候幾分鐘,然後再次嘗試要求。
404 錯誤:模型「was not found or your project does not have access to it」?
例如:「Publisher Model projects/PROJECT-ID/locations/us-central1/publishers/google/models/gemini-3.1-pro-preview was not found or your project does not have access to it. Please ensure you are using a valid model version.」