Skip to main content
Query your trace data programmatically using the HoneyHive SDK. This is useful for building custom analytics, exporting data for fine-tuning, or integrating with external systems.

Query Parameters

EventFilter Fields

Setup

Reading events needs HoneyHive Python SDK 1.9.0 or later and a data plane key with the project.event.get permission. Go to Settings > Project > API Keys and open the Data Plane tab. Click Create API Key, name the key, set an expiration, and select the permissions this guide lists. Copy the key from the dialog, because it is shown only once, and store it as HH_DATA_PLANE_API_KEY. Then copy the Project ID from the same tab and store it as PROJECT_ID. See API Keys for how data plane keys work.
The response object (result) uses attribute access (e.g., result.total_events, result.events), while individual events are returned as dictionaries (e.g., event['event_name']).

Query Model Events

Retrieve all LLM model events from your project:

Query Events in a Session

Get all events belonging to a specific trace/session:

Query Sessions

Get session-level data (root events only):

Filter by Evaluator Score

Query events that have a specific evaluator score:

Filter by User Feedback

Query events with specific user feedback:

Filter by Metadata

Query events by custom metadata fields:

Filter by Date Range

Query events within a specific time period:

Available Filter Operators

Common Filterable Fields

Session events include aggregated metadata like num_events, cost, total_tokens. See Session Aggregations for details.

Export Timeouts and Retries

Export operations (export(), export_async(), and get_events()) use a default read timeout of 300 seconds to handle large result sets. You can override this with the HH_EXPORT_TIMEOUT_SECONDS environment variable:
The SDK reads the environment variable once, when honeyhive is imported, so set it before that import. The timeout value must be a positive number (in seconds). If an invalid value is provided, the SDK falls back to the default of 300 seconds.
The export_async() method automatically retries on transient HTTP errors (502, 503, 504), matching the behavior of export().