engineering_analytics
engineering_analytics

Estimated CI cost for a pull request, summed over the jobs of all its workflow runs. Billable self-hosted Linux runners only: provider-hosted (free GitHub-hosted) and non-Linux jobs are excluded. Every figure is zero/null with jobs_available false when the job-level source isn't synced yet. llm_spend carries the agent LLM token spend attributed to the PR by git branch, or null when no $ai_generation event matched.

get/api/projects/{project_id}/engineering_analytics/pr_cost/

Request

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

Query parameters

pr_numberinteger required

Pull request number to estimate cost for.

repostring required

'owner/name' repository the pull request belongs to.

source_idstring uuid

Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.

Response

jobs_availableboolean required

False when the job-level source (github_workflow_jobs) isn't synced: every figure is then zero/null and the cost cards should be hidden.

billable_minutesnumber double required

Billable CI minutes: each costed (self-hosted) job's elapsed time, summed. Parallel jobs add up, so this is compute time spent, not wall-clock run duration.

estimated_cost_usdnumber double nullable required

Estimated dollar cost (sum of per-job estimates: elapsed x tier multiplier x reference rate). Null when no job was costable.

costed_jobsinteger required

Jobs counted in the estimate (billable Linux runner, finished).

unsettled_jobsinteger required

Billable Linux jobs still queued/running (no elapsed): excluded from the estimate.

excluded_jobsinteger required

Jobs on provider-hosted (GitHub-hosted, free) or non-Linux runners: outside the estimate.

Changes

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