---
updatedAt: 2025-10-09T10:17:00.000Z
agentTools:
  projectIndex: https://docs.ol-hub.com/llms.txt
---

# Generating API Keys

## Overview

OpenLegacy uses three types of API Keys for authentication:

* **User API Keys** are used for user authentication (CLI, Generated Services).
* **Account API Keys** are used for automation/ci/deployment to OL Runtime (authentication between the Runtime and the OL Hub). An **Account API Key** is used by an Admin or by the system.
* **Runtime API Keys** are used for OL Runtime API Gateway authentication. A **Runtime API Key** is used by an OL Runtime/Partner user.

The OpenLegacy CLI asks for your API key as part of your login authentication process. After you log in, the CLI stores the key in its configuration file and uses it to encrypt and decrypt the communication between the CLI and the OL Hub.

To generate an API key:

1.  [Sign up and log in to the OL Hub](https://ol-hub.readme.io/docs/sign-up-to-the-ol-hub).

2. In the OL Hub, click your user avatar on the right side of the top bar and select **API Keys**. \
   ![](https://files.readme.io/e23e84e-API_Keys.png)

3. In the **API Keys** tab, click **GENERATE API KEY** .

4. Type the **Key name**  and click **Generate**.

5. Click **COPY To Clipboard**.

6. Before clicking **Done**, copy and paste the new API key to a secure location for future use.

![](https://files.readme.io/4e92697-green_bar.png)  When you click **Done**, the key becomes hidden.

![](https://files.readme.io/053d4b2-pointer.png)  The new API key appears in the list of API keys.

> ❗️ If you revoke the key by clicking **Revoke**, any communication secured by this key will not be decrypted.

Now you can [log in to the OL Hub from the CLI tool](https://ol-hub.readme.io/docs/log-in-to-ol-cli) with the API key you have just generated.