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

# Activity and analytics

> Understand personal tool usage and enterprise workspace spend, transactions, margin, and attribution.

Locus Pro shows usage differently for personal accounts and enterprise workspaces. Both views use UTC and count completed tool charges; enterprise adds transaction history, spender and provider drill-downs, end-user activity, and margin.

| Account tier | Dashboard view                | Best for                                                                    |
| ------------ | ----------------------------- | --------------------------------------------------------------------------- |
| Personal     | **Usage**                     | Seeing what connected agents used and what those calls cost                 |
| Personal     | **Credits → Payment history** | Reviewing card top-ups                                                      |
| Enterprise   | **Activity**                  | Investigating spend by spender, provider, endpoint, period, and transaction |
| Enterprise   | **Analytics**                 | Comparing usage, calls, margin, services, and end-user activity over time   |

<Info>
  Personal connection plans change how many OAuth-connected clients can remain
  active. They do not limit simultaneous sessions, and they do not unlock the
  enterprise **Activity**, **Analytics**, ledger, margin, or end-user billing
  surfaces.
</Info>

## Personal Usage

Open **Usage** to answer three questions:

* How much did my agents spend?
* How many tool calls completed?
* Which tools accounted for that spend?

Choose 7, 30, or 90 days. The page shows total tool spend, completed calls, spend over time, and the top tools for the selected period. The period uses whole UTC days and includes today so far.

Personal accounts access this view through the dashboard. They do not receive tenant API keys, so direct management API access below applies to enterprise workspaces.

Open **Credits → Payment history** to review card top-ups. Payment history shows funds added; **Usage** shows the tool calls that consumed them. Personal owners also manage auto-reload, a monthly cap, and balance alerts from **Credits**.

## Enterprise Activity

Open **Activity** to investigate what the workspace spent, who spent it, and which agent tools they used. Spender, provider, endpoint, and period form one shared query that updates the totals, chart, breakdowns, and transaction evidence together. Transaction type narrows only the transaction list. Attribution narrows the list and ledger summary, not the analytics totals above them.

| Filter           | Choices                                                                                                   |
| ---------------- | --------------------------------------------------------------------------------------------------------- |
| Spender          | Workspace member, end user, Agent Connection, API credential, unattributed spend, or all spenders         |
| Provider         | One provider, one endpoint under that provider, or all providers                                          |
| Period           | Last 24 hours; 7, 30, or 90 days; month to date; year to date; all time; or a custom inclusive date range |
| Transaction type | All, charges, top-ups, allocations, or refunds; linked views can select another supported ledger category |

Activity shows:

* **Gross spend**, completed tool charges before refunds, with the matching prior-period comparison.
* **Tool calls** and average charge per call.
* **Active spenders**, covering end users, agents, credentials, and workspace members.
* **Pool balance**, which is the current balance rather than a total for the selected period.
* Spend over time, spender and provider breakdowns, and newest-first transactions.

The selected query is reflected in the page URL, so a filtered view can be bookmarked or shared with another authorized workspace member.

## Enterprise Analytics

Open **Analytics** for a higher-level business view. Choose 7, 30, or 90 days; each selection is compared with the equal preceding span.

The dashboard reports gross usage, average charge per call, gross margin, tool calls, active end users, usage over time, unit economics, top end users, initiating identities, and services. This view is useful for trend and margin questions; use **Activity** when you need a specific transaction or spender.

## Query the API

Enterprise dashboard sessions and tenant secret keys with `tenant:read` can read the same data.

| Endpoint                          | What it returns                                                                                                          | Availability                      |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | --------------------------------- |
| `GET /api/credits/analytics`      | Completed-charge totals, an equal prior period, a time series, and ranked services, providers, end users, and initiators | Personal dashboard and enterprise |
| `GET /api/credits/ledger`         | Cursor-paginated balance movements and their attribution                                                                 | Enterprise only                   |
| `GET /api/credits/ledger/summary` | Total rows plus counts and amounts by transaction category for the same ledger filters                                   | Enterprise only                   |

The analytics endpoint accepts either `days=7|30|90` or an explicit `from` and exclusive `to` timestamp. Explicit windows can set `bucket=hour|day|week|month` and filter by `initiator`, `provider`, and `endpoint`; `endpoint` requires `provider`. Use `limit` to cap each ranked list. An initiator has one of these forms:

```text theme={null}
oauth_member:USER_ID
end_user:EXTERNAL_USER_ID
agent_connection:CONNECTION_ID
credential:KEY_ID
unattributed
```

The ledger and ledger-summary endpoints use inclusive `createdAfter` and exclusive `createdBefore` timestamps. They also accept `initiator`, `provider`, `endpoint`, `externalUserId`, `category`, `sourceKey`, `account=platform`, and exact attribution filters such as `attribution.customerId=cus_42`; the paginated ledger additionally accepts `cursor` and `limit`. Attribution narrows the transaction list and summary, not analytics rollups. Analytics can select `unattributed`, but the ledger cannot filter individual rows by that value.

<Note>
  Analytics counts completed tool charges. Top-ups, allocations, refunds, and other balance movements belong to the ledger. Gross spend is therefore before refunds; use the matching ledger summary when you need category counts or refund amounts for an exact filter.
</Note>

<CardGroup cols={3}>
  <Card title="Authentication and scopes" icon="key" href="/locus-pro/authentication-and-scopes">
    Choose the right dashboard or API credential.
  </Card>

  <Card title="Funding and billing" icon="credit-card" href="/locus-pro/funding-and-billing">
    Understand balances, top-ups, margin, and payouts.
  </Card>

  <Card title="API reference" icon="brackets-curly" href="/api-reference/introduction">
    Read the exact filters and response schemas.
  </Card>
</CardGroup>
