Skip to main content

AI Usage Service

The AI usage resource holds the Fusion AI token usage: one record per conversation per day. It is read-only. See Billing.

AI Usage REST API​

The AI Usage REST API is accessed through the following URL:

https://api.opendatadsl.com/api/aiusage
MethodPathExampleDescription
GETGet the build information for this service
GET{release}v1List the usage records of your tenant
GET{release}/{key}v1/6721f0c2a4b9e85d3c0f1a77Retrieve a usage record

Users with the admin role see the usage of every tenant. Use Aggregation to summarise the usage, for example by user or by day.

Entities​

Usage record​

NameDescriptionType
conversationThe id of the conversation in the AI Studio serviceString
userThe person who had the conversationString
tidThe tenant idString
dateThe day of the usageString
timestampWhen the record was last updatedDateTime
inputInput tokensLong
outputOutput tokensLong
cacheWriteTokens written to the prompt cacheLong
cacheReadTokens read from the prompt cacheLong
billedTokensThe billed tokens: (input + output + 1.25 x cacheWrite + 0.1 x cacheRead) x the model weight (Haiku 1, Sonnet 2, Opus 4)Long

Records saved before cache tokens were recorded have no cache fields. Filter date ranges on timestamp.

Examples​

### Billed tokens by user
GET https://api.opendatadsl.com/api/aiusage/v1
?_aggregate=[{"$group":{"_id":"$user","tokens":{"$sum":"$billedTokens"}}}]
Authorization: Bearer {{token}}