Vision

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

POST
GET
POST

Create vision scanners estimate

Estimate the observation volume a proposed scanner would generate, for the pre-save cost preview.

Required API key scopes

replay_scanner:readsession_recording:read

Request parameters

  • query
  • sampling_rate
    number
    Default: 1
  • sampling_mode
    Default: comprehensive
  • scanner_id
    stringnull
  • model
    Default: gemini-3-flash-preview

Response


Example request

POST /api/projects/:project_id/vision/scanners/estimate
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/vision/scanners/estimate/\
-d query=undefined

Example response

Status 200
RESPONSE
{
"matched_sessions_in_window": 0,
"window_days": 0,
"estimated_observations_per_month": 0,
"credits_per_observation": 0,
"estimated_credits_per_month": 0,
"other_enabled_scanners_monthly_credits": 0,
"sampling_rate": 0.1
}

Retrieve vision scanners stats

Team-wide scanner counts — independent of list filters, so the overview stays stable.

Required API key scopes

replay_scanner:read

Response


Example request

GET /api/projects/:project_id/vision/scanners/stats
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/vision/scanners/stats/

Example response

Status 200
RESPONSE
{
"total": 0,
"enabled": 0,
"by_type": {
"monitor": {
"enabled": 0,
"total": 0
},
"classifier": {
"enabled": 0,
"total": 0
},
"scorer": {
"enabled": 0,
"total": 0
},
"summarizer": {
"enabled": 0,
"total": 0
}
}
}

Create vision scanners suggest tags

Suggest classifier tags grounded in the scanner's own observations and the org's product data.

Required API key scopes

replay_scanner:readsession_recording:read

Request parameters

  • prompt
    string
  • tags
    array
  • multi_label
    boolean
    Default: true
  • allow_freeform_tags
    boolean
    Default: false
  • scanner_id
    stringnull

Response


Example request

POST /api/projects/:project_id/vision/scanners/suggest_tags
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/vision/scanners/suggest_tags/\
-d prompt="string"

Example response

Status 200
RESPONSE
{
"suggestions": [
{
"tag": "string",
"rationale": "string",
"source": "observed"
}
]
}

Community questions

Questions about this page? or post a community question.