Skip to main content
AI P&L is the top-level view that rolls up every decision, every linked financial event, and every active liability estimate into a single answer to the question: is this AI making or losing money? It is the number finance looks at, the number leadership asks about, and the number a board slide summarises in two bullets. That visibility is only meaningful if you trust the computation — and the computation is intentionally transparent: pure aggregates over the same ledger you can query manually via the REST API. If a dashboard number ever disagrees with a REST call over the same range, the REST call is authoritative. The dashboard is a presentation of the ledger, not a separate source of truth.

The four numbers

The AI P&L is per-org, per-time-range, and optionally per-agent. Pass a date range and an optional agent ID and you get:

total_revenue_attributed

SUM of amount across linked financial events whose consequence-link link_type is revenue, within the requested range.

total_cost_attributed

SUM of amount across linked financial events whose consequence-link link_type is cost, within the requested range.

total_liability_exposure

SUM of estimated_exposure across active liability estimates for in-range decisions. This is a separate aggregation over the liability estimates — not derived from the event ledger.

net_ai_impact

total_revenue_attributed − total_cost_attributed. Prospective liability is reported separately and is not subtracted from net impact.
The response also includes decision_count, link_count, and a top_agents array listing the five biggest net-impact contributors.

Shape

{
  "currency": "USD",
  "total_revenue_attributed": "148230.00",
  "total_cost_attributed":    "-12400.50",
  "total_liability_exposure":  "67500.00",
  "net_ai_impact":            "135829.50",
  "decision_count": 4123,
  "link_count": 2987,
  "top_agents": [
    { "agent_id": "pricing-bot",  "net_impact":  "82100.00", "decision_count": 1204 },
    { "agent_id": "refund-bot",   "net_impact":  "22400.00", "decision_count": 890 },
    { "agent_id": "upsell-bot",   "net_impact":  "19300.00", "decision_count": 612 }
  ]
}

Fetching from code

pnl = pq.get_ai_pnl(
    start="2026-04-01",
    end="2026-04-30",
    agent_id="pricing-bot",    # optional — per-agent slice
)
if pnl is not None:
    print(pnl["net_ai_impact"], pnl["currency"])

Currency handling

The endpoint aggregates only when every in-range linked event shares a single currency. If your org’s events span multiple currencies, the endpoint returns HTTP 409 with a currencies detail array so you can retry scoped to one currency at a time using the start/end window.
If you need a single rolled-up number across currencies today, convert at ingestion time before posting financial events. The dashboard’s P&L view collapses mixed-currency orgs into per-currency panels automatically.

What is NOT in the P&L

Liability is an estimate, not a realised loss. If a liability actually materialises — a lawsuit settles, a refund is paid — it enters the ledger as a cost financial event, which flows into total_cost_attributed, not into total_liability_exposure.
Use the timeline endpoint (/api/v1/analytics/timeline) to get these same four numbers bucketed by hour, day, week, or month. The dashboard’s area chart reads it directly — and you can pipe it to your own BI tooling using the same query parameters.