Overview
The Query Sessions endpoint allows you to retrieve session data with powerful filtering capabilities. Sessions group related requests together, enabling you to track conversations, multi-step workflows, or any sequence of API calls.Request Parameters
string
Search term to filter sessions by session ID or session name (case-insensitive)
object
required
string
Filter sessions by exact session name match
number
required
Timezone offset in minutes from UTC
object
required
Advanced filter node for complex queries. Can be a filter leaf, filter branch, or βallβ to match all sessions.
number
default:"0"
Number of sessions to skip for pagination
number
default:"50"
Maximum number of sessions to return (max: 1000)
Response Fields
array
Array of session objects
string
Unique identifier for the session
string
Human-readable name for the session
string
ISO 8601 timestamp of when the session was created
string
ISO 8601 timestamp of the most recent request in this session
number
Total cost of all requests in the session (in USD)
number
Number of requests in the session
number
Total prompt tokens used across all requests
number
Total completion tokens generated across all requests
number
Sum of prompt and completion tokens
number
Average latency across all requests in milliseconds
array
Array of unique user IDs associated with this session
Example Request
Example Response
Filtering Sessions
You can use thefilter parameter to create complex queries:
Filter by session properties
Combine multiple filters
Use Cases
- Track conversations: Monitor multi-turn chat sessions
- Analyze workflows: Group related API calls together
- Cost monitoring: Track spending per session
- Performance analysis: Measure session duration and latency
- User analytics: Understand user behavior across sessions
