skillfed

hiddenlayer-sdk

The official Python library for the hiddenlayer API

hiddenlayer-sdk v3.9.0 96.1K downloads/30d#13,231 on PyPI4
Permissive license Apache-2.0 Active released

What it is and what it does

hiddenlayer-sdk is an official Python client library for the HiddenLayer REST API, generated using Stainless. It wraps HiddenLayer's security and AI analysis endpoints with full type hints, Pydantic models for responses, and TypedDict for request parameters. The library ships both synchronous (HiddenLayer) and asynchronous (AsyncHiddenLayer) clients, both backed by httpx for HTTP transport.

It is designed for developers integrating HiddenLayer's security analysis into Python applications. The package handles authentication via bearer token, supports multiple environments (prod-us, prod-eu), and includes auto-paginating iterators for list endpoints. Error handling distinguishes between connection failures (APIConnectionError), rate limits (RateLimitError), and HTTP status errors (APIStatusError). Type definitions enable IDE autocomplete and early error detection.

Use it for:

  • Integrate HiddenLayer's model interaction analysis into a Python application to detect security risks in LLM inputs and outputs.
  • Build a monitoring service that periodically calls HiddenLayer's API to analyze model behavior and log results.
  • Implement async batch analysis of multiple model interactions using AsyncHiddenLayer for concurrent API requests.
  • Fetch and iterate through paginated lists of model cards or analysis results without manual page-handling logic.
  • Catch and handle API errors (rate limits, auth failures, connection issues) with specific exception types in production workflows.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a typed Python client for the HiddenLayer REST API, with both synchronous and asynchronous interfaces powered by httpx.

Yes. The package is actively maintained (released 4 days ago), has no known vulnerabilities, low install friction, and is the official SDK for HiddenLayer's API. Use it if you need to integrate HiddenLayer's security analysis into a Python application. The permissive Apache-2.0 license and broad Python version support make adoption straightforward.

Install

hiddenlayer-sdk on PyPI

pip

pip install hiddenlayer-sdk

uv

uv add hiddenlayer-sdk

poetry

poetry add hiddenlayer-sdk

Installing hiddenlayer-sdk

Before you install

Low friction: pure Python wheel with no compiled dependencies. Active maintenance—last commit 2026-08-13, released 4 days ago. Supports Python 3.9 through 3.14.

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install hiddenlayer-sdk

from hiddenlayer import HiddenLayer

client = HiddenLayer(environment="prod-eu")
response = client.interactions.analyze(
    metadata={"model": "gpt-4", "requester_id": "user-id"},
    input={"messages": [{"role": "user", "content": "hello"}]}
)
print(response.analysis)

Requires HIDDENLAYER_TOKEN environment variable or explicit bearer_token; Python 3.9 or later.

Verify before relying

  • Whether the monthly downloads reflect active production use or test/CI installations.
  • What specific HiddenLayer API endpoints and features are covered by this SDK version.
  • Whether Beta APIs marked in the documentation carry breaking-change risk for production deployments.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 9 — anyio, distro, httpx, pydantic, requests-auth, requests, sniffio, types-requests, typing-extensions
Maintenance actively maintained — 4 days since the last release
Last repo commit
First released
Downloads 96,097/month — #13,231 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: hiddenlayer_sdk-3.9.0-py3-none-any.whl

Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIXOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

hiddenlayer api clientpython rest api clientasync http client librarytyped api wrapperhiddenlayer sdkapi security integrationpydantic typed requests
rest-api-clientasync-supporttype-hints

More Python Modules packages