Install & Compatibility
Where this runs
tested against v0.29.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.988s · 362.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 14.3s · import 0.962s · 331MB
349MB installed
● package 349MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Openlayer
✓ from openlayer import Openlayer
✗ import openlayer
Openlayer is the main client class, not a module.
Trace
✓ from openlayer import Trace
Initialize the client and create a trace.
from openlayer import Openlayer
client = Openlayer(api_key=os.environ.get('OPENLAYER_API_KEY', ''))
# Example: create a trace
trace = client.traces.create(
project_id='your-project-id',
model_id='your-model-id',
input='What is the capital of France?',
output='Paris'
)
print(trace.id)
openlayer --version
Debug
Known issues
breakingIn v0.20.0, client initialization changed: the `api_key` parameter is now required (previously optional). Code that relied on environment variable auto-detection without passing it explicitly may break.fixAlways pass api_key=os.environ.get('OPENLAYER_API_KEY') explicitly. affects: >=0.20.0
deprecatedThe `openlayer.traces.create` method signature changed in v0.19.0: `project_id` and `model_id` became mandatory keyword-only arguments. Passing them as positional arguments will raise TypeError.fixUse named arguments: client.traces.create(project_id='...', model_id='...').
affects: >=0.19.0 <0.19.0? Actually, breaking change introduced at 0.19.0.
gotchaPydantic 2.10+ compatibility fix in v0.20.1: if you use Pydantic v2.10+ without updating openlayer, you may see AttributeError regarding 'by_alias'. Upgrade openlayer to >=0.20.1.fixRun: pip install 'openlayer>=0.20.1'
affects: <=0.20.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'openlayer'
The package is not installed, or installed in a different environment.
fixRun: pip install openlayer
TypeError: create() missing 2 required positional arguments: 'project_id' and 'model_id'
Using old positional argument style with new SDK version (>=0.19.0).
fixUse: client.traces.create(project_id='...', model_id='...')
openlayer.OpenlayerError: Authentication failed. Invalid API key.
Missing or incorrect API key. The OPENLAYER_API_KEY environment variable is not set, or the key is wrong.
fixSet OPENLAYER_API_KEY in your environment or pass api_key explicitly.
Upgrade
Version history
0.29.1latest on PyPI · released Jun 5, 2026
Audit
Dependencies
pydanticrequiredUsed for data validation; must be >=2.10 for compatibility (handling by_alias=None).
typing-extensionsrequiredMinimum version required for type hints.