This page describes how to get subscriptions for
Gemini Enterprise and how to manage user licenses.

To set up access, you typically complete the following stages:

1. **Procure**: Purchase a subscription to a product edition for your billing account.
2. **Distribute**: Allocate licenses from the subscription to specific projects and locations.
3. **Assign**: Assign the distributed licenses to individual users.

## About licenses

To sign in to the Gemini Enterprise app, a user must have
a *license*. You can assign licenses to users manually or automatically.

- **Manually-assigned licenses:** You can add users by their email addresses.

- **Automatically-assigned licenses:** You can configure a subscription so that
  Gemini Enterprise automatically assigns a license to a user the first time
  they access the Gemini Enterprise or
  the Gemini Notebook for business interface.

> [!NOTE]
> **Note:** Licenses are specific to a Google Cloud project and a location. For example, if users need to access a Gemini Enterprise app in a Google Cloud project across both the US and global multi-regions, you need two separate licenses for these two separate locations within the same Google Cloud project.

## About subscriptions

To get licenses, you must first have a *subscription* to a Gemini Enterprise
edition. Subscriptions are specific to a billing account. For
information about available editions, see
[Compare editions of Gemini Enterprise](https://docs.cloud.google.com/gemini/enterprise/docs/editions.md.txt).

For Gemini Enterprise, you can buy a monthly subscription or a year-long
subscription. You can set these subscriptions to renew automatically.

You can purchase subscriptions for the Gemini Enterprise Standard,
Gemini Enterprise Plus, and Gemini Enterprise Pay-as-you-go editions using the
Google Cloud console.

### Subscription seat quantity limits

When you purchase or modify a seat-based subscription directly through the
Google Cloud console, the console enforces an automatic seat quantity cap. The
maximum number of seats depends on your Cloud Billing account.

If your organization requires more seats or if you encounter the maximum seat
limit error when trying to add licenses to an existing subscription, contact
your Google Cloud sales representative or account manager to purchase additional
licenses through an offline order or request an allowlist exemption.

## About subscription states

A subscription can be in one of the following states:

| State | Description |
| Not started | You purchased the subscription, but it is not yet active. You can distribute licenses from this subscription to projects, but if you assign these licenses to users, they can't access Gemini Enterprise until the subscription becomes active. For more information, see [Distribute licenses](https://docs.cloud.google.com/gemini/enterprise/docs/licenses.md.txt#distribute-licenses). |
| Active | The subscription is active, and users who have a license in this subscription can access Gemini Enterprise. |
| Deactivating | The subscription is deactivating, and its licenses are ending early. Users with licenses in this subscription continue to access Gemini Enterprise for a grace period of one week. After this week, the licenses transition to the Expired state. For more information, see [Handle early termination](https://docs.cloud.google.com/gemini/enterprise/docs/licenses.md.txt#handle-early-termination). |
| Expired | Users with licenses in this subscription lose access to Gemini Enterprise when the subscription term ends or when licenses transition from the deactivating state to the expired state after the subscription ends early. |
|---|---|

## Before you begin

Before starting the procedures on this page, complete the following
prerequisites:

- Complete all tasks outlined in
  [Set up Gemini Enterprise](https://docs.cloud.google.com/gemini/enterprise/docs/before-you-begin.md.txt). This includes:

  - Setting up a billing account for your project.
  - Granting at least the Gemini Enterprise User role to any users you'll license to use Gemini Enterprise.
- Verify that billing is enabled for your Google Cloud project. For more
  information, see
  [Verify that billing is enabled for your Google Cloud project](https://docs.cloud.google.com/billing/docs/how-to/verify-billing-enabled.md.txt#confirm_billing_is_enabled_on_a_project).

  > [!NOTE]
  > **Note** : If your project is linked to a self-serve (online)
  > Cloud Billing account, you pay for Gemini Enterprise Pay-as-you-go usage
  > with [prepaid
  > credits](https://docs.cloud.google.com/gemini/enterprise/docs/manage-prepaid-credits), and if prepaid credits aren't set up on your billing account
  > yet, you must buy credits to subscribe. If your project is linked to an
  > [invoiced
  > Cloud Billing account](https://docs.cloud.google.com/billing/docs/concepts#billing_account_types), usage is billed on your monthly
  > invoice.

- Confirm that you have the required IAM roles and permissions:

  - The [Gemini Enterprise Admin](https://docs.cloud.google.com/gemini/enterprise/docs/access-control.md.txt#discoveryengine.agentspaceAdmin)
    role on the project.

  - If you manage billing for your organization, you must have the following
    roles to purchase and manage Gemini Enterprise subscriptions and
    procurement orders:

    - On the Cloud Billing account that you use for the subscription,
      one of the following:

      - The [Billing Account Administrator](https://docs.cloud.google.com/iam/docs/roles-permissions/billing.md.txt#billing.admin) (`roles/billing.admin`) role.
      - Both the [Consumer Procurement Order Administrator](https://docs.cloud.google.com/iam/docs/roles-permissions/consumerprocurement.md.txt#consumerprocurement.orderAdmin) (`roles/consumerprocurement.orderAdmin`) role and the [Billing Account Viewer](https://docs.cloud.google.com/iam/docs/roles-permissions/billing.md.txt#billing.viewer) (`roles/billing.viewer`) role.
    - On the project, the
      [Service Usage Consumer](https://docs.cloud.google.com/iam/docs/roles-permissions/serviceusage.md.txt#serviceusage.serviceUsageConsumer)
      (`roles/serviceusage.serviceUsageConsumer`) role.

    Alternatively, to control IAM permissions granularly, you
    can use a custom role with the following permissions instead of the
    **Billing Account Administrator** role. Grant the permissions on the
    resources listed in the table.

    | Resource | Service | Permissions |
    |---|---|---|
    | Cloud Billing account | Cloud Billing | `billing.billingAccountPrices.list` |
    | Cloud Billing account | Consumer Procurement | `consumerprocurement.orders.get` `consumerprocurement.orders.place` `consumerprocurement.licensePools.assign` `consumerprocurement.licensePools.unassign` `consumerprocurement.licensePools.enumerateLicensedUsers` |
    | Cloud Billing account | Discovery Engine | `discoveryengine.billingAccountLicenseConfigs.distribute` `discoveryengine.billingAccountLicenseConfigs.get` `discoveryengine.billingAccountLicenseConfigs.list` `discoveryengine.billingAccountLicenseConfigs.retract` |
    | Project | Discovery Engine | `discoveryengine.licenseConfigs.create` `discoveryengine.licenseConfigs.get` `discoveryengine.licenseConfigs.list` `discoveryengine.licenseConfigs.update` `discoveryengine.projects.get` `discoveryengine.projects.provision` `discoveryengine.projects.reportConsentChange` `discoveryengine.userStores.batchUpdateUserLicenses` `discoveryengine.userStores.listUserLicenses` |
    | Project | Resource Manager | `resourcemanager.projects.get` `resourcemanager.projects.list` |
    | Project | Service Usage | `serviceusage.services.get` `serviceusage.services.list` |

## Get a subscription

To get licenses, purchase a subscription to a Gemini Enterprise edition for
your billing account. The subscription provides a pool of licenses that you
distribute to projects and assign to users. You can distribute licenses from a
license-based subscription, such as Gemini Enterprise Standard or Plus, to
projects linked to any billing account. You can distribute licenses from a
Pay-as-you-go subscription only to projects linked to the billing account that
owns the subscription.

### Standard and Plus

To subscribe to the Gemini Enterprise Standard or Plus edition, do the
following:

1. In the Google Cloud console, go to the **Gemini Enterprise \> Plans \&
   billing** page.

   [Go to Plans \& billing](https://console.cloud.google.com/gemini-enterprise/manage-subscription)
2. From the **Selected billing account** drop-down, select your billing
   account.

3. Click **Create Subscription**.

4. For the **Gemini Enterprise Standard** or
   **Gemini Enterprise Plus** edition, click **Subscribe**.

5. Configure the **Billing details**:

   1. Confirm or select the **Billing account** from the drop-down.
   2. Enter a **Subscription name**.
   3. Enter the **Number of licenses** you need for the edition.
6. Select a **Subscription period**.

7. If you want the subscription to renew automatically, select the
   **Auto renew subscription** checkbox.

8. Configure the **Distribution details**:

   1. In the **Project** field, enter a project ID, and then select a project from the matching options. If the console prompts you, enable the required APIs.
   2. Choose a **Location** for your subscription. If you don't have compliance or regulatory reasons to locate your data in the US or EU multi-regions, Google recommends that you choose the global multi-region for maximum availability and low latency.
9. Click **Create \> Confirm**.

### Pay-as-you-go

With a Pay-as-you-go subscription, you pay monthly for what you consume. For
more information, see
[Quotas and pricing for the Pay-as-you-go edition](https://docs.cloud.google.com/gemini/enterprise/docs/quotas-and-pay-as-you-go-usage.md.txt#quotas-pay-as-you-go).
You can use the subscription with any project connected to your billing
account.

> [!NOTE]
> **Note** : If your project is linked to a self-serve (online)
> Cloud Billing account, you pay for Gemini Enterprise Pay-as-you-go usage
> with [prepaid
> credits](https://docs.cloud.google.com/gemini/enterprise/docs/manage-prepaid-credits), and if prepaid credits aren't set up on your billing account
> yet, you must buy credits to subscribe. If your project is linked to an
> [invoiced
> Cloud Billing account](https://docs.cloud.google.com/billing/docs/concepts#billing_account_types), usage is billed on your monthly
> invoice.

To subscribe to the Gemini Enterprise Pay-as-you-go edition, do the
following:

1. In the Google Cloud console, go to the **Gemini Enterprise \> Plans \&
   billing** page.

   [Go to Plans \& billing](https://console.cloud.google.com/gemini-enterprise/manage-subscription)
2. From the **Selected billing account** drop-down, select your billing
   account.

3. Click **Create Subscription**.

4. For the **Gemini Enterprise Pay-as-you-go** edition, click
   **Create plan**.

5. Configure the **Billing details**:

   1. Confirm or select the **Billing account** from the drop-down.
   2. Enter a **Subscription name**.
   3. Enter the **Number of Pay-as-you-go licenses** you need for the edition.
6. Configure the **Distribution details**:

   1. In the **Project** field, enter a project ID, and then select a project from the matching options. If the console prompts you, enable the required APIs.
   2. Choose a **Location** for your subscription. If you don't have compliance or regulatory reasons to locate your data in the US or EU multi-regions, Google recommends that you choose the global multi-region for maximum availability and low latency.
7. Click **Create \> Confirm**.

8. If your project is linked to a self-serve (online) Cloud Billing
   account, the **Buy credits** window opens. Select an amount and a payment
   method, and then complete the purchase. Optionally, set up auto-reload.

   If you haven't set up prepaid credits on the billing account yet, you
   must buy credits. If you cancel, you don't create a subscription, and
   Google doesn't charge you. For more information, see
   [Manage prepaid credits](https://docs.cloud.google.com/gemini/enterprise/docs/manage-prepaid-credits.md.txt).

## Manage subscriptions

This section describes how to view, update, distribute, and reclaim
Gemini Enterprise subscriptions.

### View subscription details

To view the details of your Gemini Enterprise subscriptions, do the following:

### Console

1. In the Google Cloud console, go to the **Gemini Enterprise \> Plans \&
   billing** page.

   [Go to Plans \& billing](https://console.cloud.google.com/gemini-enterprise/manage-subscription)
2. From the **Selected billing account** drop-down, select your billing
   account.

3. In the **Gemini Subscriptions** table, click the name of your subscription
   to open the **Subscription detail** page.

### REST

To get subscription detail, run the following
command:

```
curl -X GET \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  -H "X-Goog-User-Project: PROJECT_NUMBER" \
  "https://discoveryengine.googleapis.com/v1alpha/billingAccounts/BILLING_ACCOUNT_ID/billingAccountLicenseConfigs"
```

Replace the following:

- `PROJECT_NUMBER`: the project number or ID that you use to attribute billing and quota for this API call. You must have the [Service Usage Consumer](https://docs.cloud.google.com/iam/docs/roles-permissions/serviceusage.md.txt#serviceusage.serviceUsageConsumer) role on this project.

- `BILLING_ACCOUNT_ID`: ID of your Google Cloud billing account.

Sample output

```bash
{
  "billingAccountLicenseConfigs": [{
    "name": "billingAccounts/BILLING_ACCOUNT_ID/billingAccountLicenseConfigs/BILLING_ACCOUNT_LICENSE_CONFIG_ID",
    "licenseCount": "2",
    "licenseConfigDistributions": {"projects/PROJECT_NUMBER/locations/global/licenseConfigs/LICENSE_CONFIG_ID": "1"
    },
    "subscriptionName": "subscriptions/SUBSCRIPTION_NAME",
    "subscriptionTier": "SUBSCRIPTION_TIER",
    "subscriptionTerm": "SUBSCRIPTION_TERM",
    "startDate": ...,
    "endDate": ...,
    "state": "ACTIVE",
    "procurementEntitlementId": "...",
    "subscriptionDisplayName": "...",
    "geminiBundle": true
  }]
}
```

<br />

### Update subscription settings

After you create a subscription, you can update the settings, such as the
license count or the auto-renewal setting.

The method for adding more licenses depends on how you originally purchased your
subscription:

- If you purchased your subscription through the Google Cloud console, add more licenses directly within the Google Cloud console using the steps in this section.
- If you purchased using an offline order form, you must update the order form with the new license count. Contact your Google account manager to update the order form.

> [!NOTE]
> **Note:** When you update your subscription seat count in the
> Google Cloud console, the console enforces a maximum seat limit based on your
> Cloud Billing account. For more information, see
> [Subscription seat quantity limits](https://docs.cloud.google.com/gemini/enterprise/docs/licenses.md.txt#seat-limits).
>
> If your existing subscription exceeds this limit (for example, if you
> initially purchased it through a sales-led offline order), you might
> encounter a seat limit error when you try to add more licenses directly
> through the Google Cloud console. Contact your Google Cloud sales representative
> or account manager to adjust your license count or request an allowlist
> exception.

To update the license count or renewal settings if you purchased your
subscription through the Google Cloud console, do the following:

1. In the Google Cloud console, go to the **Gemini Enterprise \> Plans \&
   billing** page.

   [Go to Plans \& billing](https://console.cloud.google.com/gemini-enterprise/manage-subscription)
2. From the **Selected billing account** drop-down, select your billing
   account.

3. In the **Gemini Subscriptions** table, click the name of your subscription
   to open the **Subscription detail** page.

4. On the **Subscription detail** page, click **Edit**.

5. In the **Edit Subscription** pane, enter a new value in the **Number of
   licenses** field, or select or clear the **Auto renewal** checkbox.

6. Click **Submit**.

### Cancel a subscription

To cancel a Gemini Enterprise subscription, you must turn off automatic
renewal. Your subscription remains active until the subscription term ends, and
Google might charge you until that date. For more information about your
subscription, see [View subscription details](https://docs.cloud.google.com/gemini/enterprise/docs/licenses.md.txt#subscription-detail).

To cancel your subscription, do the following:

1. In the Google Cloud console, go to the **Gemini Enterprise \> Plans \&
   billing** page.

   [Go to Plans \& billing](https://console.cloud.google.com/gemini-enterprise/manage-subscription)
2. From the **Selected billing account** drop-down, select your billing
   account.

3. In the **Gemini Subscriptions** table, click the name of your subscription
   to open the **Subscription detail** page.

4. On the **Subscription detail** page, click **Edit**.

5. In the **Edit Subscription** pane, clear the **Auto renewal** checkbox.

6. Click **Submit**.

### Distribute licenses

If you haven't distributed the subscribed licenses to a project, which might
happen when you purchase the subscription offline or when a previous attempt to
distribute licenses failed, do the following:

### Console

1. In the Google Cloud console, go to the **Gemini Enterprise \> Plans \&
   billing** page.

   [Go to Plans \& billing](https://console.cloud.google.com/gemini-enterprise/manage-subscription)
2. From the **Selected billing account** drop-down, select your billing
   account.

3. In the **Gemini Subscriptions** table, click the name of your subscription
   to open the **Subscription detail** page.

4. On the **Subscription detail** page, click **Distribute Licenses**.

   The **Distribute Licenses** pane opens, showing existing project license
   allocations along with the **Available licenses** and **Total licenses**
   counts.
5. To distribute licenses to a project:

   1. In the **Select a project** field, enter a project ID, and then select a project from the matching options.
   2. If a dialog prompts you to enable the Discovery Engine API for the selected project, click to enable it.
   3. From the **Region** drop-down, select a region.
   4. In the **License Count** field, enter the number of licenses to allocate.
   5. Optional: To allocate licenses to additional projects or regions, click **Add license distribution**, and then repeat these steps.

   > [!NOTE]
   > **Note:** When you delete an existing row (**Delete item** ) or reduce the number in a row's **License Count** field, you reclaim those licenses. You can reclaim licenses only once per day. For more information, see [Reclaim unassigned licenses in a subscription](https://docs.cloud.google.com/gemini/enterprise/docs/licenses.md.txt#reclaim-licenses).

6. Click **Submit**.

7. In the **Confirm License Distribution** dialog, click **Submit**.

### REST

To distribute licenses to a project or multiple projects, run the following
command:

```
curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  -H "X-Goog-User-Project: PROJECT_NUMBER" \
  -d '{
    "projectNumber": "TARGET_PROJECT_NUMBER",
    "location": "LOCATION",
    "licenseCount": LICENSE_COUNT,
    "licenseConfigId": "LICENSE_CONFIG_ID"
  }' \
  "https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/billingAccounts/BILLING_ACCOUNT_ID/billingAccountLicenseConfigs/BILLING_ACCOUNT_LICENSE_CONFIG_ID:distributeLicenseConfig"
```

Replace the following:

- `PROJECT_NUMBER`: the project number or ID that you use to attribute billing and quota for this API call. You must have the [Service Usage Consumer](https://docs.cloud.google.com/iam/docs/roles-permissions/serviceusage.md.txt#serviceusage.serviceUsageConsumer) role on this project. You can use `TARGET_PROJECT_NUMBER` if you enabled Discovery Engine on that project.

- `ENDPOINT_LOCATION`: the multi-region for your API request. Specify one of the following
  values:

  - `us` for the US multi-region
  - `eu` for the EU multi-region
  - `global` for the Global location

  For more information, see [Specify a multi-region
  for your data store](https://docs.cloud.google.com/gemini/enterprise/docs/locations#specify_a_multi-region_for_your_data_store).

  <br />

- `LOCATION`: the multi-region of your data store: `global`, `us`, or `eu`.

- `TARGET_PROJECT_NUMBER`: the project number you want to distribute licenses to.

- `LICENSE_COUNT`: the number of licenses to distribute.

- `BILLING_ACCOUNT_ID`: ID of your Google Cloud billing account.

- `BILLING_ACCOUNT_LICENSE_CONFIG_ID`: locate the Billing Account License Config ID within the [subscription detail](https://docs.cloud.google.com/gemini/enterprise/docs/licenses.md.txt#subscription-detail).

- *Optional* `LICENSE_CONFIG_ID`: the ID of an existing
  project-level license configuration. You can find this ID
  in the `licenseConfigDistributions` field when you [view subscription
  details](https://docs.cloud.google.com/gemini/enterprise/docs/licenses#subscription-detail).

  > [!NOTE]
  > **Note:** If you omit the `LICENSE_CONFIG_ID` from this API request, the API creates a new license configuration for the specified project number and location. To update an existing license configuration, you must include the `LICENSE_CONFIG_ID`.

<br />

### Reclaim unassigned licenses in a subscription

This section describes how to reclaim unassigned licenses from a project, making
them available in the billing account to redistribute to other projects.

> [!NOTE]
> **Note:** When you delete any row from the license distribution table (**Delete item** ) or reduce the number in a row's **License Count** field, you reclaim those licenses. You can reclaim licenses only once per day.

### Console

1. In the Google Cloud console, go to the **Gemini Enterprise \> Plans \&
   billing** page.

   [Go to Plans \& billing](https://console.cloud.google.com/gemini-enterprise/manage-subscription)
2. From the **Selected billing account** drop-down, select your billing
   account.

3. In the **Gemini Subscriptions** table, click the name of your subscription
   to open the **Subscription detail** page.

4. On the **Subscription detail** page, click **Distribute Licenses**.

5. In the list of allocations, locate the row for the project and region that
   you want to reclaim licenses from.

6. Choose one of the following actions:

   - To reduce the number of licenses, decrease the count in the **License
     Count** field.
   - To reclaim all licenses from the row, move the pointer over the row, and then click **Delete item**.
7. Click **Submit**.

8. In the **Confirm License Distribution** dialog, review the warning that
   license retractions are limited to once per day, and then click **Submit**.

### REST

To transfer subscription licenses back to the billing account to
[redistribute them](https://docs.cloud.google.com/gemini/enterprise/docs/licenses.md.txt#distribute-licenses), run the following command:

```
curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  -H "X-Goog-User-Project: PROJECT_NUMBER" \
  -d '{
    "licenseConfig": "projects/TARGET_PROJECT_NUMBER/locations/LOCATION/licenseConfigs/LICENSE_CONFIG_ID",
    "licenseCount": LICENSE_COUNT
  }' \
  "https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/billingAccounts/BILLING_ACCOUNT_ID/billingAccountLicenseConfigs/BILLING_ACCOUNT_LICENSE_CONFIG_ID:retractLicenseConfig"
```

Replace the following:

- `PROJECT_NUMBER`: the project number or ID that you use to attribute billing and quota for this API call. You must have the [Service Usage Consumer](https://docs.cloud.google.com/iam/docs/roles-permissions/serviceusage.md.txt#serviceusage.serviceUsageConsumer) role on this project. You can use `TARGET_PROJECT_NUMBER` if you enabled Discovery Engine on that project.

- `ENDPOINT_LOCATION`: the multi-region for your API request. Specify one of the following
  values:

  - `us` for the US multi-region
  - `eu` for the EU multi-region
  - `global` for the Global location

  For more information, see [Specify a multi-region
  for your data store](https://docs.cloud.google.com/gemini/enterprise/docs/locations#specify_a_multi-region_for_your_data_store).

  <br />

- `LOCATION`: the multi-region of your data store: `global`, `us`, or `eu`.

- `TARGET_PROJECT_NUMBER`: the project number you want to reclaim licenses from. This is the project where you allocated the licenses.

- `LICENSE_COUNT`: the number of licenses to reclaim.

- `BILLING_ACCOUNT_ID`: ID of your Google Cloud billing account.

- `BILLING_ACCOUNT_LICENSE_CONFIG_ID`: locate the Billing Account License Config ID within the [subscription detail](https://docs.cloud.google.com/gemini/enterprise/docs/licenses.md.txt#subscription-detail).

- `LICENSE_CONFIG_ID`: the [license config ID](https://docs.cloud.google.com/gemini/enterprise/docs/licenses.md.txt#subscription-detail) of an existing project-level license config.


<br />

### Handle early termination

When you migrate between different subscription types or if your billing account
has an issue, a subscription might end earlier than you planned.

To ensure a smoother transition and prevent service interruptions, we provide a
one-week (seven days) grace period where affected licenses are in a
deactivating state before they fully expire. During this grace period, you can
continue to use the service while you transition to a new subscription.

To ensure your users retain access, transfer their licenses to a new, active
subscription either [automatically](https://docs.cloud.google.com/gemini/enterprise/docs/licenses.md.txt#auto-transfer) or
[manually](https://docs.cloud.google.com/gemini/enterprise/docs/licenses.md.txt#manual-transfer).

The following image shows an example of a deactivating license in the
Google Cloud console:

![An example of a deactivating license in the Google Cloud console](https://docs.cloud.google.com/static/gemini/enterprise/docs/images/license/deactivating-license.png)

## Manage user licenses

This section describes how to view licenses, export user data, and assign,
transfer, and remove licenses for individual users.

### View licenses

To view the licenses and the users you assigned them to, do the following:

1. In the Google Cloud console, go to the **Gemini Enterprise** page.

   [Gemini Enterprise](https://console.cloud.google.com/gemini-enterprise/start)
2. Click **Manage users**.

3. Select the **Multi-region** of the existing license.

### Export user data

The users table in the Google Cloud console does not support sorting or filtering.
If you need to sort, filter, or analyze your user data, you can export up to
1,000,000 user records to a comma-separated values (CSV) file.

The exported CSV file includes the following columns.

| Column name | Description |
| `user_principal` | The email address of the user. |
| `license_config` | The full Google Cloud resource name for the user's assigned subscription (for example, `projects/PROJECT_NUMBER/locations/LOCATION/licenseConfigs/LICENSE_CONFIG_ID`). The license config ID corresponds to the Gemini Enterprise edition (for example, Standard or Plus) that an administrator assigned to the user. |
| `assignment_time` | The timestamp (in UTC) when an administrator assigned the license. |
| `last_login_time` | The timestamp (in UTC) when the user last signed in. |
| `license_assignment_state` | The license assignment state. The following values are available: - `ASSIGNED`: The user has an assigned license. - `NO_LICENSE`: The user does not have a license because an administrator hasn't assigned one or has removed an existing license. - `BLOCKED`: A policy or administrator blocks the user from receiving a license. |
|---|---|

To export user data to a CSV file, do the following:

1. In the Google Cloud console, go to the **Gemini Enterprise** \>
   **Manage users** page.

   [Manage users](https://console.cloud.google.com/gemini-enterprise/user-license)
2. Select the **Multi-region** of the existing license.

3. In the **Users** section, click **Export all users**.

   Depending on the size of the users table, exporting the data might take up
   to 2.5 minutes. During this time, the console displays a loading state.
   When the export finishes, your browser downloads the CSV file to its
   default download location.

#### Troubleshoot export issues

The following table lists common issues when exporting user data and their
resolutions.

| Issue | Resolution |
| The **Export all users** button is hidden | Make sure that you assigned licenses to users in the selected multi-region. If no users have assigned licenses, the **Export all users** button doesn't appear. |
| The export request fails with a limit-exceeded error | If your user list exceeds the export limit of 1,000,000 users, the Google Cloud console rejects the export request and displays a limit-exceeded error message. |
| The export request fails with a permission denied error | Make sure that your account has the [Gemini Enterprise Admin](https://docs.cloud.google.com/gemini/enterprise/docs/access-control.md.txt#discoveryengine.agentspaceAdmin) role, which includes the required `discoveryengine.userStores.listUserLicenses` permission. |
|---|---|

### Assign licenses to users

This section explains how to automatically or manually assign licenses to new
users. You can assign a license to a new user at any time, and after you
assign the license, the user can access Gemini Enterprise immediately.

#### Add users and assign them licenses automatically

To assign licenses to users automatically when they sign in to the
Gemini Enterprise app, do the following:

> [!NOTE]
> **Note:** Ensure your subscription has enough licenses for the maximum number of users you expect to use Gemini Enterprise.

1. In the Google Cloud console, go to the **Gemini Enterprise** page.

   [Gemini Enterprise](https://console.cloud.google.com/gemini-enterprise/start)
2. Click **Manage users**.

3. Select the **Multi-region** of the existing license.

4. Select **Assign licenses automatically** and then select the subscription.

   Each time a user without a manually-assigned license signs in,
   Gemini Enterprise automatically assigns them a license from this
   subscription. If no licenses remain in the subscription,
   Gemini Enterprise shows users a message notifying them that they
   don't have access.

   For more information about subscriptions, see the
   [About subscriptions](https://docs.cloud.google.com/gemini/enterprise/docs/licenses.md.txt#about-subscriptions) section.

#### Add users and manually assign them licenses

To give specific users access to Gemini Enterprise, you can
manually assign them licenses from an active subscription.

### Console

To manually assign licenses to users, do the following:

1. In the Google Cloud console, go to the **Gemini Enterprise** page.

   [Gemini Enterprise](https://console.cloud.google.com/gemini-enterprise/start)
2. Click **Manage users**.

3. Select the **Multi-region** of the existing license.

4. Click **Add users**.

5. On the **Add users** page:

   1. Enter the email addresses of the users. Make sure to use the same email
      address that they'll use to sign in to the
      Gemini Enterprise
      app.

   2. Select the subscription to assign to those users.

   3. Click **Submit**.

### REST

To manually assign licenses to users, run the following
command:

> [!IMPORTANT]
> **Key Term:** In Gemini Enterprise, the term *app* can be used interchangeably with the term *engine* in the context of APIs. A Gemini Enterprise engine is a generic search engine where the `app_type` field is set to `APP_TYPE_INTRANET`.

```
curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  -H "X-Goog-User-Project: PROJECT_ID" \
  "https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/userStores/default_user_store:batchUpdateUserLicenses" \
  -d '{
   "inlineSource":{
      "userLicenses":[
         {
            "userPrincipal":"USER_EMAIL_1",
            "licenseConfig":"projects/PROJECT_NUMBER/locations/LOCATION/licenseConfigs/SUBSCRIPTION_ID"
         },
         {
            "userPrincipal":"USER_EMAIL_2",
            "licenseConfig":"projects/PROJECT_NUMBER/locations/LOCATION/licenseConfigs/SUBSCRIPTION_ID"
         }
      ],
      "updateMask": "userPrincipal,licenseConfig"
   },
   "deleteUnassignedUserLicenses":false
  }'
```

Replace the following:

- `PROJECT_ID`: the ID of your project.
- `ENDPOINT_LOCATION`: the multi-region for your API request. Specify one of the following values:
  - `us` for the US multi-region
  - `eu` for the EU multi-region
  - `global` for the Global location

  For more information, see [Specify a multi-region
  for your data store](https://docs.cloud.google.com/gemini/enterprise/docs/locations#specify_a_multi-region_for_your_data_store).
- `LOCATION`: the multi-region of your data store: `global`, `us` or `eu`
- `USER_EMAIL`: the email address of the user you want to add to the license.
- `PROJECT_NUMBER`: the number of your Google Cloud project.
- `SUBSCRIPTION_ID`: the ID of your Gemini Enterprise subscription.

<br />

### Transfer licenses from expired subscriptions

Users can't sign in to Gemini Enterprise if the subscription has
expired. You can restore their sign-in access in two ways:

- [Automatically transfer existing users with expired licenses to the default
  subscription](https://docs.cloud.google.com/gemini/enterprise/docs/licenses#auto-transfer).

- [Manually transfer existing users to a new subscription](https://docs.cloud.google.com/gemini/enterprise/docs/licenses.md.txt#manual-transfer).

> [!NOTE]
> **Note:** If you previously blocked a user from accessing a license, Gemini Enterprise grants them access within 30 minutes after you assign the new license.

#### Automatically transfer users to an active subscription

To automatically transfer users to an active subscription, do the following:

1. In the Google Cloud console, go to the **Gemini Enterprise \> Manage users**
   page.

   [Gemini Enterprise License](https://console.cloud.google.com/gemini-enterprise/user-license)
2. Select the **Multi-region** of the existing license.

3. Make sure that you have an active subscription. If you don't have one, [get
   a subscription](https://docs.cloud.google.com/gemini/enterprise/docs/licenses#get-subscription).

4. Select **Assign licenses automatically** and choose the active subscription.

5. Select **Automatically update expired license**.

   When a user with an expired license next signs in, Gemini Enterprise
   automatically grants them a license in the chosen subscription.

#### Manually transfer users to an active subscription

To manually transfer users to an active subscription, do the following:

1. In the Google Cloud console, go to the **Gemini Enterprise \> Manage users**
   page.

   [Gemini Enterprise License](https://console.cloud.google.com/gemini-enterprise/user-license)
2. Select the **Multi-region** of the existing license.

3. Make sure that you have an active subscription. If you don't have one, [get
   a subscription](https://docs.cloud.google.com/gemini/enterprise/docs/licenses#get-subscription).

4. Select the users and click **Assign different license**.

5. In the **Edit Users** pane, select the subscription and click **Submit**.

### List the licenses

To list the licenses and the users you assigned them to, run the following
command:

> [!IMPORTANT]
> **Key Term:** In Gemini Enterprise, the term *app* can be used interchangeably with the term *engine* in the context of APIs. A Gemini Enterprise engine is a generic search engine where the `app_type` field is set to `APP_TYPE_INTRANET`.

```
curl -X GET \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  -H "X-Goog-User-Project: PROJECT_ID" \
  "https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/userStores/default_user_store/userLicenses"
```

Replace the following:

- `PROJECT_ID`: the ID of your project.
- `ENDPOINT_LOCATION`: the multi-region for your API request. Specify one of the following values:
  - `us` for the US multi-region
  - `eu` for the EU multi-region
  - `global` for the Global location

  For more information, see [Specify a multi-region
  for your data store](https://docs.cloud.google.com/gemini/enterprise/docs/locations#specify_a_multi-region_for_your_data_store).
- `LOCATION`: the multi-region of your data store: `global`, `us` or `eu`

### Remove users from a license

You can remove a license from a user at any time. When you remove a license,
the user immediately loses access to Gemini Enterprise. To remove users
from a license, do the following:

### Console

To remove users from a license using the Google Cloud console, do the following:

1. In the Google Cloud console, go to the **Gemini Enterprise \> Manage users**
   page.

   [Gemini Enterprise License](https://console.cloud.google.com/gemini-enterprise/user-license)
2. Select the **Multi-region** of the existing license.

3. In the users table, select the users.

4. To remove users from a license, choose one of the following:

   - To only remove the license from the selected users, click **Unassign license**.
   - To remove the license and also delete the selected users from the project, click **Unassign and delete license**.
5. Click **Confirm**.

### REST

To remove users from a license, run the following command:

> [!IMPORTANT]
> **Key Term:** In Gemini Enterprise, the term *app* can be used interchangeably with the term *engine* in the context of APIs. A Gemini Enterprise engine is a generic search engine where the `app_type` field is set to `APP_TYPE_INTRANET`.

```
curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  -H "X-Goog-User-Project: PROJECT_ID" \
  "https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/userStores/default_user_store:batchUpdateUserLicenses" \
  -d '{
   "inlineSource":{
      "userLicenses":[
         {
            "userPrincipal":"USER_EMAIL_1"
         },
         {
            "userPrincipal":"USER_EMAIL_2"
         }
      ],
      "updateMask": "userPrincipal,licenseConfig"
   },
   "deleteUnassignedUserLicenses":true
  }'
```

Replace the following:

- `PROJECT_ID`: the ID of your project.
- `ENDPOINT_LOCATION`: the multi-region for your API request. Specify one of the following values:
  - `us` for the US multi-region
  - `eu` for the EU multi-region
  - `global` for the Global location

  For more information, see [Specify a multi-region
  for your data store](https://docs.cloud.google.com/gemini/enterprise/docs/locations#specify_a_multi-region_for_your_data_store).
- `LOCATION`: the multi-region of your data store: `global`, `us` or `eu`
- `USER_EMAIL`: the email address of the user you want to remove from the license.

<br />

## What's next

- Learn more about the [Frequently asked questions about Gemini Enterprise licenses](https://docs.cloud.google.com/gemini/enterprise/docs/licenses-faqs.md.txt).
- Learn about [IAM roles and permissions](https://docs.cloud.google.com/gemini/enterprise/docs/access-control.md.txt).