---
title: "Get Cost By Play"
method: GET
path: "/api/billing/cost-by-play"
tags: ["billing"]
---

# Get Cost By Play

`GET /api/billing/cost-by-play`

## Request

- Base URL: `https://platform.verbiflow.com/api/bridge`
- URL: `https://platform.verbiflow.com/api/bridge/api/billing/cost-by-play`
- Auth: one of:
  - HTTP bearer and API key in header `x-flage-org-id`
  - HTTP bearer and API key in header `x-flage-org-slug`

Aggregate unified-meter credits for one play in the caller's org.

Scoped to ``auth.org_id`` so callers can only see their own plays.
Returns zero-filled response when no events have been recorded for the play
(registered-but-unused plays are valid).

## Query parameters

- `play_id` string, required

## Response `200`

Successful Response

- CostByPlayResponse
  - `by_capability` CostByPlayCapability[], required: Play credits grouped by capability.
    - `capability_id` string, required: Exact capability identifier.
    - `cost` string, required: Credit cost attributed to this capability; currently equal to units.
    - `event_count` integer, required: Accounting events included in this row.
    - `owner` 'source_consumed' | 'enrichment_consumed' | 'enrichment_reserved' | 'growth_observed', required: Credit ownership projection: source_consumed is completed source work; enrichment_consumed is completed enrichment work; enrichment_reserved is active unfinished enrichment work; growth_observed is canonical or legacy Growth capability work.
    - `units` string, required: Credit units attributed to this capability.
    - `usd_cost` number, required: Projected USD equivalent at the workspace current overage-credit rate, rounded to six decimal places; this is not provider cost or an invoiced amount.
  - `by_owner` CostByPlayOwner[], required: Play credits grouped by accounting owner.
    - `credits_used` string, required: Exact non-negative credit quantity in canonical decimal notation; no binary-float conversion is applied.
    - `event_count` integer, required: Accounting events included in this owner total.
    - `owner` 'source_consumed' | 'enrichment_consumed' | 'enrichment_reserved' | 'growth_observed', required: Credit ownership projection: source_consumed is completed source work; enrichment_consumed is completed enrichment work; enrichment_reserved is active unfinished enrichment work; growth_observed is canonical or legacy Growth capability work.
    - `usd_cost` number, required: Projected USD equivalent at the workspace current overage-credit rate, rounded to six decimal places; this is not provider cost or an invoiced amount.
  - `credits_consumed` string, required: Exact non-negative credit quantity in canonical decimal notation; no binary-float conversion is applied.
  - `credits_reserved` string, required: Exact non-negative credit quantity in canonical decimal notation; no binary-float conversion is applied.
  - `credits_used` string, required: Exact non-negative credit quantity in canonical decimal notation; no binary-float conversion is applied.
  - `event_count` integer, required: Accounting events attributed to the Play.
  - `is_partial` boolean, required: True when historical snapshots record positive credits but the Play has no ledger-attributed credits. False means this check found no gap; it does not certify complete attribution across mixed old and new runs.
  - `partial_reason` string, nullable, required: Reason ledger attribution is incomplete, when partial.
  - `play_id` string, required: Exact Workflow Play identifier.
  - `scope` 'unified_credit_meter', required: Accounting scope used for every Play cost projection.
  - `total_cost` string, required: Total credit cost; an alias of credits_used for this unified meter.
  - `total_units` string, required: Total credit units; an alias of credits_used for this unified meter.
  - `usd_cost` number, required: Projected USD equivalent at the workspace current overage-credit rate, rounded to six decimal places; this is not provider cost or an invoiced amount.
  - `usd_per_credit` number, required: Current workspace overage-credit price in US dollars used for this projection; zero can mean a configured zero rate or unavailable commercial terms and does not prove that work is free.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/verbiflow/apis/verbiflow-sdk-http-contract.md) - [All operations](https://skmtc.dev/verbiflow/apis/verbiflow-sdk-http-contract/llms.txt) - [OpenAPI document](https://skmtc.dev/verbiflow/apis/verbiflow-sdk-http-contract/revisions/c80e903ef8f3?raw)
