> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenLIT

> Monitor TokenLab OpenAI-compatible requests with OpenLIT

## Overview

OpenLIT instruments the official OpenAI SDKs, so TokenLab requests can be monitored by configuring the SDK client with TokenLab's `/v1` base URL.

<Note>
  **Type**: Observability

  **Primary Path**: OpenAI SDK instrumentation

  **Support Confidence**: Supported OpenAI-compatible observability path
</Note>

## Installation

```bash theme={null}
pip install openlit openai
```

## Environment

```bash theme={null}
export TOKENLAB_API_KEY="sk-your-tokenlab-key"
```

## Example

```python theme={null}
import os

import openlit
from openai import OpenAI

openlit.init()

client = OpenAI(
    api_key=os.environ["TOKENLAB_API_KEY"],
    base_url="https://api.tokenlab.sh/v1",
)

response = client.chat.completions.create(
    model="claude-sonnet-5",
    messages=[{"role": "user", "content": "Hello from OpenLIT"}],
)
```

## Endpoint Notes

OpenLIT follows the SDK instrumentation path. Chat Completions is the safest integration surface; other TokenLab-native calls depend on whether your OpenLIT/OpenTelemetry setup captures that SDK method or HTTP client.
