Install & Compatibility
Where this runs
tested against v3.7.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.912s · 36.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.4s · import 0.846s · 36MB
35MB installed
● package 35MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
HiddenLayer
✓ from hiddenlayer import HiddenLayer
✗ from hiddenlayer_sdk import HiddenLayer
The package is installed as hiddenlayer-sdk, but the import module is 'hiddenlayer'.
HiddenLayerAsync
✓ from hiddenlayer import HiddenLayerAsync
✗ from hiddenlayer_sdk.async_client import HiddenLayerAsync
The async client is exported from the main 'hiddenlayer' module.
Initialize the client using environment variables for credentials, then make a sample API call.
import os
from hiddenlayer import HiddenLayer
client = HiddenLayer(
api_key=os.environ.get('HIDDENLAYER_API_KEY', ''),
base_url=os.environ.get('HIDDENLAYER_BASE_URL', 'https://api.hiddenlayer.ai'),
)
# Example: list models
models = client.models.list()
print(models)
Debug
Known issues
breakingIn v3.0.0, the import path changed from 'hiddenlayer_sdk' to 'hiddenlayer'. All existing code using 'from hiddenlayer_sdk import ...' will break.fixChange imports to 'from hiddenlayer import ...'.
affects: <3.0.0 -> >=3.0.0
deprecatedThe 'HiddenLayerApiKey' environment variable is deprecated. Use 'HIDDENLAYER_API_KEY' instead.fixSet 'HIDDENLAYER_API_KEY' environment variable.
affects: >=3.0.0
gotchaThe SDK requires Python >= 3.9. If using Python 3.8 or older, installation will fail.fixUpgrade Python to 3.9 or later.
affects: >=3.0.0
gotchaWhen using async client, ensure you use the correct async context manager. Forgetting to await client.close() may cause resource leaks.fixAlways use 'async with HiddenLayerAsync(...) as client:' or explicitly await client.close().
affects: >=3.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'hiddenlayer_sdk'
The package is installed as 'hiddenlayer-sdk', but the import module is 'hiddenlayer' (not 'hiddenlayer_sdk').
fixUse 'from hiddenlayer import HiddenLayer' instead of 'from hiddenlayer_sdk import HiddenLayer'.
ImportError: cannot import name 'HiddenLayer' from 'hiddenlayer' (unknown location)
The package may not be installed, or you are running in an environment where it's not available.
fixRun 'pip install hiddenlayer-sdk' to install the package.
AttributeError: 'NoneType' object has no attribute 'get'
Environment variables HIDDENLAYER_API_KEY or HIDDENLAYER_BASE_URL are not set, causing client to fail.
fixSet the environment variables before creating the client: HIDDENLAYER_API_KEY and HIDDENLAYER_BASE_URL.
Upgrade
Version history
3.7.1latest on PyPI · released May 14, 2026
Audit
Dependencies
httpxrequiredUsed for HTTP client. v3.x requires httpx >= 0.21.0
pydanticrequiredUsed for data validation. v3.x requires pydantic >= 2.0.0