Query your Helicone analytics data directly using SQL with row-level security and built-in limits
Helicone Query Language (HQL) lets you query your Helicone analytics data directly using SQL.
HQL is currently available to selected workspaces. If you don’t see the HQL page in your dashboard, click “Request Access” from the HQL screen or contact support.
SELECT toDate(request_created_at) AS day, COUNT(DISTINCT user_id) AS dauFROM request_response_rmtWHERE request_created_at >= toDateTime64(now(), 3) - INTERVAL 14 DAYGROUP BY dayORDER BY day
SELECT properties['Helicone-Session-Id'] AS session_id, COUNT(*) AS requests, sum(cost) AS total_costFROM request_response_rmtWHERE request_created_at >= toDateTime64(now(), 3) - INTERVAL 7 DAY AND properties['Helicone-Session-Id'] IS NOT NULLGROUP BY session_idORDER BY total_cost DESCLIMIT 100
HQL endpoints are namespaced under /v1/helicone-sql and require an authenticated request scoped to your organization.
Copy
Ask AI
curl -X POST "https://api.helicone.ai/v1/helicone-sql/execute" \ -H "Authorization: Bearer $HELICONE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "sql": "SELECT request_model, COUNT() AS c FROM request_response_rmt GROUP BY request_model ORDER BY c DESC LIMIT 50" }'