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

# OpenLIT

> Monitor AI Sonar OpenAI-compatible requests with OpenLIT

## Overview

OpenLIT instruments the official OpenAI SDKs, so AI Sonar requests can be monitored by configuring the SDK client with AI Sonar'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 API_KEY="sk-your-api-key"
```

## Example

```python theme={null}
import os

import openlit
from openai import OpenAI

openlit.init()

client = OpenAI(
    api_key=os.environ["API_KEY"],
    base_url="https://api.aisonar.dev/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 AI Sonar-native calls depend on whether your OpenLIT/OpenTelemetry setup captures that SDK method or HTTP client.
