llm_analytics

Trigger a new clustering workflow run.

This endpoint validates the request parameters and starts a Temporal workflow to perform trace clustering with the specified configuration.

post/api/projects/{project_id}/llm_analytics/clustering_runs/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/llm_analytics/clustering_runs/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request body

lookback_daysinteger

Number of days to look back for traces

max_samplesinteger

Maximum number of traces to sample for clustering

embedding_normalization'none' | 'l2'
  • none - none
  • l2 - l2
dimensionality_reduction_method'none' | 'umap' | 'pca'
  • none - none
  • umap - umap
  • pca - pca
dimensionality_reduction_ndimsinteger

Target dimensions for dimensionality reduction (ignored if method is 'none')

clustering_method'hdbscan' | 'kmeans'
  • hdbscan - hdbscan
  • kmeans - kmeans
min_cluster_size_fractionnumber double

Minimum cluster size as fraction of total samples (e.g., 0.02 = 2%)

hdbscan_min_samplesinteger

HDBSCAN min_samples parameter (higher = more conservative clustering)

kmeans_min_kinteger

Minimum number of clusters to try for k-means

kmeans_max_kinteger

Maximum number of clusters to try for k-means

run_labelstring

Optional label/tag for the clustering run (used as suffix in run_id for tracking experiments)

visualization_method'umap' | 'pca' | 'tsne'
  • umap - umap
  • pca - pca
  • tsne - tsne
event_filtersobject[]

Property filters to scope which traces are included in clustering (PostHog standard format)

clustering_job_idstring uuid nullable

If provided, use this clustering job's analysis_level and event_filters instead of request params

Response

lookback_daysinteger

Number of days to look back for traces

max_samplesinteger

Maximum number of traces to sample for clustering

embedding_normalization'none' | 'l2'
  • none - none
  • l2 - l2
dimensionality_reduction_method'none' | 'umap' | 'pca'
  • none - none
  • umap - umap
  • pca - pca
dimensionality_reduction_ndimsinteger

Target dimensions for dimensionality reduction (ignored if method is 'none')

clustering_method'hdbscan' | 'kmeans'
  • hdbscan - hdbscan
  • kmeans - kmeans
min_cluster_size_fractionnumber double

Minimum cluster size as fraction of total samples (e.g., 0.02 = 2%)

hdbscan_min_samplesinteger

HDBSCAN min_samples parameter (higher = more conservative clustering)

kmeans_min_kinteger

Minimum number of clusters to try for k-means

kmeans_max_kinteger

Maximum number of clusters to try for k-means

run_labelstring

Optional label/tag for the clustering run (used as suffix in run_id for tracking experiments)

visualization_method'umap' | 'pca' | 'tsne'
  • umap - umap
  • pca - pca
  • tsne - tsne
event_filtersobject[]

Property filters to scope which traces are included in clustering (PostHog standard format)

clustering_job_idstring uuid nullable

If provided, use this clustering job's analysis_level and event_filters instead of request params

Changes

No recorded changes to this operation across all 1 revision of this API.