Pi Durable Platformdocs
ReferenceModels and usage

The team's model usage, with a cost estimate (its members and service accounts, platform staff)

GET
/v1/teams/{team}/usage

Requests and tokens per day, model or agent, from the platform's model proxy and from agents (direct-mode providers and the platform's default model). Cost uses the models' current prices. Service-managed agents are named for the team's owners and admins and its service accounts; others see them summed.

Path Parameters

team*string

Team slug or ID

Query Parameters

from?string

First day (UTC), default 29 days before to

Formatdate
to?string

Last day (UTC, inclusive), default today

Formatdate
groupBy?string
Default"day"
Value in"day""model""agent"
agentId?string

Only this agent

Formatuuid

Response Body

The report

application/json
  1. response
data*
curl -X GET 'https://agents.example.com/v1/teams/string/usage'
{  "data": {    "from": "2019-08-24",    "to": "2019-08-24",    "groupBy": "day",    "rows": [      {        "day": "2019-08-24",        "modelId": "17563eeb-82d7-4210-ac9b-1a20c7d67278",        "modelName": "string",        "providerName": "string",        "agentId": "bc309ecf-5f66-4057-93c5-6611cc9cb7b2",        "agentName": "string",        "managed": true,        "teamId": "a4ede8ba-7c0a-4485-8763-cbd9b282fbec",        "teamSlug": "string",        "teamName": "string",        "requests": 0,        "inputTokens": 0,        "outputTokens": 0,        "cacheReadTokens": 0,        "cacheWriteTokens": 0,        "costUsd": 0.1,        "unpricedRequests": 0      }    ],    "total": {      "day": "2019-08-24",      "modelId": "17563eeb-82d7-4210-ac9b-1a20c7d67278",      "modelName": "string",      "providerName": "string",      "agentId": "bc309ecf-5f66-4057-93c5-6611cc9cb7b2",      "agentName": "string",      "managed": true,      "teamId": "a4ede8ba-7c0a-4485-8763-cbd9b282fbec",      "teamSlug": "string",      "teamName": "string",      "requests": 0,      "inputTokens": 0,      "outputTokens": 0,      "cacheReadTokens": 0,      "cacheWriteTokens": 0,      "costUsd": 0.1,      "unpricedRequests": 0    }  }}