v4

latestOpenAPI 3.1.02026-08-01207318738.7 KB
AI

Read individual entity groups' AI credit usage

Read individual embed entity groups' AI credit usage for the current billing period. Names the entity groups by their embed entity string; each must have an entity group in the organization. Returns each entity group's credits used (summed across every member sharing that entity string), in request order, plus the billing-period bounds. An entity with no usage yet reports 0. At most 1000 entities per request; each entity may appear at most once. An unknown entity fails the whole request with a 404 naming it. This is a read, so it works even when credit-controls editing is disabled; it requires the same add/remove-users permission and embed-entity credit-limit feature flag as the per-entity-group limit endpoints.

post/api/v1/ai/credit-usage/entity-groups

Request body

entitiesstring[] required

Entity groups to read usage for, at most 1000 per request. Each entry is an embed entity string.

Example request

{
  "entities": [
    "acme-corp"
  ]
}

Response

Each requested entity group's credit usage for the current billing period, in request order.

periodEndinteger required

End of the current billing period as a Unix ms timestamp (UTC calendar-month boundary).

periodStartinteger required

Start of the current billing period as a Unix ms timestamp (UTC calendar-month boundary).

Example response

{
  "entityGroups": [
    {
      "creditsUsed": 42,
      "entity": "acme-corp"
    }
  ]
}