Smart Agent Teams
EndpointsInsights

Get Costs

Get spend for one calendar month, by agent and by project. `month` is `YYYY-MM` (default: the current UTC month). Amounts are integer cents; a budget of `0` means no limit. Each line also has run and token counts. Terminated agents appear only if they have spend that month; runs without a project are grouped under "No project" with `id: null`. Lines are sorted by spend, highest first.

GET
/api/companies/{company_id}/costs

Get spend for one calendar month, by agent and by project.

month is YYYY-MM (default: the current UTC month). Amounts are integer cents; a budget of 0 means no limit. Each line also has run and token counts. Terminated agents appear only if they have spend that month; runs without a project are grouped under "No project" with id: null. Lines are sorted by spend, highest first.

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

company_id*Company Id
Formatuuid

Query Parameters

month?|

YYYY-MM, default current

Response Body

Successful Response

application/json
  1. response
budget_cents*Budget Cents
by_agent*array<>
by_project*array<>
month*Month
total_cents*Total Cents
curl -X GET "https://example.com/api/companies/497f6eca-6276-4993-bfeb-53cbbbba6f08/costs"
{  "budget_cents": 0,  "by_agent": [    {      "budget_cents": 0,      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "runs": 0,      "spend_cents": 0,      "tokens_in": 0,      "tokens_out": 0    }  ],  "by_project": [    {      "budget_cents": 0,      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "runs": 0,      "spend_cents": 0,      "tokens_in": 0,      "tokens_out": 0    }  ],  "month": "string",  "total_cents": 0}