Usage

Monitor Platica usage from your systems: billing period, messages, conversations, autonomy rate, message types, and the actors generating usage.

Example

await platic.usage.summary();

Available endpoints

MethodEndpointDescription
GET/v1/usage/periodGet the active billing period
GET/v1/usage/summaryGet a usage and autonomy summary
GET/v1/usage/messagesQuery messages by type, channel, category, campaign, or status
GET/v1/usage/conversationsQuery conversations, assistance, and autonomy
GET/v1/usage/actorsQuery consumption by actor

Each endpoint answers for one workspace: { "status": "success", "data": { ... } }, where data is that workspace's metrics. If your credential covers several workspaces, send ?workspace=<id> (list workspaces); without it the answer is 400.

Data freshness

Messages in the summary and in /v1/usage/messages are counted from transactions with mode=full, the default for ranges up to 92 days. They match the Usage page without lag.

Longer ranges, enterprise, mode=fast, and /v1/usage/actors use daily aggregates updated for each transaction. They usually lag by seconds. You can read total volume (all) or charged messages (billable).

Conversations and autonomy rate use hourly aggregates and may lag by up to ~60 minutes. Check freshness in each response for the latest update.

Enterprise workspaces

Enterprise rates are set per customer. Monitor total, billable, and non-billable counts:

  • With billingType: "enterprise", the response includes workspace credits and omits creditsUsed and costs.
  • It always uses aggregates, even with mode=full.