curl --request POST \
--url https://api.helicone.ai/v1/user/metrics/query \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"filter": {
"users_view": {
"user_user_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"user_active_for": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"user_first_active": {
"equals": "2023-11-07T05:31:56Z",
"gte": "2023-11-07T05:31:56Z",
"lte": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z",
"gt": "2023-11-07T05:31:56Z"
},
"user_last_active": {
"equals": "2023-11-07T05:31:56Z",
"gte": "2023-11-07T05:31:56Z",
"lte": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z",
"gt": "2023-11-07T05:31:56Z"
},
"user_total_requests": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"user_average_requests_per_day_active": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"user_average_tokens_per_request": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"user_total_completion_tokens": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"user_total_prompt_tokens": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"user_cost": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
}
},
"request_response_rmt": {
"country_code": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"latency": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"cost": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"provider": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"time_to_first_token": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"status": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"request_created_at": {
"equals": "2023-11-07T05:31:56Z",
"gte": "2023-11-07T05:31:56Z",
"lte": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z",
"gt": "2023-11-07T05:31:56Z"
},
"response_created_at": {
"equals": "2023-11-07T05:31:56Z",
"gte": "2023-11-07T05:31:56Z",
"lte": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z",
"gt": "2023-11-07T05:31:56Z"
},
"model": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"user_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"organization_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"node_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"job_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"threat": {
"equals": true
},
"request_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"prompt_tokens": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"completion_tokens": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"prompt_cache_read_tokens": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"prompt_cache_write_tokens": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"total_tokens": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"target_url": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"property_key": {
"equals": "<string>"
},
"properties": {},
"search_properties": {},
"scores": {},
"scores_column": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"request_body": {
"contains": "<string>"
},
"response_body": {
"contains": "<string>"
},
"cache_enabled": {
"equals": true
},
"cache_reference_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"cached": {
"equals": true
},
"assets": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"helicone-score-feedback": {
"equals": true
},
"prompt_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"prompt_version": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"request_referrer": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"is_passthrough_billing": {
"equals": true
}
}
},
"offset": 123,
"limit": 123,
"timeFilter": {
"endTimeUnixSeconds": 123,
"startTimeUnixSeconds": 123
},
"timeZoneDifferenceMinutes": 123,
"sort": {
"id": "asc",
"user_id": "asc",
"active_for": "asc",
"first_active": "asc",
"last_active": "asc",
"total_requests": "asc",
"average_requests_per_day_active": "asc",
"average_tokens_per_request": "asc",
"total_prompt_tokens": "asc",
"total_completion_tokens": "asc",
"cost": "asc",
"rate_limited_count": "asc"
}
}
'{
"data": {
"hasUsers": true,
"count": 123,
"users": [
{
"id": "<string>",
"user_id": "<string>",
"active_for": 123,
"first_active": "<string>",
"last_active": "<string>",
"total_requests": 123,
"average_requests_per_day_active": 123,
"average_tokens_per_request": 123,
"total_completion_tokens": 123,
"total_prompt_tokens": 123,
"cost": 123
}
]
},
"error": null
}Search and filter through user-specific metrics
curl --request POST \
--url https://api.helicone.ai/v1/user/metrics/query \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"filter": {
"users_view": {
"user_user_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"user_active_for": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"user_first_active": {
"equals": "2023-11-07T05:31:56Z",
"gte": "2023-11-07T05:31:56Z",
"lte": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z",
"gt": "2023-11-07T05:31:56Z"
},
"user_last_active": {
"equals": "2023-11-07T05:31:56Z",
"gte": "2023-11-07T05:31:56Z",
"lte": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z",
"gt": "2023-11-07T05:31:56Z"
},
"user_total_requests": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"user_average_requests_per_day_active": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"user_average_tokens_per_request": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"user_total_completion_tokens": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"user_total_prompt_tokens": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"user_cost": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
}
},
"request_response_rmt": {
"country_code": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"latency": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"cost": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"provider": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"time_to_first_token": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"status": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"request_created_at": {
"equals": "2023-11-07T05:31:56Z",
"gte": "2023-11-07T05:31:56Z",
"lte": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z",
"gt": "2023-11-07T05:31:56Z"
},
"response_created_at": {
"equals": "2023-11-07T05:31:56Z",
"gte": "2023-11-07T05:31:56Z",
"lte": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z",
"gt": "2023-11-07T05:31:56Z"
},
"model": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"user_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"organization_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"node_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"job_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"threat": {
"equals": true
},
"request_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"prompt_tokens": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"completion_tokens": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"prompt_cache_read_tokens": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"prompt_cache_write_tokens": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"total_tokens": {
"not-equals": 123,
"equals": 123,
"gte": 123,
"lte": 123,
"lt": 123,
"gt": 123
},
"target_url": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"property_key": {
"equals": "<string>"
},
"properties": {},
"search_properties": {},
"scores": {},
"scores_column": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"request_body": {
"contains": "<string>"
},
"response_body": {
"contains": "<string>"
},
"cache_enabled": {
"equals": true
},
"cache_reference_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"cached": {
"equals": true
},
"assets": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"helicone-score-feedback": {
"equals": true
},
"prompt_id": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"prompt_version": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"request_referrer": {
"not-equals": "<string>",
"equals": "<string>",
"like": "<string>",
"ilike": "<string>",
"contains": "<string>",
"not-contains": "<string>"
},
"is_passthrough_billing": {
"equals": true
}
}
},
"offset": 123,
"limit": 123,
"timeFilter": {
"endTimeUnixSeconds": 123,
"startTimeUnixSeconds": 123
},
"timeZoneDifferenceMinutes": 123,
"sort": {
"id": "asc",
"user_id": "asc",
"active_for": "asc",
"first_active": "asc",
"last_active": "asc",
"total_requests": "asc",
"average_requests_per_day_active": "asc",
"average_tokens_per_request": "asc",
"total_prompt_tokens": "asc",
"total_completion_tokens": "asc",
"cost": "asc",
"rate_limited_count": "asc"
}
}
'{
"data": {
"hasUsers": true,
"count": 123,
"users": [
{
"id": "<string>",
"user_id": "<string>",
"active_for": 123,
"first_active": "<string>",
"last_active": "<string>",
"total_requests": 123,
"average_requests_per_day_active": 123,
"average_tokens_per_request": 123,
"total_completion_tokens": 123,
"total_prompt_tokens": 123,
"cost": 123
}
]
},
"error": null
}eu.api.helicone.ai instead of
api.helicone.ai.Bearer token authentication. Format: 'Bearer YOUR_API_KEY'
From T, pick a set of properties whose keys are in the union K
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Show child attributes
Make all properties in T optional
Show child attributes
Show child attributes
Make all properties in T optional
Show child attributes
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Make all properties in T optional
Show child attributes
Show child attributes
asc, desc asc, desc asc, desc asc, desc asc, desc asc, desc asc, desc asc, desc asc, desc asc, desc asc, desc asc, desc Ok
Show child attributes
Show child attributes
Was this page helpful?