Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.bentolabs.ai/llms.txt

Use this file to discover all available pages before exploring further.

Requirements

  • Python 3.10 or higher

Install

pip install bentolabs-sdk
The analytics layer (bentolabs_sdk.analytics) brings its own OpenTelemetry dependencies. You don’t need to install opentelemetry-api or opentelemetry-sdk separately unless you want to use the lower-level OTel transport.

Set your API key

Sign in at platform.bentolabs.ai and create a workspace. Copy the API key from settings. Keys start with bl_pk_ and the prefix is validated by the SDK, so a clearly-bad key fails before any network request goes out.
export BENTOLABS_API_KEY="bl_pk_..."
Prefer setting the key via environment variable in production. For local development or notebooks, pass it explicitly via bento.init(api_key=...).

Verify your install

import bentolabs_sdk.analytics as bento

bento.track_ai(
    event="hello_world",
    user_id="test_user",
    input="ping",
    output="pong",
    model="claude-3-5-sonnet-20241022",
    provider="anthropic",
    convo_id="conv_test",
)

bento.flush()
Run the script, then check your dashboard. You should see one trace within seconds.

What’s next

Configuration

Env vars, init(), and lifecycle hooks.

track_ai

The full event API.