> ## Documentation Index
> Fetch the complete documentation index at: https://harbor-framework-harbor.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Harbor Hub API key

> Create a Harbor Hub API key

To authenticate any command via the [CLI](https://harbor-framework-harbor.mintlify.site/core-concepts/hosted-harbor/cli.md) or
[API](https://harbor-framework-harbor.mintlify.site/core-concepts/hosted-harbor/api.md), you must first create a Harbor API key.

## CLI

If using the CLI, an API key is minted automatically when you successfully run `harbor auth login`.
The key is stored in `~/.harbor/credentials.json` and revoked upon `harbor auth logout`.
You can also authenticate the CLI via the `HARBOR_API_KEY` environment variable. The next
section demonstrates creating an API key via the web UI.

## Web UI

To mint an API key on the web UI, first go to [the Hub](https://hub.harborframework.com).

Click on your profile in the top-right corner:

![The Harbor Hub home page, listing published datasets](https://mintcdn.com/harbor-framework-harbor/AA53Bak3s_44xndu/images/hosted-harbor/hub-home.png?fit=max\&auto=format\&n=AA53Bak3s_44xndu\&q=85\&s=dceee8aa7d9e8432df53328b76d93e01)

Then click the **Settings** tab:

![Profile page](https://mintcdn.com/harbor-framework-harbor/AA53Bak3s_44xndu/images/hosted-harbor/hub-settings.png?fit=max\&auto=format\&n=AA53Bak3s_44xndu\&q=85\&s=4acf5a58400eefd87bc41a1a00ecc134)

Scroll down to the API keys section and click **Create API key**. Give the key a name
and an expiration date. Store this key somewhere safe. It has full access to your Harbor Hub account.

![Profile page](https://mintcdn.com/harbor-framework-harbor/AA53Bak3s_44xndu/images/hosted-harbor/harbor-api-key.png?fit=max\&auto=format\&n=AA53Bak3s_44xndu\&q=85\&s=1c15871cf265152f69645523d60e9b2c)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.