API Keys
  • 02 Aug 2023
  • 5 Minutes to read
  • Dark
    Light
  • PDF

API Keys

  • Dark
    Light
  • PDF

Article Summary

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 June 30, 2023, LandingLens generates and requires only an API Key.

"New" API Credentials Only Use the API Key

If you generated API Key and API Secret pairs before June 30, 2023, 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 June 30, 2023, you can view those at the bottom of the API page:

  1. Click the User Menu and select API Key.
    API Key
  2. The existing credentials display in the Legacy API Key & Secret section.
    Legacy API Key and API Secret

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.

API Credentials in LandingEdge v2.4 and Earlier

Authenticate via API

When you generate an API call from the Deploy page beginning on June 30, 2023, it includes a placeholder for your API Key, but not one for an API Secret.

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.

Copy the API Call with Placeholders for the Legacy API Credentials

Or, you can add a line for the API Secret:

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. 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.

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

Generate API Keys


  1. Click the User Menu and select API Key.
    API Key
  2. Click Create New Key.
    Create New Key
  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.
    Generate API Key
  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.
    Copy the API Key and Close the Pop-Up Window

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.
    View API Credentials
  4. This opens the API Keys page. Here, you can create, view, and edit API Keys.
    API Keys

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.
    API Key
  2. Click the Eye icon next to your API Key.
    Click the Eye Icon
  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.
    API Key
  2. Click the Actions icon.
    Actions Icon
  3. Select Edit Key Name.
    Edit Key Name
  4. Enter the new name. 
  5. Click Save to save your changes and close the pop-up window.
    Rename and Save

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.
    API Key
  2. Click the Actions icon.
    Actions Icon
  3. Select either Revoke or Activate.
    Revoke
  4. The new status displays in the Status column.
    View the Updated Status

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 an API Key before you delete it.

Caution:
Deleted API Keys can't be restored.
  1. Click the User Menu and select API Key.
    API Key
  2. Click the Actions icon.
    Actions Icon
  3. Select Delete.
    Delete
  4. Read the caution on the pop-up window and click Delete.

Was this article helpful?