Account
Get usage
GET /v1/account/usage- Permission
read:account- Tokens
- API key, CLI user token, Session token
Read usage for a UTC calendar month, split by billing source.
Query parameters
period_startstring, date
{
"period_end": str,
"period_start": str,
}
1
import os
2
3
from ellipsis import Ellipsis
4
5
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
6
7
result = client.account.usage()
8
print(result)
1
import { Ellipsis } from '@ellipsis-dev/sdk';
2
3
const client = new Ellipsis({
4
apiKey: process.env.ELLIPSIS_API_TOKEN!,
5
});
6
7
const result = await client.account.usage();
8
console.log(result);
1
curl "https://api.ellipsis.dev/v1/account/usage" \
2
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN"
Response
agent_sessionsUsageTotalsrequired
Cost and tokens of agent sessions only.
billing_periodsarray<BillingPeriodOption>required
by_billing_sourcearray<BillingSourceUsage>
by_dayarray<UsageDay>required
One entry per day of the period, oldest first, with zeros for days without usage.
by_developerarray<DeveloperUsage>required
Agent session cost and tokens for each developer, highest cost first.
costCostrequired
What the period's usage has cost so far.
period_endstringrequired
period_startstringrequired
prior_costCostrequired
What the prior period cost over the same number of elapsed days.
prior_tokensTokensrequired
The tokens the prior period used over the same number of elapsed days.
tokensTokensrequired
The tokens used in the period so far.