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

# Phoenix

> Trace TokenLab OpenAI-compatible requests with Arize Phoenix

## Overview

Phoenix can trace TokenLab requests by auto-instrumenting the OpenAI Python client configured with TokenLab's OpenAI-compatible base URL.

<Note>
  **Type**: Observability

  **Primary Path**: OpenAI SDK instrumentation

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

## Installation

```bash theme={null}
pip install arize-phoenix openinference-instrumentation-openai openai
```

## Environment

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

## Register Phoenix

```python theme={null}
from phoenix.otel import register

tracer_provider = register(
    project_name="tokenlab-app",
    auto_instrument=True,
)
```

## Call TokenLab

```python theme={null}
import os

from openai import OpenAI

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": "Write a short haiku."}],
)

print(response.choices[0].message.content)
```

## Endpoint Notes

Phoenix traces the OpenAI SDK call path. Use this page for Chat Completions style TokenLab calls. Other TokenLab native endpoints can still be traced if your application instrumentation captures the client you use for those requests.
