--- id: openlayer version: "0.31.2" license: Apache-2.0 license_treatment: permissive maintenance: active --- # openlayer — The official Python library for the openlayer API License: permissive · Maintenance: active · Downloads: 200.5K/mo ## 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 above — 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 pip install openlayer uv add openlayer poetry add openlayer ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 200.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags openlayer api client python, inference pipeline data streaming, async rest api client, typed api wrapper, ml monitoring api access, project commit management, httpx-based api client, api-client, async-support, ml-monitoring [View on SkillFed](https://skillfed.io/packages/openlayer) · [View on PyPI](https://pypi.org/project/openlayer/)