# Create Google Cloud Vertex AI API Key

### Step 1: Create new project

Go to <https://console.cloud.google.com/projectcreate>, enter project name and click **Create.**

<figure><img src="/files/mxEXEn7AxOXITIIHRdZ9" alt=""><figcaption></figcaption></figure>

### Step 2: Create new service account

Go to [https://console.cloud.google.com/iam-admin/serviceaccounts](https://console.cloud.google.com/iam-admin/serviceaccounts?authuser=1), select the project just created in [#step-1-create-new-project](#step-1-create-new-project "mention").

Click **Create Service Account**.

<figure><img src="/files/2klFbRx7q16cHXSy2LnB" alt=""><figcaption></figcaption></figure>

Enter name, description for service account and click **Create and Continue**.

<figure><img src="/files/cXlThvQACLuJRToi3zsa" alt=""><figcaption></figcaption></figure>

Click **Select a role** and search for **Vertex AI Service Agent**, then select it.

<figure><img src="/files/3nZblXRZ5bdO6BOReKBP" alt=""><figcaption></figcaption></figure>

Click **Continue**.

<figure><img src="/files/LCO2dGwDe2hGmrxSkkk2" alt=""><figcaption></figcaption></figure>

Click **Done**.

<figure><img src="/files/qVEspVhwnesbo9TUXrqF" alt=""><figcaption></figcaption></figure>

### Step 3: Generate new key

Click on the service account just created, then select **Keys** tab.

<figure><img src="/files/2o2mwmBhDpWWmq88Pmql" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/4sF98vwQGzUlzT8YmIc4" alt=""><figcaption></figcaption></figure>

Click **Add Key** and select **Create new key**.

<figure><img src="/files/UYLvq3bJKn2tniOlyWAb" alt=""><figcaption></figcaption></figure>

Select **JSON** and click **Create**.

<figure><img src="/files/a7GBmD0T0p8fQV4I2e0Q" alt=""><figcaption></figcaption></figure>

A JSON file will be downloaded into your machine. Keep that file secret. Open that file and copy whole file content.

<figure><img src="/files/R8LLxSaiafoaSejuHTtY" alt=""><figcaption></figcaption></figure>

Key file content looks like below:

```
{
  "type": "service_account",
  "project_id": "mindmac-300128",
  "private_key_id": "12efb3bcc7u7dbf111842f27415d37454c6d6fa012",
  "private_key": "-----BEGIN PRIVATE KEY-----\nMIIE...8XI3A=\n-----END PRIVATE KEY-----\n",
  "client_email": "mindmac-service-account@mindmac-300128.iam.gserviceaccount.com",
  "client_id": "208453549200948148846",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/mindmac-service-account%40mindmac-300128.iam.gserviceaccount.com",
  "universe_domain": "googleapis.com"
}
```

### Step 4: Enable Vertex AI API

Go to <https://console.cloud.google.com/marketplace/product/google/aiplatform.googleapis.com>, select the project just created and click **Enable** to activate Vertex AI API.

<figure><img src="/files/gQnhrmC4gXusOQ8BqPWd" alt=""><figcaption></figcaption></figure>

### Step 5: Grab information to construct API URL

Go to <https://console.cloud.google.com/vertex-ai>, select project just created and take note region name.

<figure><img src="/files/xDsdGomNU88WDEyWI07b" alt=""><figcaption></figcaption></figure>

Go to <https://console.cloud.google.com/welcome>, select project just created and copy the project ID.

<figure><img src="/files/icBukE62h4xdv6dnVyqp" alt=""><figcaption></figcaption></figure>

Vertex AI API URL has format:&#x20;

```
https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/google/models
```

* LOCATION is the region name above, for example **us-central1**
* PROJECT\_ID is the ID of the project above

In this case it should be:

```
https://us-central1-aiplatform.googleapis.com/v1/projects/mindmac-300128/locations/us-central1/publishers/google/models
```

***

### Add Google Vertex AI key

Go to **MindMac** -> **Settings...** -> **Account** or press <mark style="color:purple;">**⌘ + ,**</mark> to open Account Setting.

<figure><img src="/files/pOxx0grWm6zgadWDp24W" alt=""><figcaption></figcaption></figure>

Select **Vertex AI** provider, enter name and your custom URL from [#step-5-grab-information-to-construct-api-url](#step-5-grab-information-to-construct-api-url "mention"), paste Service Account key content from [#step-2-create-new-service-account](#step-2-create-new-service-account "mention") and click **Save** to finish.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mindmac.app/how-to.../add-api-key/create-google-cloud-vertex-ai-api-key.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
