排查访问 Gemini Code Assist Standard 和 Enterprise 功能时遇到的问题
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本文档介绍了如何解决访问 Gemini Code Assist Standard 和 Enterprise 功能时遇到的问题。
根据您的管理员配置的 Google Cloud 项目和组织设置,您可能需要执行其他步骤才能在 Google API 控制台和受支持的 IDE 中使用 Gemini Code Assist 功能,例如启用所需的 API 并为自己分配 Gemini Code Assist Standard 或 Enterprise 许可。
已停用 Gemini for Google Cloud
当您尝试使用 Gemini Code Assist Standard 或 Enterprise 功能(例如 API 控制台中的快速提示或受支持的 IDE 中的代码补全)时,会发生以下错误:

如果 Gemini for Google Cloud API 未启用,则会发生此错误。
如果您有权在 Cloud 项目中启用 Gemini for Google Cloud,则系统会在消息中提供一个启用该 API 的链接。如果您没有启用该 API 的权限,则消息会列出您需要拥有的权限才能启用该 API。
缺少权限
当您尝试使用 Gemini Code Assist Standard 或 Enterprise 功能(例如 API 控制台中的快速提示或受支持的 IDE 中的代码补全)时,会发生以下错误:

如果您没有使用某项功能所需的用户权限,就会发生此错误。
如需解决此问题,请与您的 Google Cloud 管理员联系,并请求他们授予您缺少的权限。
缺少 Gemini Code Assist Standard 或 Enterprise 许可
如需使用 Gemini Code Assist Standard 或 Enterprise,您需要拥有已分配给您的许可。如果您的 Cloud 项目已启用所需的 API,并且您拥有使用 Gemini Code Assist Standard 或 Enterprise 功能所需的权限,但您尝试使用 Gemini Code Assist Standard 或 Enterprise 功能(例如 API 控制台中的快速提示或受支持的 IDE 中的代码补全),API 控制台会显示一条消息,说明您需要获取 Gemini Code Assist Standard 或 Enterprise 许可。
如果您没有权限自行分配或管理许可,系统会显示一个链接,供您了解 Gemini Code Assist Standard 和 Enterprise 的许可详情。您需要向 Cloud 项目管理员申请许可。
针对基于 Google API 控制台的 Gemini Code Assist Standard 和 Enterprise 功能的自助分配许可
如果您有权自行分配许可,并且您的组织中有一个可用的许可,那么您会在 API 控制台中看到一个对话框,您可以点击获取许可来分配许可。点击该按钮后,系统会为您分配许可,并在您进入非活动状态一段时间后自动取消分配。在该非活动期结束后,您的许可将被取消分配并返回到可用许可的池中。
如果您有权管理许可,则会看到一个对话框,您可以点击该对话框中的管理订阅手动或自动分配许可。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eThis guide helps troubleshoot access issues related to Gemini Code Assist features in the Google Cloud console and supported IDEs.\u003c/p\u003e\n"],["\u003cp\u003eAccess problems may arise if the Gemini for Google Cloud API is disabled, requiring users to enable it or contact their administrator if they lack permissions.\u003c/p\u003e\n"],["\u003cp\u003eUsers must have the necessary permissions to utilize Gemini Code Assist features, and if missing, they should request the needed permissions from their administrator.\u003c/p\u003e\n"],["\u003cp\u003eA Gemini Code Assist license is essential for usage; if missing, users need to acquire one, either by self-assignment if permitted or by requesting it from their administrator.\u003c/p\u003e\n"],["\u003cp\u003eUsers with license management permissions can manually assign licenses or utilize automatic assignment features.\u003c/p\u003e\n"]]],[],null,["# Troubleshoot access to Gemini Code Assist Standard and Enterprise features\n\nThis document shows you how to resolve issues with accessing\nGemini Code Assist Standard and Enterprise features.\n\nDepending on the Google Cloud project and organization settings that your\nadministrator configured, you might need to take additional steps to access\n\n[Gemini Code Assist features](/gemini-code-assist/docs/overview#supported-features)\nin the Google API Console and\n\n[supported IDEs](/gemini-code-assist/docs/supported-languages#supported_ides),\nsuch as enabling required APIs and assigning yourself a\nGemini Code Assist Standard or Enterprise license.\n\nDisabled Gemini for Google Cloud\n--------------------------------\n\nThe following error occurs when you are attempting to use a\nGemini Code Assist Standard or Enterprise feature, such as a\nquick prompt in the API Console or code completion in a supported\nIDE:\n\nThis error occurs if the\n\n[Gemini for Google Cloud API isn't enabled](/gemini-code-assist/docs/set-up-gemini-standard-enterprise#enable-api).\n\n\nIf you have permissions to enable the Gemini for Google Cloud on a\nCloud project, then the message provides a link to enable it. If you\ndon't have permissions to enable it, then the message lists the permission you\nneed to enable the API.\n\nMissing permission\n------------------\n\nThe following error occurs when you are attempting to use a\nGemini Code Assist Standard or Enterprise feature, such as a\nquick prompt in the API Console or code completion in a supported\nIDE:\n\nThis error occurs if you don't have the\n\n[required user permission to use a feature](/gemini-code-assist/docs/set-up-gemini-standard-enterprise#grant-iam).\n\n\nTo resolve this issue, contact your Google Cloud administrator and request them\nto grant you the missing permission.\n\nMissing Gemini Code Assist Standard or Enterprise license\n---------------------------------------------------------\n\nTo use Gemini Code Assist Standard or Enterprise, you need to\nhave a license assigned to you. If the required APIs are enabled on your\nCloud project and you have the required permissions to use\nGemini Code Assist Standard or Enterprise features, but you\nattempt to use a Gemini Code Assist Standard or Enterprise\nfeature (such as quick prompt in the API Console or code completion\nin a supported IDE), the API Console displays a message explaining\nthat you need to get a Gemini Code Assist Standard or Enterprise\nlicense.\n\nIf you don't have permissions to self-assign a license or manage licenses, then\nyou are provided a link to learn more about Gemini Code Assist\nStandard and Enterprise licensing. You will need to request a license from your\nCloud project administrator.\n\n### License self-assignment for Google API Console-based Gemini Code Assist Standard and Enterprise features\n\nIf you have permissions to self-assign licenses and a license is available in\nyour organization, then you'll see a dialog in the API Console where\nyou click **Get a license** to have one assigned to you. Clicking that button\nassigns a license to you, and it remains assigned until a period of inactivity\nelapses. After that period of inactivity, your license is unassigned and\nreturned to the pool of available licenses.\n\nIf you have permissions to\n\n[manage licenses](/gemini-code-assist/docs/manage-licenses), then\nyou'll see a dialog where you click **Manage subscription** manually or\nautomatically assign a license."]]