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

# Prerequisites

> Check the software, account access, credentials, and network access you need before you install the HiddenLayer Python SDK.

Before you install the HiddenLayer Python SDK, make sure you have the items on this page. Checking them first saves time, because most setup problems come from a wrong Python version, missing API permissions, or a blocked network connection.

## Checklist

| Requirement | Why you need it |
| - | - |
| Python 3.9 or later (3.11 or later recommended) | The SDK requires Python 3.9 at minimum. |
| `pip` | Installs the SDK and its dependencies from PyPI. |
| `venv` (included with Python) | Keeps the SDK and its dependencies isolated from other projects. |
| A HiddenLayer account with Console access | You create API keys in the Console. |
| An API key (client ID and client secret) | The SDK uses these to authenticate every request. |
| Your region or base URL | Credentials and API hosts are region specific. |
| HTTPS access to the HiddenLayer API host | The SDK sends all requests over the network. |
| Optional packages for some workflows | Some helpers need third-party libraries, such as `boto3`. |

## Python

The SDK supports Python 3.9 and later. Python 3.9 reached end of life in October 2025 and no longer receives security fixes, so use Python 3.11 or later for new projects.

Check your Python version:

**macOS/Linux**

```bash theme={null}
python3 --version
```

**Windows**

```powershell theme={null}
py --version
```

If the `py` launcher is not installed, run `python --version` instead.

The output should be `Python 3.9` or later, for example `Python 3.12.4`. If your version is older, install a newer Python from [python.org](https://www.python.org/downloads/) or your operating system's package manager.

## pip and venv

`pip` is the Python package installer. `venv` is the built-in Python module that creates virtual environments. A virtual environment is a self-contained folder with its own Python interpreter and packages, so the SDK's dependencies do not conflict with other projects on your machine.

Check that both are available:

**macOS/Linux**

```bash theme={null}
python3 -m pip --version
python3 -m venv --help
```

**Windows**

```powershell theme={null}
py -m pip --version
py -m venv --help
```

> [!TIP]
>
> On some Linux distributions, `venv` is packaged separately from Python. If `python3 -m venv --help` fails, install your distribution's venv package (for example, `python3-venv` on Debian and Ubuntu).

## HiddenLayer account and API key

You need a HiddenLayer account with access to the HiddenLayer Console. In the Console, create an API key. An API key consists of a **client ID** and a **client secret**. The SDK exchanges these for a short-lived access token using OAuth2 client credentials, a standard flow in which an application authenticates as itself rather than as a user.

Follow [Create API Key](/docs/products/console/apikey_aisec_platform#create-api-key) to create one. When you create the key:

* Select the **Read**, **Write**, and **Delete** permissions needed for each product you plan to use. For example, the Interactions SaaS endpoint needs Interactions (Read, Write). See [API Permission Related to Products or Features](/docs/products/console/apikey_aisec_platform#api-permission-related-to-products-or-features) for the full list. Follow the principle of least privilege and grant only what your code needs. If the key lacks a permission, the SDK raises `PermissionDeniedError` (HTTP 403) for that product's endpoints.
* Copy the client secret and store it securely. Treat it like a password.

> [!WARNING]
>
> Never paste your client secret into source code, notebooks, or commits. The SDK reads credentials from environment variables. See [Authentication and configuration](/docs/integrations/sdk_python/authentication).

## Region or base URL

HiddenLayer runs separate regional environments. Your API key works only in the region where it was created, because the SDK requests tokens from the same host it sends API calls to.

| Environment | API host |
| - | - |
| `prod-us` (default) | `https://api.us.hiddenlayer.ai` |
| `prod-eu` | `https://api.eu.hiddenlayer.ai` |

If you use a self-hosted deployment or a locally running AI Runtime Security container, you need its base URL instead, for example `http://localhost:8000`. Ask your administrator if you are not sure which applies to you.

## Network access

The machine that runs your code must be able to reach the API host for your region over HTTPS (port 443). If your organization routes traffic through a proxy or firewall, confirm that the host is allowed. You can configure a proxy in the SDK. See [Authentication and configuration](/docs/integrations/sdk_python/authentication#use-a-proxy).

Some workflows also need network access to other services:

* Hugging Face model scans download files from Hugging Face.
* S3 and Azure Blob Storage model scans download files from your cloud storage.
* Red team sessions send attack prompts to your target AI application, which your code calls.

## Optional packages by workflow

The core SDK installs everything needed for most API calls. A few helpers rely on third-party packages that you install separately, only if you use that helper.

| Workflow | Helper | Extra packages |
| - | - | - |
| Scan local files or folders | `client.model_scanner.scan_file`, `scan_folder` | None |
| Scan a remote model without downloading it | `client.community_scanner.community_scan` | None |
| Scan a Hugging Face model by downloading it first | `client.model_scanner.scan_huggingface_model` | `huggingface_hub` |
| Scan a model in AWS S3 | `client.model_scanner.scan_s3_model` | `boto3` |
| Scan a model in Azure Blob Storage | `client.model_scanner.scan_azure_blob_model` | `azure-identity`, `azure-storage-blob` |
| Use the `aiohttp` backend with the async client | `DefaultAioHttpClient` | `hiddenlayer-sdk[aiohttp]` extra |
| Load credentials from a `.env` file | `load_dotenv()` | `python-dotenv` |

Installation commands for these packages are on the [Installation](/docs/integrations/sdk_python/installation#install-optional-packages) page.

## Next step

> **[Install the SDK](/docs/integrations/sdk_python/installation)**
>
> Create a virtual environment and install `hiddenlayer-sdk`.
