feat(app-server): expose account token usage

This commit is contained in:
Felipe Coury
2026-05-30 19:17:53 -03:00
parent 966932124c
commit 4ebef9107d
18 changed files with 555 additions and 1 deletions
@@ -1833,6 +1833,29 @@
"title": "Account/rateLimits/readRequest",
"type": "object"
},
{
"properties": {
"id": {
"$ref": "#/definitions/v2/RequestId"
},
"method": {
"enum": [
"account/tokenUsage/read"
],
"title": "Account/tokenUsage/readRequestMethod",
"type": "string"
},
"params": {
"type": "null"
}
},
"required": [
"id",
"method"
],
"title": "Account/tokenUsage/readRequest",
"type": "object"
},
{
"properties": {
"id": {
@@ -5731,6 +5754,62 @@
"title": "AccountRateLimitsUpdatedNotification",
"type": "object"
},
"AccountTokenUsageDailyBucket": {
"properties": {
"startDate": {
"type": "string"
},
"tokens": {
"format": "int64",
"type": "integer"
}
},
"required": [
"startDate",
"tokens"
],
"type": "object"
},
"AccountTokenUsageSummary": {
"properties": {
"currentStreakDays": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"lifetimeTokens": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"longestRunningTurnSec": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"longestStreakDays": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"peakDailyTokens": {
"format": "int64",
"type": [
"integer",
"null"
]
}
},
"type": "object"
},
"AccountUpdatedNotification": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
@@ -9474,6 +9553,28 @@
"title": "GetAccountResponse",
"type": "object"
},
"GetAccountTokenUsageResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"dailyUsageBuckets": {
"items": {
"$ref": "#/definitions/v2/AccountTokenUsageDailyBucket"
},
"type": [
"array",
"null"
]
},
"summary": {
"$ref": "#/definitions/v2/AccountTokenUsageSummary"
}
},
"required": [
"summary"
],
"title": "GetAccountTokenUsageResponse",
"type": "object"
},
"GitInfo": {
"properties": {
"branch": {