{"id":21656,"library":"openlayer","title":"Openlayer Python SDK","description":"The official Python SDK for the Openlayer API. Provides tools to monitor, debug, and improve AI models with tracing, observability, and data management. Current version: 0.24.0. Release cadence: weekly to multiple times per week.","status":"active","version":"0.24.0","language":"python","source_language":"en","source_url":"https://github.com/openlayer-ai/openlayer-python","tags":["ai","monitoring","observability","llm","tracing"],"install":[{"cmd":"pip install openlayer","lang":"bash","label":"default install"}],"dependencies":[{"reason":"Used for data validation; must be >=2.10 for compatibility (handling by_alias=None).","package":"pydantic","optional":false},{"reason":"Minimum version required for type hints.","package":"typing-extensions","optional":false}],"imports":[{"note":"Openlayer is the main client class, not a module.","wrong":"import openlayer","symbol":"Openlayer","correct":"from openlayer import Openlayer"},{"note":"","wrong":"","symbol":"Trace","correct":"from openlayer import Trace"}],"quickstart":{"code":"from openlayer import Openlayer\n\nclient = Openlayer(api_key=os.environ.get('OPENLAYER_API_KEY', ''))\n# Example: create a trace\ntrace = client.traces.create(\n    project_id='your-project-id',\n    model_id='your-model-id',\n    input='What is the capital of France?',\n    output='Paris'\n)\nprint(trace.id)","lang":"python","description":"Initialize the client and create a trace."},"warnings":[{"fix":"Always pass api_key=os.environ.get('OPENLAYER_API_KEY') explicitly.","message":"In 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.","severity":"breaking","affected_versions":">=0.20.0"},{"fix":"Use named arguments: client.traces.create(project_id='...', model_id='...').","message":"The `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.","severity":"deprecated","affected_versions":">=0.19.0 <0.19.0? Actually, breaking change introduced at 0.19.0."},{"fix":"Run: pip install 'openlayer>=0.20.1'","message":"Pydantic 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.","severity":"gotcha","affected_versions":"<=0.20.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run: pip install openlayer","cause":"The package is not installed, or installed in a different environment.","error":"ModuleNotFoundError: No module named 'openlayer'"},{"fix":"Use: client.traces.create(project_id='...', model_id='...')","cause":"Using old positional argument style with new SDK version (>=0.19.0).","error":"TypeError: create() missing 2 required positional arguments: 'project_id' and 'model_id'"},{"fix":"Set OPENLAYER_API_KEY in your environment or pass api_key explicitly.","cause":"Missing or incorrect API key. The OPENLAYER_API_KEY environment variable is not set, or the key is wrong.","error":"openlayer.OpenlayerError: Authentication failed. Invalid API key."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}