- 05 Aug 2024
- 5 Minutes to read
- Print
- DarkLight
- PDF
API Keys
- Updated on 05 Aug 2024
- 5 Minutes to read
- Print
- DarkLight
- PDF
This article applies to these versions of LandingLens:
LandingLens | LandingLens on Snowflake |
✓ | ✖ |
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.
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:
- Click the User Menu and select API Key.
- The existing credentials display in the Legacy API Key & Secret section.
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.
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.
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
- Click the User Menu and select API Key.
- Click Create New Key.
- Read the tips about using API Keys in LandingLens.
- Enter a brief, descriptive name for the API Key in the Key Name field.
- Click Generate API Key.
- 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.
Access API Keys from the Deploy Page
To access API Keys from the Deploy page:
- Open a Project that already has an endpoint set up for deployment.
- Click Deploy.
- Click View API Key & Secret.
- This opens the API Keys page. Here, you can create, view, and edit 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:
- Click the User Menu and select API Key.
- Click the Eye icon next to your API Key.
- 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.
- Click the User Menu and select API Key.
- Click the Actions icon.
- Select Edit Key Name.
- Enter the new name.
- Click Save to save your changes and close the pop-up window.
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:
- Click the User Menu and select API Key.
- Click the Actions icon.
- Select either Revoke or Activate.
- The new status displays in the Status column.
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.
- Click the User Menu and select API Key.
- Click the Actions icon.
- Select Delete.
- Read the caution on the pop-up window and click Delete.