What are Sessions?
Sessions allow you to group related LLM requests together to understand multi-turn conversations, user workflows, and sequential operations. Track the entire journey of a user interaction across multiple API calls.Why Use Sessions?
Conversation Tracking
Group chat messages to analyze full conversations
Workflow Monitoring
Track multi-step AI workflows from start to finish
User Journeys
Understand how users navigate through your AI features
Cost Analysis
Calculate total costs for entire sessions
Session Headers
Add session headers to your requests to group them:Required Headers
string
required
Unique identifier for the session. Use the same ID for all requests in a session.
Optional Headers
string
Human-readable name for the session (e.g., “Customer Support Chat”, “Travel Planner”)
string
Path or step within the session (e.g., “/booking/flight/search”, “/chat/message/3”)
Basic Example
Multi-Step Workflow Example
Track complex workflows across multiple steps:Viewing Sessions
Access your sessions in the dashboard:1
Navigate to Sessions
Go to the Sessions page in your Helicone dashboard
2
View Session List
See all sessions with metrics: total cost, request count, duration, success rate
3
Click a Session
View all requests in the session, organized by path/timestamp
4
Analyze Patterns
Identify common flows, drop-off points, and expensive operations
Session Analytics
Helicone provides rich analytics for sessions:Aggregate Metrics
- Total Cost: Sum of all request costs in the session
- Request Count: Number of requests in the session
- Duration: Time from first to last request
- Average Latency: Mean latency across all requests
- Success Rate: Percentage of successful requests
Per-Session Metrics
Session API
Query Sessions
Fetch sessions with filters and metrics
Session Metrics
Get aggregate metrics for sessions
Best Practices
Generate Unique Session IDs
Generate Unique Session IDs
Use UUIDs or unique identifiers for session IDs. Don’t reuse session IDs across different conversations.
Use Descriptive Session Names
Use Descriptive Session Names
Give sessions meaningful names that describe the workflow or conversation type:
- Good: “Customer Support Chat”, “Recipe Generator”
- Bad: “Session 1”, “Test”
Track Session Paths
Track Session Paths
Use paths to track progress through multi-step workflows:
Combine with User IDs
Combine with User IDs
Track both session and user to understand per-user session patterns:
Session Duration
Session Duration
Keep sessions focused on a single conversation or workflow. Start a new session for unrelated interactions.
Common Use Cases
- Chatbots
- Multi-Step Agents
- User Onboarding
Track complete conversations from greeting to resolution:
Next Steps
Distributed Tracing
Track parent-child relationships between requests
Custom Properties
Add metadata to sessions
User Metrics
Combine sessions with user tracking
Request Logging
Learn about individual request logging