Get Key Spending
GET /api-keys/{api_key_id}/spending
GET
/api-keys/{api_key_id}/spending
A key’s caps beside what it has spent today and this month (UTC).
An Admin or Owner reads any key of the organization; any other caller reads only the key it is using, which is how a client throttles itself. Spend is best effort: if the counter store is down the caps are still returned with a spend of 0 rather than failing.
Authorizations
Parameters
Path Parameters
api_key_id
required
Key id from GET /api-keys.
string
Key id from GET /api-keys.
Header Parameters
Responses
200
Successful Response
object
data
required
A key’s caps beside what it has spent in the current UTC day and month.
object
api_key_id
required
string
daily_spent
integer
monthly_spent
integer
pagination
Any of:
object
has_next
required
Whether there are more pages
boolean
limit
required
Items per page
integer
notes
Any of:
Array<string>
null
page
required
Current page number (1-indexed)
integer
total
required
Total number of items
integer
null
422
Validation Error
object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string