Skip to main content

bentolabs-sdk

Official BentoLabs Python SDK. A drop-in OpenTelemetry span processor that ships traces to the BentoLabs ingest API over OTLP/HTTP+JSON.

Status: 0.2.0. Stable surface for api_key / base_url resolution and OTel ingest, plus the higher-level analytics convenience layer.

Two layers

This package ships two surfaces. Pick whichever fits:

  • Analytics convenience layer (bentolabs_sdk.analytics) — Raindrop-shaped functions (init, track_ai, flush, shutdown). You don't manage the OTel pipeline yourself; just call bento.track_ai(...) and data lands in your dashboard. Start here: INTEGRATION.md — one-pager covering every kwarg, the dashboard feature it powers, and common mistakes.
  • OTel transport (BentoLabsSpanProcessor, BentoLabsTraceExporter) — wire the SDK into your existing OpenTelemetry pipeline. The rest of this README covers it.

Install

pip install bentolabs-sdk opentelemetry-api opentelemetry-sdk

Usage

from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider

from bentolabs_sdk import BentoLabsSpanProcessor

provider = TracerProvider()
provider.add_span_processor(BentoLabsSpanProcessor())
trace.set_tracer_provider(provider)

tracer = trace.get_tracer("example")
with tracer.start_as_current_span("agent.run") as span:
    span.set_attribute("input.value", "Summarize the incident")
    span.set_attribute("output.value", "The incident is resolved.")

provider.force_flush()
provider.shutdown()

The processor batches spans with OpenTelemetry defaults and POSTs them to ${base_url}/v1/traces with Authorization: Bearer bl_pk_.... The bl_pk_ prefix is validated up front.

Configuration

from bentolabs_sdk import resolve_options

cfg = resolve_options()
Field Resolution order
api_key explicit argument -> BENTOLABS_API_KEY -> raises BentoAuthError
base_url explicit argument -> BENTOLABS_BASE_URL -> https://api.bentolabs.ai
from bentolabs_sdk import BentoAuthError, BentoLabsSpanProcessor

try:
    processor = BentoLabsSpanProcessor(base_url="http://localhost:8080")
except BentoAuthError as exc:
    if exc.code == "missing_api_key":
        # telemetry disabled or misconfigured
        pass
    raise

Requirements

  • Python 3.10+

License

Proprietary. Copyright (c) 2026 BentoLabs, Inc. All rights reserved. Use is governed by your written agreement with BentoLabs, Inc.

Metadata

Release files for bentolabs-sdk 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bentolabs-sdk 0.2.1
File Size Uploaded Provenance Actions
bentolabs_sdk-0.2.1.tar.gz 72.2 kB Without provenance Details for bentolabs_sdk-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bentolabs-sdk 0.2.1
File Interpreter ABI Platform Actions
bentolabs_sdk-0.2.1-py3-none-any.whl Python 3 none any Details for bentolabs_sdk-0.2.1-py3-none-any.whl

Total release size: 101.9 kB

Release files / bentolabs_sdk-0.2.1.tar.gz

Download URL bentolabs_sdk-0.2.1.tar.gz
Size 72.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0e6c7fa392360e04ce17e36512602f6f66e04ea5a40551458fb7b078f4db62f3
BLAKE2b-256 checksum
How to use checksums
aaabd902c56d03fddbfcdcda313da0ac923d1a82f98824ccc87fac47fa627286
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / bentolabs_sdk-0.2.1-py3-none-any.whl

Download URL bentolabs_sdk-0.2.1-py3-none-any.whl
Size 29.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a067fe6c4d99948a7acb6b930fc1c88e06804da1e237c6663a7b515e0f63bd1
BLAKE2b-256 checksum
How to use checksums
7fa79d5108432401d83cb4e5d3f8d5e94fe93ddce36133bacdb888a6d26d207a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for bentolabs-sdk 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page