# Set up Gemini in Colab Enterprise for a project

Before you can use [Gemini in Colab Enterprise](https://docs.cloud.google.com/colab/docs/gemini-in-colab/overview.md.txt),
your team needs to
[activate Gemini in Colab Enterprise in a Google Cloud project](https://docs.cloud.google.com/colab/docs/gemini-in-colab/set-up-gemini.md.txt#activate-gemini),
as described in this document. An administrator typically performs this step.

## Activate Gemini in Colab Enterprise in a Google Cloud project

To activate Gemini in Colab Enterprise in a Google Cloud project, an
administrator needs to enable the Gemini for Google Cloud API and grant the
Gemini for Google Cloud User role to users.

1. To enable the Gemini for Google Cloud API, in the Google Cloud console,
   go to the **Gemini for Google Cloud** page.

   [Go to Gemini for Google Cloud](https://console.cloud.google.com/marketplace/product/google/cloudaicompanion.googleapis.com)
2. In the project selector, select a project.

3. Click **Enable**.

   The page updates and shows a status of **Enabled**.
   Gemini is now available in the selected
   Google Cloud project to all users who have the required
   IAM roles.
4. To grant the IAM roles that are required to use
   Gemini, go to the **IAM \& Admin** page.

   [Go to IAM \& Admin](https://console.cloud.google.com/projectselector/iam-admin/iam)
5. In the **Principal** column, find a
   [principal](https://docs.cloud.google.com/iam/docs/overview.md.txt#concepts_related_identity) for which you want
   to give access to Gemini in Colab Enterprise, and then click
   **Edit principal** in that row.

6. In the **Edit access** pane, click
   **Add another role**.

7. In **Select a role** , select **Gemini for Google Cloud User**.

8. Click **Save**.

All of the users who have been granted these roles can access Gemini
features in the Google Cloud console within the specified project. For more
information, see
[Gemini for Google Cloud overview](https://docs.cloud.google.com/gemini/docs/overview.md.txt).

## Advanced setup tasks

Instead of using the Google Cloud console or the gcloud CLI to
grant predefined IAM roles, you can do any of the following:

- Use [IAM REST APIs](https://docs.cloud.google.com/iam/docs/reference/rest.md.txt)
  or [IAM client libraries](https://docs.cloud.google.com/iam/docs/reference/libraries.md.txt)
  to grant roles.

  If you use these interfaces, use the fully qualified role name,
  `roles/cloudaicompanion.user`.

  For more information about granting roles, see
  [Manage access to projects, folders, and organizations](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access.md.txt).
- Create and grant custom roles.

  Any [custom roles](https://docs.cloud.google.com/iam/docs/creating-custom-roles.md.txt) that you create need the
  following permissions to access Gemini:
  - `cloudaicompanion.instances.generateCode`
  - `cloudaicompanion.instances.completeCode`
  - `cloudaicompanion.entitlements.get`

## Billing

Gemini in Colab Enterprise is currently available to try at no additional cost. See
[Colab Enterprise pricing](https://cloud.google.com/colab/pricing).

## What's next

- Learn how to [write code with Gemini assistance](https://docs.cloud.google.com/colab/docs/use-code-completion.md.txt).
- Learn more about the [types of generative AI assistance available in Gemini for Google Cloud](https://docs.cloud.google.com/gemini/docs/overview.md.txt).
- Learn [how Gemini for Google Cloud uses your data](https://docs.cloud.google.com/gemini/docs/discover/data-governance.md.txt).
- Learn [how to access and manage Gemini admin controls](https://docs.cloud.google.com/gemini/docs/admin.md.txt).