openlayer
The official Python library for the openlayer API
What it is and what it does
Openlayer is the official Python client library for the Openlayer REST API, generated using Stainless. It wraps Openlayer's inference pipeline and project management endpoints in a typed, ergonomic interface. The library provides both Openlayer (synchronous) and AsyncOpenlayer (asynchronous) clients, both powered by httpx, with full type hints for request parameters and response objects via Pydantic models and TypedDicts.
The library is designed for developers integrating Openlayer's monitoring and data-streaming capabilities into Python applications. It handles authentication via API key, includes automatic retry logic for transient failures (connection errors, timeouts, rate limits, and 5xx responses), and offers helper methods on response objects for JSON serialization and dictionary conversion. Async usage is straightforward: import AsyncOpenlayer, use await on API calls, and optionally swap the HTTP backend to aiohttp for improved concurrency.
Use it for:
- Stream inference pipeline data (inputs, outputs, tokens, costs, timestamps) to Openlayer for monitoring and analysis.
- Create and manage project commits programmatically to track model and prompt changes over time.
- Build async data pipelines that batch-upload inference results without blocking application logic.
- Integrate Openlayer monitoring into existing Python ML workflows with full IDE autocomplete and type checking.
- Handle API errors gracefully with typed exception hierarchy (APIConnectionError, RateLimitError, APIStatusError subclasses).
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a typed Python client for the Openlayer REST API, supporting both synchronous and asynchronous access to inference pipeline data and project management endpoints.
Yes. The library is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive Apache-2.0 license. It is the official client for Openlayer's API and is essential if you need to integrate Openlayer monitoring into a Python application. The typed interface, async support, and automatic retries make it production-ready.
Install
openlayer on PyPI
pip
pip install openlayeruv
uv add openlayerpoetry
poetry add openlayerInstalling openlayer
Before you install
Low install friction; pure Python wheel with 12 runtime dependencies including httpx, pydantic, and pandas. Actively maintained with a release 10 days old and recent commits. Supports Python 3.9 through 3.14.
License in practice
Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions—suitable for most production and proprietary projects.
Quickstart
pip install openlayer
import os
from openlayer import Openlayer
client = Openlayer(api_key=os.environ.get("OPENLAYER_API_KEY"))
response = client.inference_pipelines.data.stream(
inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
config={"input_variable_names": ["user_query"], "output_column_name": "output"},
rows=[{"user_query": "test", "output": "result"}]
)
print(response.success)
Requires OPENLAYER_API_KEY environment variable or explicit api_key parameter; Python 3.9 or later.
Verify before relying
- Whether the library's retry behavior (2 retries by default for connection/timeout/429/5xx errors) is configurable beyond max_retries setting.
- Performance characteristics when streaming large datasets through inference_pipelines.data.stream().
- Whether aiohttp integration (optional extra) provides measurable concurrency improvements over default httpx backend.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 12 — anyio, distro, httpx, pandas, pyarrow, pydantic, pyyaml, requests-toolbelt, sniffio, tqdm, typing-extensions, wrapt |
| Maintenance | actively maintained — 10 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 200,517/month — #9,691 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: openlayer-0.31.2-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
opencode-aiProvides a Python client library for the…
permissive · top 15,000 on PyPI
agentex-clientProvides a typed Python REST client for the…
permissive · top 15,000 on PyPI
composio-clientA Python client library for the Composio REST…
permissive · top 5,000 on PyPI
modern-treasuryProvides a typed Python client library for the…
permissive · top 15,000 on PyPI
runloop_api_clientA Python client library for the Runloop REST…
permissive · top 5,000 on PyPI
supermemoryProvides a Python client library for the…
permissive · top 15,000 on PyPI
bilibili-api-pythonProvides async Python bindings for Bilibili's…
copyleft · top 15,000 on PyPI
hiddenlayer-sdkProvides a typed Python client for the…
permissive · top 15,000 on PyPI
pipedreamProvides a Python client library for accessing…
unclear · top 15,000 on PyPI
llama-stack-clientPython client library for interacting with…
permissive · top 15,000 on PyPI