Skip to content

DocsAPI reference

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.


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

Parameters

bystring
workflow (default), feature, end_user or cost_center.
periodYYYY-MM
A calendar month, UTC. Overrides from and to.
from, toISO-8601
A window. Default: the start of this month to now.
cost_share_thresholdnumber
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 revenue tracking turned on. See Customer revenue.

On the Summary

For the budget cycle at a glance, the Summary's Cost per customer and Cost per feature cards show the average per customer or feature and the largest ones with their change against the same days of the last cycle. Unit economics adds what the cards do not: cost per run with its median and p90, cost per request, and revenue margin.

↑ ↓ navigate↵ open/ anywhere in docs