vision

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

post/api/projects/{project_id}/vision/scanners/estimate/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/vision/scanners/estimate/
  • 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

queryunknown
sampling_ratenumber double

0..1 downsample applied to matched sessions. Defaults to 1.0 (no downsampling).

sampling_mode'focused' | 'balanced' | 'comprehensive'
  • focused - Focused
  • balanced - Balanced
  • comprehensive - Comprehensive
scanner_idstring uuid nullable

The scanner being edited, excluded from other_enabled_scanners_monthly_credits so its stored estimate isn't double-counted in the forecast. Omit (or null) when estimating a brand-new scanner.

model'gemini-3.5-flash-lite' | 'gemini-3-flash-preview' | 'gemini-3.8-flash'
  • gemini-3.5-flash-lite - Gemini 3.5 Flash Lite
  • gemini-3-flash-preview - Gemini 3 Flash
  • gemini-3.8-flash - Gemini 3.8 Flash

Response

matched_sessions_in_windowinteger required

Distinct sessions matching the query within the scanned window (window_days), after the sampling_mode quality filter but before random sampling.

window_daysinteger required

Days of recordings the estimate scanned before scaling to 30. Up to a week (shorter when the query's operand rules out sampling); smaller when the team has fewer days of recordings.

estimated_observations_per_monthinteger required

Projected monthly observations: quality-filtered matched sessions scaled from window_days to 30 days, times sampling_rate.

credits_per_observationinteger required

Credits one observation costs at the proposed model (1 credit = $0.01).

estimated_credits_per_monthinteger required

estimated_observations_per_month priced at credits_per_observation.

other_enabled_scanners_monthly_creditsinteger required

Credit-weighted projected monthly spend of the org's other enabled scanners (excluding scanner_id), from their cached estimates. Read from the same snapshot as this estimate so the forecast can't double-count the edited scanner.

active_backfill_creditsinteger required

Committed-but-unspent credits of the org's active backfills, the same figure the quota snapshot's projection carries. A one-off charge rather than a monthly rate, so the forecast shows it as its own segment instead of adding it to a per-month total.

sampling_ratenumber double required

Sampling rate applied to the projection. Echoed from the request.

Changes

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