AI

Read individual entity groups' AI credit usage

Changed on

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 as the per-entity-group limit endpoints.

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

Request

  • Base URL
    https://omniapp.co (the document declares no server; this is the origin it was published from)
  • URL
    https://omniapp.co/api/v1/ai/credit-usage/entity-groups
  • Auth
    HTTP bearer

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"
    }
  ]
}

Changes