# Unit economics

> GET /v1/unit-economics — cost per run, per request, per feature, per customer and per cost center, with the unpriced share beside every figure.

Source: https://infro.io/docs/api/unit-economics

> **Note:** INFRO is in private early access. Running these examples requires an early-access account, an active trial or subscription entitlement, and your own provider connection. Self-serve purchasing is not generally open. See [Early access](https://infro.io/early-access).

```bash
curl "https://api.infro.io/v1/unit-economics?by=workflow&period=2026-08" \
  -H "Authorization: Bearer $INFRO_API_KEY"
```

## Parameters

- `by` (string) — `workflow` (default), `feature`, `end_user` or `cost_center`.
- `period` (YYYY-MM) — A calendar month, UTC. Overrides `from` and `to`.
- `from, to` (ISO-8601) — A window. Default: the start of this month to now.
- `cost_share_threshold` (number) — With `by=end_user` and revenue on: flag customers whose AI cost exceeds this share of their revenue. Default `0.25`.

## Response

```json
{
  "object": "unit_economics",
  "by": "workflow",
  "from": "2026-08-01T00:00:00.000Z",
  "to": "2026-09-01T00:00:00.000Z",
  "groups_truncated": false,
  "revenue_available": false,
  "data": [
    {
      "group": "support-agent",
      "label": "support-agent",
      "requests": 13,
      "runs": 7,
      "estimated_cost": "0.970000",
      "cost_per_request": "0.080833",
      "cost_per_run": { "median": "0.150000", "p90": "0.200000" },
      "unpriced_requests": 1,
      "unpriced_share": 0.0769
    }
  ],
  "other": null,
  "unattributed": { "group": null, "label": "No workflow", "requests": 7, "runs": 0, "estimated_cost": "1.250000", "cost_per_request": "0.178571", "cost_per_run": null, "unpriced_requests": 0, "unpriced_share": 0 },
  "notes": ["Estimated provider cost, not an invoice. INFRO platform fees are not included."]
}
```

- Money is a decimal string of US dollars to six places.
- **A run is one `(workflow, trace_id)`.** Requests without a trace id count toward cost and cost per request, but not toward runs, median or p90.
- `cost_per_request` divides by priced requests only. `unpriced_requests` and `unpriced_share` sit beside every row so a partial figure never reads as a whole one.
- The hundred largest groups are returned; the rest are one `other` row with totals only, because percentiles cannot be merged.
- `unattributed` holds requests without the dimension; for `by=cost_center` it is `Unallocated`.

## Access

The key needs observability access. A key scoped to a project, key or environment sees only that slice, exactly as with `/v1/usage`. Unit economics is on every plan; the revenue columns need the Team plan and revenue tracking turned on. See [Customer revenue](https://infro.io/docs/api/revenue).
