AI credits tools
All tool areas. Each tool acts within your access.
AI credits
get_ai_credits
Get the organization's AI credits: what's left in total, the plan's allowance this period (granted, used, remaining, when it expires: what's left isn't carried over), the trial's, bought top-ups (they never expire), what this period's in-app AI actions used per action, and what each action costs. In-app AI spends the allowance first, then the trial, then top-ups, and stops at 0; booking never does. Calls through MCP cost nothing. Needs billing:read across the organization (owner and finance).
Reads · Members of an organization · Needs billing:read
No input.
Output
totalAI credits left to spend now: the allowance, the trial, and top-ups. At 0, in-app AI stops (booking never does)
allowanceThe plan's current (or latest) period; null before the first
allowance.grantedWhat the plan granted this period, with Lokl's adjustments
allowance.usedallowance.remaining0 once the period has ended
allowance.periodStartallowance.periodEndallowance.expiresAtWhen what's left of it expires; it isn't carried over
trialNull when the organization never had a trial
trial.grantedtrial.remaining0 once the trial has ended
trial.expiresAttopUptopUp.remainingBought AI credits; they never expire
useByFeatureAI credits used this period, per action, most first (from every pool; since the trial began, before the first period)
useByFeature[]useByFeature[].featureuseByFeature[].creditspricesWhat each in-app AI action costs, in AI credits. Calls through MCP cost nothing
prices[]prices[].featureprices[].credits
list_ai_credit_entries
List the organization's AI credit ledger, newest first: every grant (the plan's allowance each period, the trial, top-ups, Lokl's adjustments with their reason), every in-app AI action's use (with its action and the agent, if one took it), every use given back because its model call produced nothing (refund), and every expiry of an allowance or trial left unused. Page back with before. Needs billing:read across the organization (owner and finance).
Reads · Members of an organization · Needs billing:read
Input
beforeThe ai credit entry's id
limitThe most results to return (default 50)
Output
entriesentries[]entries[].identries[].atentries[].kindentries[].amountAI credits: positive for a grant or a use given back (refund: the model call it paid for produced nothing), negative for a use or an expiry; an adjustment either way
entries[].poolThe balance it changed: the allowance, the trial, or top-ups
entries[].featureThe in-app AI action a use paid for, or a refund gave back
entries[].agentThe agent that took the action; null for a person's
entries[].reasonWhy Lokl adjusted the balance
entries[].actorentries[].actor.typeentries[].actor.idnextBefore