Skip to main content

Installation

Install RDK using pip or uv:

Basic Setup

1. Set your API key

2. Initialize and trace

Call init() to start tracing — all LLM calls are captured automatically:
Use @observe to group multiple calls into a single trace:

3. Shutdown gracefully

Flush remaining traces before your app exits:

Complete Example

Custom Configuration

Need custom settings? Call init() before your first @observe call:

Configuration Options

See init() for full documentation.

Environment Variables

What Gets Traced?

RDK automatically captures all LLM calls:
  • Token Usage — Prompt, completion, and total tokens
  • Cost — Calculated automatically based on model pricing
  • Timing — Start time, end time, and duration
  • Model Info — Model name and provider
  • Errors — Exception messages
Input messages and output content are not captured by default. Enable them with capture_input=True and capture_output=True on @observe.

Next Steps

Anthropic Integration

Set up Claude tracing

PII Redaction

Protect sensitive data

Testing

Write tests without real API calls

Synthetic Worlds

Simulate tool calls for fast iteration

API Reference

Full parameter reference