Skip to content

AI usage by feature

GET
/ai/usage
curl --request GET \
--url https://api.sloose.com/ai/usage \
--header 'Authorization: Bearer <token>'

Credits and tokens for the period, broken down by feature. Defaults to the current calendar month.

from

ISO start of the range. Defaults to the start of this month.

string

ISO start of the range. Defaults to the start of this month.

to

ISO end of the range, exclusive. Defaults to the start of next month.

string

ISO end of the range, exclusive. Defaults to the start of next month.

Usage for the range.

Media typeapplication/json

Totals and a per-feature breakdown of calls, tokens and credits.

object
key
additional properties
Examplegenerated
{
"additionalProperty": "example"
}

from or to is not an ISO date.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed values: BAD_INPUT
key
additional properties
Example
{
"code": "BAD_INPUT"
}

No bearer, or one that is expired, revoked or no longer resolves to a member.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

The bearer’s role is too low, or it was issued for a different org.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}