[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003ePre-GA offerings, like this product or feature, are subject to the "Pre-GA Offerings Terms" and are available "as is" with potentially limited support.\u003c/p\u003e\n"],["\u003cp\u003eSetting up Gemini Cloud Assist requires enabling the Gemini for Google Cloud API in a Google Cloud project, typically performed by an administrator.\u003c/p\u003e\n"],["\u003cp\u003eTo access Gemini Cloud Assist, users need specific Identity and Access Management (IAM) roles, including "Gemini for Google Cloud User" and "Service Usage Consumer," granted at the project level.\u003c/p\u003e\n"],["\u003cp\u003eUsers who need to use Gemini Cloud Assist in Cloud Billing reports also require appropriate IAM roles granted in the linked Cloud Billing account.\u003c/p\u003e\n"],["\u003cp\u003eAdministrators can manage IAM roles for Gemini Cloud Assist either via the Google Cloud console, gcloud CLI, IAM REST APIs, client libraries or by creating and granting custom roles.\u003c/p\u003e\n"]]],[],null,["# Set up Gemini Cloud Assist in Cloud Billing\n\n\u003cbr /\u003e\n\n|\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nTo set up\n[Gemini Cloud Assist in Cloud Billing](/billing/docs/how-to/gemini/overview),\nperform the following steps:\n\n1. [Enable the Gemini Cloud Assist API in a Google Cloud project](#enable-api).\n An administrator typically performs this step.\n\n2. [In the Google Cloud project, grant Identity and Access Management (IAM) roles](#grant-iam)\n to the same users who access Cloud Billing cost and utilization\n data. An administrator typically performs this step.\n\n3. For users who need access to Cloud Billing data and\n Gemini Cloud Assist in Cloud Billing,\n [grant IAM roles in the Cloud Billing account](#grant-billing-iam)\n that's\n [linked to the project](/billing/docs/how-to/view-linked#view-all-projects-ba-links)\n where the Gemini Cloud Assist API is enabled. An administrator\n typically performs this step.\n\nEnable the Gemini Cloud Assist API in a Google Cloud project\n------------------------------------------------------------\n\nThis section describes the steps required to enable the\nGemini Cloud Assist API in a Google Cloud project. \n\n### Console\n\n1. To enable the Gemini Cloud Assist API, go to the\n **Gemini Cloud Assist API** page.\n\n [Go to the Gemini Cloud Assist API](https://console.cloud.google.com/marketplace/product/google/geminicloudassist.googleapis.com)\n2. In the project selector, select the project you want to use as a\n \"Gemini\" project.\n\n You can enable the Gemini Cloud Assist API in more than one\n project. For Cloud Billing users who have\n [billing-account-level permissions](/billing/docs/how-to/reports#required-permissions)\n on the Cloud Billing account, we recommend that you use a\n [FinOps administration project](/billing/docs/how-to/create-billing-account#set-up-billing-project)\n to contain the API.\n3. Click **Enable**.\n\n The page updates and shows a status of **API Enabled**.\n\n### gcloud\n\n\n1. In the Google Cloud console, activate Cloud Shell.\n\n [Activate Cloud Shell](https://console.cloud.google.com/?cloudshell=true)\n2. In the project selector menu, select the project you want to use as a\n \"Gemini\" project.\n\n You can enable the Gemini Cloud Assist API in more than one\n project. For Cloud Billing users who have\n [billing-account-level permissions](/billing/docs/how-to/reports#required-permissions)\n on the Cloud Billing account, we recommend that you use a\n [FinOps administration project](/billing/docs/how-to/create-billing-account#set-up-billing-project)\n to contain the API.\n3. Enable the Gemini Cloud Assist API using\n the [`gcloud services enable` command](/sdk/gcloud/reference/services/enable):\n\n gcloud services enable geminicloudassist.googleapis.com\n\n If you want to enable the Gemini Cloud Assist API in a different\n Google Cloud project, add the\n `--project` parameter: \n\n gcloud services enable geminicloudassist.googleapis.com --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with your Google Cloud project\n ID.\n\n The output is similar to the following: \n\n ```\n Waiting for async operation operations/acf.2e2fcfce-8327-4984-9040-a67777082687 to complete...\n Operation finished successfully.\n ```\n\nAfter you enable the Gemini Cloud Assist API in the specified\nGoogle Cloud project, Gemini Cloud Assist is now available to\nall users who have the\n[required IAM roles](#grant-iam)\non the specified project.\n\nGrant IAM roles in a Google Cloud project\n-----------------------------------------\n\nThis section describes the steps to grant the required project permissions to\nuse Gemini Cloud Assist. In the Google Cloud project where you\nenabled the Gemini Cloud Assist API, grant the following\nIAM roles to users\n([principals](/iam/docs/overview#concepts_related_identity))\non the project:\n\n- Gemini Cloud Assist User\n- Service Usage Consumer\n\n### Console\n\n1. To grant the IAM roles that are required to use\n Gemini Cloud Assist, go to the **IAM \\& Admin** page.\n\n [Go to IAM \\& Admin](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=)\n2. In the **Principal** column, find a\n [principal](/iam/docs/overview#concepts_related_identity)\n for which you want to enable access to Gemini Cloud Assist, and\n then click edit **Edit principal** in\n that row.\n\n3. In the **Edit access** pane, click\n add **Add another role**.\n\n4. In **Select a role** , select **Gemini Cloud Assist User**.\n\n5. Click **Add another role** and select **Service Usage Consumer**.\n\n6. Click **Save**.\n\n### gcloud\n\n\n1. In the Google Cloud console, activate Cloud Shell.\n\n [Activate Cloud Shell](https://console.cloud.google.com/?cloudshell=true)\n2. In the project selector menu, select a project.\n\n3. Grant the **Gemini Cloud Assist User** role:\n\n ```\n gcloud projects add-iam-policy-binding PROJECT_ID \\\n --member=PRINCIPAL --role=roles/geminicloudassist.user\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project---for example,`1234567890`.\n - \u003cvar translate=\"no\"\u003ePRINCIPAL\u003c/var\u003e: the [identifier](/iam/docs/principal-identifiers) for the principal---for example, `user:cloudysanfrancisco@gmail.com`.\n\n The output is a list of policy bindings that includes the following: \n\n - members:\n - user:\u003cvar translate=\"no\"\u003ePRINCIPAL\u003c/var\u003e\n role: roles/geminicloudassist.user\n\n4. Repeat the previous step for the role `roles/serviceusage.serviceUsageConsumer`.\n\nFor more information, see\n[Grant a single role](/iam/docs/granting-changing-revoking-access#grant-single-role)\nand\n[`gcloud projects add-iam-policy-binding`](/sdk/gcloud/reference/projects/add-iam-policy-binding).\n\nAll of the users (principals) who are granted these roles can access\nGemini Cloud Assist features in the Google Cloud console within the\nspecified project. If the project users also have\n[access to view Cloud Billing data](#grant-billing-iam),\nthey can use Gemini Cloud Assist in Cloud Billing **Reports**\nand the **FinOps hub** to get AI assistance to create cost reports and to\nsummarize key insights about cloud costs and optimization recommendations.\nFor more information, see\n[Gemini Cloud Assist in Cloud Billing overview](/billing/docs/how-to/gemini/overview).\n\n### Advanced IAM setup tasks for projects\n\nInstead of using the Google Cloud console or the gcloud CLI to\ngrant predefined IAM roles on a project, you can do any of the\nfollowing:\n\n- Use [IAM REST APIs](/iam/docs/reference/rest)\n or [IAM client libraries](/iam/docs/reference/libraries)\n to grant roles.\n\n If you use these interfaces, use the fully qualified role names:\n - `roles/geminicloudassist.user`\n - `roles/serviceusage.serviceUsageConsumer`\n\n For more information about granting roles, see\n [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n- Create and grant custom roles.\n\n Any [custom roles](/iam/docs/creating-custom-roles)\n for *project* permissions that you create need the following permissions to\n access Gemini Cloud Assist:\n - `geminicloudassist.companions.generateChat`\n - `geminicloudassist.companions.generateCode`\n - `serviceusage.services.use`\n\nGrant IAM roles in a Cloud Billing account\n------------------------------------------\n\nFor users who need access to Cloud Billing cost data, you need to grant\npermissions on the Cloud Billing account that are adequate to access\nthe **Reports** page and the **FinOps hub** . To use\nGemini Cloud Assist in Cloud Billing, grant users access\nto the Cloud Billing account that is\n[linked to the project](/billing/docs/how-to/view-linked#view-all-projects-ba-links)\nwhere the Gemini Cloud Assist API is enabled.\n\n- Required permissions: for detailed guidance about the permissions\n required to access Billing **Reports** , see the\n [Permissions required to access reports](/billing/docs/how-to/reports#required-permissions)\n section available in the\n \"Analyze billing data and cost trends with Reports\" article.\n\n- Required permissions: for detailed guidance about the permissions\n required to access the Billing **FinOps hub** , see the\n [Permissions required to access the FinOps hub](/billing/docs/how-to/finops-hub#required-permissions)\n section available in the\n \"Optimize costs with FinOps hub\" article.\n\n- Grant access: for guidance on how to grant access to a\n Cloud Billing account, see the\n [Update user permissions for a Cloud Billing account](/billing/docs/how-to/grant-access-to-billing#update-cloud-billing-permissions)\n section available in the\n \"Manage access to Cloud Billing accounts\" article.\n\nWhat's next\n-----------\n\n- Learn more about [AI assistance that's available in Gemini Cloud Assist in Cloud Billing](/billing/docs/how-to/gemini/overview).\n- Learn more about the different [types of generative AI assistance available in Gemini Cloud Assist](/gemini/docs/overview).\n- Learn [how Gemini Cloud Assist uses your data](/gemini/docs/discover/data-governance).\n- Learn more about [Google Cloud compliance](/security/compliance)."]]