> ## Documentation Index
> Fetch the complete documentation index at: https://landinglens.docs.landing.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# API Keys

export const vp = 'Visual Prompting';

export const smartLabel = 'Smart Labeling';

export const productLL = 'LandingLens';

export const mi = 'Mobile Inference';

export const llsf = 'LandingLens on Snowflake';

export const companyName = 'LandingAI';

*This article applies to these versions of LandingLens:*

<table>
  <thead>
    <tr>
      <th>LandingLens</th>
      <th>LandingLens on Snowflake</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><span class="check-icon">✓</span></td>
      <td><span class="cross-icon">✖</span></td>
    </tr>
  </tbody>
</table>

You must use an API Key to run inference. An API key allows LandingLens to authenticate requests to run inference using the Models you’ve created. This prevents non-authorized users from accessing your Models.

## Changes to API Authentication

Up until June 30, 2023, LandingLens required both an API Key and API Secret to be used to run inference. After evaluating our user experience and current industry standards, we decided to eliminate the use of the API Secret. As of {DateAPI}, LandingLens generates and requires only an API Key.

<img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_new.png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=b2b61c09eee9b287e1739a74a9f2b2be" alt="api_new" width="2016" height="1086" data-path="images/api_new.png" />

If you generated API Key and API Secret pairs before {DateAPI}, those credentials will continue to be valid. Creating API Keys will not override your existing API Key and API Secret.

If you choose to use the legacy API Key and API Secret, you must use them together; you won’t be able to enter only the API Key.

Additionally, any API calls or LandingEdge Inspection Points using the legacy API credentials will continue to work, and aren’t affected by this change. No action is needed.

### View Legacy API Credentials

If you generated API credentials before {DateAPI}, you can view those at the bottom of the API page:

1. Click the **User Menu** and select **API Key**.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_user_1(1).png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=e7f2d43e433ead102bfaac3e7f4f999f" alt="api_key_user_1(1)" width="1990" height="722" data-path="images/api_key_user_1(1).png" />
2. The existing credentials display in the **Legacy API Key & Secret** section.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_legacy.png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=171527fbe21b25543fcf4ae5491fbd2b" alt="api_legacy" width="2016" height="1441" data-path="images/api_legacy.png" />

### Authenticate in LandingEdge

To support legacy API credentials, LandingEdge will continue to have both an **API Key** field and an **API Secret** field.

If you only have the API Key, enter it in the **API Key** field. Then, if using LandingEdge v2.5.5 or later, leave the **API Secret** field blank. If using an earlier version, enter a minimum of one alphanumeric character in the **API Secret** field.

<img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_le.png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=44445a79ab9680bd1da6e19520b0cc4b" alt="api_key_le" width="690" height="412" data-path="images/api_key_le.png" />

### Authenticate via API

When you generate an API call from the **Deploy** page beginning on {DateAPI}, it includes a placeholder for your API Key, but not one for an API Secret.

```bash theme={null}
curl --location --request POST 'ENDPOINT' \
     --header 'Content-Type: multipart/form-data' \
     --header 'apikey: YOUR_APIKEY' \
     --form 'file=@"YOUR_IMAGE"'
```

If you want to use your legacy API credentials, you have two options:

You can click the hyperlink in this text on the **Deploy** page: If you have a legacy API Key and Secret, click here to copy the cURL command.

<img src="https://mintcdn.com/landinglens/DvBW9mEn8yO5Yvy5/images/generate_legacy_api_call.png?fit=max&auto=format&n=DvBW9mEn8yO5Yvy5&q=85&s=f106dbbc8fc760ddcc60ebea9b586306" alt="generate_legacy_api_call" width="1827" height="705" data-path="images/generate_legacy_api_call.png" />

```bash theme={null}
curl --location --request POST 'ENDPOINT' \
     --header 'Content-Type: multipart/form-data' \
     --header 'apikey: YOUR_APIKEY' \
     --header 'apisecret: YOUR_APISECRET' \
     --form 'file=@"YOUR_IMAGE"'
```

## Create Multiple API Keys

You can create multiple API Keys. This gives you more flexibility and control over who can run inference with your deployed Models.

For example, let's say that you are running a Beta Test, and you have a group of testers running inference. You can generate an API Key and give it only to those testers. After the Beta Test is complete, you no longer want those testers to have the option to run inference on that Model anymore. To secure the Model, you can [revoke the API Key](#revoke-or-activate-api-key). When the API Key is revoked, anyone attempting to use that API Key won't have access.

## Can Use Any API Key for Any Project in Your Organization

The API Key is valid for all Projects within the same organization in LandingLens. However, you must have access to a Project to use the API Key to run inference in that Project. For more information about accessing Projects, go to [Public and Private Projects](./public-and-private-projects).

If you have more than one organization in LandingLens, the API Keys in one organization aren't valid for another.

## Generate API Keys

<iframe width="560" height="315" src="https://www.youtube.com/embed/wuXvDo1ZAeU?&wmode=opaque&rel=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />

1. Click the **User Menu** and select **API Key**.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_user_1(1).png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=e7f2d43e433ead102bfaac3e7f4f999f" alt="api_key_user_1(1)" width="1990" height="722" data-path="images/api_key_user_1(1).png" />
2. Click **Create New Key**.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_user_2.png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=5a4d3fbccf66ef7d976fd9b4bd7a032e" alt="api_key_user_2" width="1989" height="1102" data-path="images/api_key_user_2.png" />
3. Read the tips about using API Keys in LandingLens.
4. Enter a brief, descriptive name for the API Key in the **Key Name** field.
5. Click **Generate API Key**.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_user_3.png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=f33163a8a4f0f1c9475f2de59fca90a6" alt="api_key_user_3" width="1359" height="948" data-path="images/api_key_user_3.png" />
6. A pop-up window opens, displaying the API Key. You can click the **Copy** icon to copy the API Key, if needed. Click **Done** to close the pop-up window.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_user_4.png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=12f507f4dbcff62adf5f7353205e8f83" alt="api_key_user_4" width="776" height="606" data-path="images/api_key_user_4.png" />

### Access API Keys from the Deploy Page

To access API Keys from the Deploy page:

1. Open a Project that already has an endpoint set up for deployment.
2. Click **Deploy**.
3. Click **View API Key & Secret**.
   <img src="https://mintcdn.com/landinglens/AkXgdAcL19zbnV5n/images/deploy_view_api.png?fit=max&auto=format&n=AkXgdAcL19zbnV5n&q=85&s=45fd9ae93a563c1a44c6130fba7f7e39" alt="deploy_view_api" width="1831" height="725" data-path="images/deploy_view_api.png" />
4. This opens the API Keys page. Here, you can create, view, and edit API Keys.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_landing.png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=4291ff559b3a5d64b5c088941a95a5b7" alt="api_key_landing" width="1999" height="923" data-path="images/api_key_landing.png" />

## Retrieve API Key

For security, part of the API Key is replaced with asterisks after it's generated. You can see the full API Key for any key you've generated. You can't see API Keys that anyone else (including Admins) has generated.

To retrieve an API Key:

1. Click the **User Menu** and select **API Key**.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_user_1(1).png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=e7f2d43e433ead102bfaac3e7f4f999f" alt="api_key_user_1(1)" width="1990" height="722" data-path="images/api_key_user_1(1).png" />
2. Click the **Eye** icon next to your API Key.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_retrieve.png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=5ee4c43e64455d9f07a62196da9528c3" alt="api_key_retrieve" width="1999" height="923" data-path="images/api_key_retrieve.png" />
3. The full API Key displays. The API Key remains unhidden to you until you leave the page.

## Edit API Key Name

You can edit the name of any API Key you've generated. You can't edit an API Key that anyone else (including Admins) has generated.

1. Click the **User Menu** and select **API Key**.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_user_1(1).png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=e7f2d43e433ead102bfaac3e7f4f999f" alt="api_key_user_1(1)" width="1990" height="722" data-path="images/api_key_user_1(1).png" />
2. Click the **Actions** icon.
   <img src="https://mintcdn.com/landinglens/i_hGHOXkVC0R_OQG/images/rename_api_1(1).png?fit=max&auto=format&n=i_hGHOXkVC0R_OQG&q=85&s=a062c7ca310d173eb6b73836d4b40e04" alt="rename_api_1(1)" width="2023" height="815" data-path="images/rename_api_1(1).png" />
3. Select **Edit Key Name**.
   <img src="https://mintcdn.com/landinglens/i_hGHOXkVC0R_OQG/images/rename_api_2.png?fit=max&auto=format&n=i_hGHOXkVC0R_OQG&q=85&s=5119b8079d39dd1d78ac32552118c468" alt="rename_api_2" width="2023" height="875" data-path="images/rename_api_2.png" />
4. Enter the new name.
5. Click **Save** to save your changes and close the pop-up window.
   <img src="https://mintcdn.com/landinglens/i_hGHOXkVC0R_OQG/images/rename_api_3.png?fit=max&auto=format&n=i_hGHOXkVC0R_OQG&q=85&s=d03d8af93db04e5523e53fa384dbda70" alt="rename_api_3" width="668" height="360" data-path="images/rename_api_3.png" />

## Revoke or Activate API Key

If you no longer want an API Key to be valid, you can revoke it. An API Key is not valid during that time that it's revoked. You can later re-activate the API Key if you want to use it again.

You can revoke or activate any API Key you've generated. You can't edit an API Key that anyone else (including Admins) has generated.

To revoke or activate an API Key:

1. Click the **User Menu** and select **API Key**.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_user_1(1).png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=e7f2d43e433ead102bfaac3e7f4f999f" alt="api_key_user_1(1)" width="1990" height="722" data-path="images/api_key_user_1(1).png" />
2. Click the **Actions** icon.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_revoke_1.png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=34aafb0fdd1b8f314322aae488106639" alt="api_key_revoke_1" width="1999" height="923" data-path="images/api_key_revoke_1.png" />
3. Select either **Revoke** or **Activate**.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_revoke_2.png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=826083e0710bc7675858af514ccd54e5" alt="api_key_revoke_2" width="2023" height="985" data-path="images/api_key_revoke_2.png" />
4. The new status displays in the **Status** column.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_revoke_3.png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=72a4bddb4184fd3bfb301defb7813527" alt="api_key_revoke_3" width="1988" height="1030" data-path="images/api_key_revoke_3.png" />

## Delete API Key

You can delete any API Key you've generated. You can't edit an API Key that anyone else (including Admins) has generated.

You must [revoke](/#revoke-or-activate-api-key) an API Key before you delete it.

<Warning>Deleted API Keys can't be restored.</Warning>

1. Click the **User Menu** and select **API Key**.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_user_1(1).png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=e7f2d43e433ead102bfaac3e7f4f999f" alt="api_key_user_1(1)" width="1990" height="722" data-path="images/api_key_user_1(1).png" />
2. Click the **Actions** icon.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_delete_1.png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=3d292a518b6b41a666938c6a7621339e" alt="api_key_delete_1" width="1991" height="1040" data-path="images/api_key_delete_1.png" />
3. Select **Delete**.
   <img src="https://mintcdn.com/landinglens/lfi7C6xislw6Nqbm/images/api_key_delete_2.png?fit=max&auto=format&n=lfi7C6xislw6Nqbm&q=85&s=cfa9eb0a4c0f7e8a19f438925a12ce88" alt="api_key_delete_2" width="2027" height="1144" data-path="images/api_key_delete_2.png" />
4. Read the caution on the pop-up window and click **Delete**.
