signals

Get the model spend of many runs at once

Return what each requested SignalScoutRun spent on model calls, summed from the $ai_generation events its sandbox produced. One query for the whole batch, cached per run: a settled run's total is final, a run still in progress reports what it has spent so far. available is false where the internal AI observability project holding those events can't be read, so an unknown cost never reads as zero. Staff-only — fleet spend is an internal operating number, and the events sit outside the project in the path. Strictly team-scoped — run ids belonging to another project contribute no rows.

post/api/projects/{project_id}/signals/scout/runs/token-costs/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/signals/scout/runs/token-costs/
  • Auth: one of:
    • HTTP bearer
    • 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

run_idsstring[] required

UUIDs of the SignalScoutRun rows to resolve in one batch. Run ids belonging to another team are silently ignored (they contribute no rows) rather than failing the whole request. Capped at 200 ids per call.

Response

Model spend for each requested run that exists on this project.

availableboolean required

False when this deployment has no internal AI observability project to read the generations from, so costs is empty and every cost is unknown rather than zero.

Changes

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