Skip to main content

aiCreditUsageSummary

Requires permission billing:ai_credit:read.

Windowed spend aggregate for the wallet page's KPI strip and burn sparkline.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query AiCreditUsageSummary {
aiCreditUsageSummary {
callCount
topFeature
topFeatureCreditsUsed
totalCreditsUsed
windowDays
daily {
creditsUsed
date
}
}
}

Response:

{
"data": {
"aiCreditUsageSummary": {
"callCount": 0,
"topFeature": "string",
"topFeatureCreditsUsed": "string",
"totalCreditsUsed": "string",
"windowDays": 0,
"daily": [
{
"creditsUsed": "string",
"date": "string"
}
]
}
}
}
aiCreditUsageSummary(
windowDays: Int
): AiCreditUsageSummary!

Arguments​

aiCreditUsageSummary.windowDays ● Int scalar​

How many past days to include. Omit for the default window.

Type​

AiCreditUsageSummary object​

Totals over a period for the wallet page's figures and chart, worked out over the whole period.