> ## Documentation Index
> Fetch the complete documentation index at: https://docs.costgraph.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Unit economics

> Break spend down by account or tag, with cost per unit of usage and change over time

Unit economics shows what each account, team, or customer costs, how that
changed since the previous period, and what one unit of their usage costs.

Read it with `GET /api/v1/tenant/cost/unit-economics` in the
[CostGraph API](/api-reference/costgraph/introduction). It works with an API
key that has the `focus:read` scope, and takes the same period and filters as
cost queries.

```shell theme={null}
curl "https://api.costgraph.ai/api/v1/tenant/cost/unit-economics?unit=tag:customer&period=last_30d" \
  -H "X-API-Key: $COSTGRAPH_API_KEY" \
  -H "X-CostGraph-Tenant-ID: $TENANT_ID"
```

The following table describes the parameters:

| Parameter | Default | Meaning |
| - | - | - |
| `unit` | `sub_account` | `sub_account`, or `tag:<key>` to use a provider or virtual tag such as `tag:customer` |
| `limit` | `100` | How many units to return, up to 500 |
| `period`, `filter` | Month to date | The same period and filters as cost queries |

## Measures

Each entry in `units` has:

| Field | Meaning |
| - | - |
| `current` | Spend in the period |
| `previous` | Spend in the period before, of the same length |
| `changeAmount` and `changePct` | The change between the two |
| `share` | This unit's share of the total |
| `canonicalUsageQuantity` and `canonicalUsageUnit` | Usage in the period, such as GPU hours |
| `costPerUnit` | Spend divided by usage |

`costPerUnit` is present only when all of a unit's usage is measured in one
unit, so it never divides spend by a mix of hours and gigabytes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.