--- id: hiddenlayer-sdk version: "3.9.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # hiddenlayer-sdk — The official Python library for the hiddenlayer API License: permissive · Maintenance: active · Downloads: 96.1K/mo ## 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 above — 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 pip install hiddenlayer-sdk uv add hiddenlayer-sdk 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_current - Install friction: low - Maintenance: active - Downloads: 96.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags hiddenlayer api client, python rest api client, async http client library, typed api wrapper, hiddenlayer sdk, api security integration, pydantic typed requests, rest-api-client, async-support, type-hints [View on SkillFed](https://skillfed.io/packages/hiddenlayer-sdk) · [View on PyPI](https://pypi.org/project/hiddenlayer-sdk/)