> ## Documentation Index
> Fetch the complete documentation index at: https://docs.iearena.org/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](/core-concepts/hosted-harbor/cli) or
[API](/core-concepts/hosted-harbor/api), 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:

<div className="dark:hidden">
  <img src="https://mintcdn.com/kobe/Hk2RHT2c7Ve2Ukb3/images/hosted-harbor/hub-home.png?fit=max&auto=format&n=Hk2RHT2c7Ve2Ukb3&q=85&s=4011b6c4eb99c885ed737d9ddf18aa50" alt="The Harbor Hub home page, listing published datasets" width="3782" height="1676" data-path="images/hosted-harbor/hub-home.png" />
</div>

<div className="hidden dark:block">
  <img src="https://mintcdn.com/kobe/Hk2RHT2c7Ve2Ukb3/images/hosted-harbor/hub-home-dark.png?fit=max&auto=format&n=Hk2RHT2c7Ve2Ukb3&q=85&s=5b99511f14abff93c3d77946b3b8afb5" alt="The Harbor Hub home page, listing published datasets" width="3774" height="1748" data-path="images/hosted-harbor/hub-home-dark.png" />
</div>

Then click the **Settings** tab:

<div className="dark:hidden">
  <img src="https://mintcdn.com/kobe/Hk2RHT2c7Ve2Ukb3/images/hosted-harbor/hub-settings.png?fit=max&auto=format&n=Hk2RHT2c7Ve2Ukb3&q=85&s=179975735ee8ab216bce78844c11bbc6" alt="Profile page" width="3784" height="526" data-path="images/hosted-harbor/hub-settings.png" />
</div>

<div className="hidden dark:block">
  <img src="https://mintcdn.com/kobe/Hk2RHT2c7Ve2Ukb3/images/hosted-harbor/hub-settings-dark.png?fit=max&auto=format&n=Hk2RHT2c7Ve2Ukb3&q=85&s=12b3a4237f00e70abca00e54bf0f10ff" alt="Profile page" width="3772" height="520" data-path="images/hosted-harbor/hub-settings-dark.png" />
</div>

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.

<div className="dark:hidden">
  <img src="https://mintcdn.com/kobe/Hk2RHT2c7Ve2Ukb3/images/hosted-harbor/harbor-api-key.png?fit=max&auto=format&n=Hk2RHT2c7Ve2Ukb3&q=85&s=8dabb5070043ade91d09fde29c1b58f0" alt="Profile page" width="2952" height="452" data-path="images/hosted-harbor/harbor-api-key.png" />
</div>

<div className="hidden dark:block">
  <img src="https://mintcdn.com/kobe/Hk2RHT2c7Ve2Ukb3/images/hosted-harbor/harbor-api-key-dark.png?fit=max&auto=format&n=Hk2RHT2c7Ve2Ukb3&q=85&s=29760a1176be3ba228791a49559eea0c" alt="Profile page" width="2988" height="464" data-path="images/hosted-harbor/harbor-api-key-dark.png" />
</div>
