Skip to content

Dentrix Costs (Admin) API

Export Dentrix variable-cost traces for admin cost governance.

Endpoint

  • GET /api/admin/dentrix-costs

Access control:

  • Require authenticated admin or super_admin role.

Query params

  • view (optional): days | runs | claims. Default runs.
  • format (optional): csv | json. Default csv.
  • from (optional): start date (YYYY-MM-DD, UTC day start).
  • to (optional): end date (YYYY-MM-DD, UTC day end).

Validation:

  • Reject invalid view with 400.
  • Reject invalid format with 400.

Data sources

This endpoint derives trace output from:

  • run_cost records
  • ai_usage model usage rows
  • pilot_batch and pilot_claim_result outcome rows

Views

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

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

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

  • format=csv: file attachment response.
  • format=json: object with headers, rows, and typed items.

Operational guidance

  • Use days for executive trend reporting.
  • Use runs for incident review and infrastructure pricing audits.
  • Use claims for reconciliation of weighted versus equal-share cost allocation.