Skip to main content

1. Get API Keys

Create API Keys either with TraceRoot Cloud or Self-Hosting.

2. Install the SDK

pip install traceroot

3. Set Environment Variables

.env
TRACEROOT_API_KEY=your-api-key
TRACEROOT_HOST_URL=https://app.traceroot.ai  # or your self-hosted URL

4. Instrument Your Code

Add a single line at the start of your application to instrument all OpenAI API calls.
import traceroot
from traceroot import Integration
from openai import OpenAI

# This single line instruments all OpenAI API calls
traceroot.initialize(integrations=[Integration.OPENAI])

client = OpenAI()
For full SDK details, see the Python SDK.

5. View Your Traces

Open TraceRoot Cloud (or your self-hosted dashboard), navigate to your project, and you’ll see the full span hierarchy, token usage, cost, and timing.

What’s Next?

Python SDK

Full API reference for decorators, spans, and configuration.

AI Agent

Auto-debug failing traces with the built-in AI agent.