Dentrix Costs (Admin) API
Export Dentrix variable-cost traces for admin cost governance.
Endpoint
Section titled “Endpoint”GET /api/admin/dentrix-costs
Access control:
- Require authenticated
adminorsuper_adminrole.
Query params
Section titled “Query params”view(optional):days|runs|claims. Defaultruns.format(optional):csv|json. Defaultcsv.from(optional): start date (YYYY-MM-DD, UTC day start).to(optional): end date (YYYY-MM-DD, UTC day end).
Validation:
- Reject invalid
viewwith400. - Reject invalid
formatwith400.
Data sources
Section titled “Data sources”This endpoint derives trace output from:
run_costrecordsai_usagemodel usage rowspilot_batchandpilot_claim_resultoutcome rows
view=days
Section titled “view=days”Return daily rollups including:
- run count
- attempted/completed claim counts
- total variable cost and per-claim derived cost
- aggregation method and formula version
- model breakdown payload
view=runs
Section titled “view=runs”Return run-level traces including:
- job and batch identifiers
- VM runtime + pricing source
- token usage and model breakdown
- LLM/VM/browser-infra/third-party cost components
- run total variable cost and average per-claim costs
view=claims
Section titled “view=claims”Return claim-level allocations including:
- claim identity and run identity
- processing time and allocation weight
- weighted and equal-share claim cost values
- allocation method and fallback flags
Response formats
Section titled “Response formats”format=csv: file attachment response.format=json: object withheaders,rows, and typeditems.
Operational guidance
Section titled “Operational guidance”- Use
daysfor executive trend reporting. - Use
runsfor incident review and infrastructure pricing audits. - Use
claimsfor reconciliation of weighted versus equal-share cost allocation.