> ## 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

> Überwachen Sie TokenLab OpenAI-kompatible Anfragen mit OpenLIT

## Übersicht

OpenLIT instrumentiert die offiziellen OpenAI SDKs, sodass TokenLab-Anfragen durch die Konfiguration des SDK-Clients mit der `/v1` Basis-URL von TokenLab überwacht werden können.

<Note>
  **Typ**: Observability

  **Primärer Pfad**: OpenAI SDK-Instrumentierung

  **Support-Vertrauen**: Unterstützter OpenAI-kompatibler Observability-Pfad
</Note>

## Installation

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

## Umgebung

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

## Beispiel

```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"}],
)
```

## Hinweise zu Endpunkten

OpenLIT folgt dem SDK-Instrumentierungspfad. Chat Completions ist die sicherste Integrationsschnittstelle; andere TokenLab-native Aufrufe hängen davon ab, ob Ihr OpenLIT/OpenTelemetry-Setup diese SDK-Methode oder den HTTP-Client erfasst.
