Skip to main content
Running the API, either by using a library or by calling an API directly, requires an API key.

Get Your API Key

If using in the EU, get your API key here.
Get your API key on the API Key page:
  1. Log in to https://ade.landing.ai/.
  2. Go to the API Key page (to navigate there manually, click your profile icon at the bottom left corner of the page and click API Key). Navigate to API Key
  3. If you’re on a subscription plan, you can create an API key if needed.
  4. Click the Copy icon to copy your API key. API Key

Personal Plans (Explore Plans) Have One API Key

The personal plan (the “Explore” plan) only has one API key. This API key cannot be deleted or revoked. The Explore plan type is designed for testing, prototyping, and hobby use. If you’d like to deploy to production and need more granular API key management, like the ability to create and revoke API keys, upgrade to a subscription plan.
If your API key is exposed or leaked and you’d like to request a new API key, contact support@landing.ai

Create API Keys

If you are on a Team or Enterprise plan, you can create multiple API keys for your organization to use. To create an API key:
  1. Log in to https://ade.landing.ai/.
  2. Go to the API Key page (to navigate there manually, click your profile icon at the bottom left corner of the page and click API Key). Navigate to API Key
  3. If you’re not currently in the correct organization, select your organization from the drop-down menu.
  4. Click Create Key.
  5. Enter a brief, descriptive name for the API key in the key name field.
  6. Click Create API Key.
  7. Click the Copy icon to copy the API key.
  8. Click Done to close the pop-up.

Revoke API Keys

If you are on the Team or Enterprise plan, you can revoke API keys. A user with the Admin role can revoke any API key. A user with the Developer role can revoke only API keys they have created. To revoke an API key:
  1. Log in to https://ade.landing.ai/.
  2. Go to the API Key page (to navigate there manually, click your profile icon at the bottom left corner of the page and click API Key). Navigate to API Key
  3. If you’re not currently in the correct organization, select your organization from the drop-down menu.
  4. Locate the row for the API key. (You may need to search to narrow down the list of API keys.)
  5. Click the Settings button (ellipses) and select Revoke API Key. Follow the on-screen prompts to complete the process.

Set Your API Key When Using the Library

The client libraries read your API key from the VISION_AGENT_API_KEY environment variable. Get your API key first, then set it using any of the methods below. Do not hard-code your API key in source files. The examples below use the library; the TypeScript library reads the same environment variable.

Method 1: Set the API Key as an Environment Variable

  1. Set the environment variable. To persist the key across sessions on macOS or Linux, add the export command to your shell profile (.zshrc or .bashrc), then run source ~/.zshrc.
  2. Initialize the client. It reads the VISION_AGENT_API_KEY environment variable automatically:

Method 2: Store the API Key in a .env File

Store your API key in a .env file. The library reads the key from the environment; it does not load .env files on its own, so use python-dotenv to load the file.
  1. Install the python-dotenv package:
  2. Create a .env file in your project root and add your API key:
  3. Load the .env file before you initialize the client:

Method 3: Set the API Key in a Notebook

In IPython-based notebooks (Jupyter, JupyterLab, Google Colab, or Kaggle), set the key for the current session with the %env magic command. The key is cleared when the kernel restarts, and it is visible in the notebook file if you share or commit it.
  1. In a notebook cell, set the environment variable:
  2. Initialize the client in a later cell:

API Key Precedence

If the API key is set in more than one place, the library resolves it in this order (the first match wins):
  1. The apikey passed to the client constructor.
  2. The VISION_AGENT_API_KEY environment variable, whether you set it directly or loaded it from a .env file. A value already set in your environment is not overridden by a .env file.
For help with missing-key errors, keys that fail to load, or keys that resolve to the wrong account, see Troubleshoot API Key Issues.

Set Your API Key When Calling the API Directly

Include the API key in request headers. To see code samples, go to API.

Security Best Practices

  • If using a .env file: Add .env to .gitignore to prevent accidentally committing the API key to version control.
  • Do not hard-code the API key in your source code, because others could see and use your API key. Passing a variable that holds the key (for example, from a secrets manager) is fine.

Troubleshoot API Key Issues

Use the troubleshooting tips in this section to resolve issues related to API keys.

Error: Missing API Key

If no API key is set by any method, the library raises an error when you create the client. The Python library raises this error:
The TypeScript library throws this error:
To resolve this issue, set the key using one of the supported methods. If you set the key in a .env file or as an environment variable and still get this error, see the .env File Issues and Environment Variable Issues sections.

.env File Issues

If you set the API key in the .env file but the environment variable is not loading, try these possible solutions to resolve this issue:
  • Check file location: The .env file should be in the same directory where you run your script.
  • Verify file format: No spaces around the equals sign:

Environment Variable Issues

If you set the API key as an environment variable and are encountering issues, try these possible solutions to resolve this issue:
  • Restart your application after setting environment variables.
  • Check variable name: Must be exactly VISION_AGENT_API_KEY.
  • Check if the environment variable is correct:
  • Ensure that you apply the changes after setting, changing, or removing the environment variable:
    • Linux/macOS: Restart your terminal. If you added the variable to your .zshrc file, run source ~/.zshrc.
    • Windows: Close and reopen Command Prompt/PowerShell, or restart your IDE.

Wrong API Key Used

If you have multiple accounts and is using the wrong API key, the API key might be set using multiple methods and one is taking precedence over the other. To resolve this issue, check which API keys are set using each method. Example Scenario:
  1. You create an account with your personal email address and set the API as an environment variable.
  2. A few weeks later you create an account with your work email address and store the API key for that account in a .env file.
  3. When you run , it uses the first API key, because the environment variable takes precedence over the .env file.
Solution: Checking each way the API key can be set and then removing the unwanted API keys will ensure that the correct API key is used.

Error: Missing Authorization Header

This error occurs if the authorization header is not included when calling the API directly. To fix this, include the API header:

Error: User Not Found, Please Check Your API Key

This error occurs when the API key is entered incorrectly. To resolve this issue:
  • Verify the API key: Copy your key directly from the dashboard.
  • Restart your environment: Close and reopen your terminal, IDE, or Jupyter notebook.