# API Key Credentials

## Creating an API Key

To create an API key:

* Navigate to the APIs & Services→Credentials panel in Cloud Console.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdcreatecredmenu.png" alt=""><figcaption></figcaption></figure>

* In the selected project, click \[+ Create Credentials], then select API key from the drop down menu.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdcrtcredapikey.png" alt=""><figcaption></figcaption></figure>

* The API key created dialog box displays your newly created key. Copy the key and enter it in the Google Drive connector in Langstack.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdapikey.png" alt=""><figcaption></figcaption></figure>

* Click \[Close] to close the dialog box.&#x20;

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdapikeyclose.png" alt=""><figcaption></figcaption></figure>

* To restrict the key to use only with the Google Drive API, click the edit icon displayed under actions of the listed API key.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdapikeyedit.png" alt=""><figcaption></figcaption></figure>

* In the API Restrictions section, select the \[Restrict Key] radio button.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdapikeyrestrict.png" alt=""><figcaption></figcaption></figure>

* When the user selects \[Restrict Key], a field with a list of APIs appears.&#x20;

  * Select the Google drive API option.
  * Click \[OK].
  *

  ```
  <figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdapikeyrestrictgdapi.png" alt=""><figcaption></figcaption></figure>
  ```
* After clicking "OK":
  1. It displays “1 API”. (If a user selects more APIs, the number of APIs selected appears in this field.)
  2. Click the \[Save] button to save it.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdsaveapirestrictions.png" alt=""><figcaption></figcaption></figure>


---

# 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.langstack.com/welcome/in-depth-learning/connectors/google-drive-connector/setting-up-gcp-account-gcp-project-api-enablement-and-credentials-prerequisites/api-key-credentials.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.
