Skip to main content
The replay module lets you look inside completed agent runs, compare two runs side-by-side, and re-execute a past run with different configuration — all without touching trace files manually.

Quick Example

Inspecting a Run

Build a Replay from any of these sources:

Replay Fields

ReplayTokens

ToolCallRecord

Comparing Runs

Compare two runs to see what changed:

ReplayComparison Fields

You can also use compare_runs directly:

Re-Executing with Overrides

Pass override arguments to replay() to re-run the same input with different configuration. This returns a new RunOutput instead of a Replay:
Re-execution makes a live API call. The original input is extracted from the replay and sent to the model with your overrides applied.

Async API

All replay methods have async equivalents:
compare() and compare_runs() are synchronous (no I/O involved).

Construction Methods

Tracing

Configure JSONL trace export for replay sources.

Cost Tracking

Understand token metrics and pricing used in comparisons.