const url = 'https://api.supermemory.ai/v3/analytics/usage';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}, body: undefined};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
{
"byKey": [
{
"count": 123,
"keyId": "<string>",
"keyName": "<string>",
"lastUsed": "<string>",
"avgDuration": 123
}
],
"hourly": [
{
"count": 123,
"hour": "<string>",
"avgDuration": 123
}
],
"pagination": {
"currentPage": 1,
"limit": 10,
"totalItems": 100,
"totalPages": 10
},
"totalMemories": 123,
"usage": [
{
"avgDuration": 123,
"count": 123,
"lastUsed": "<string>",
"type": "add"
}
]
}
Get usage stats
const url = 'https://api.supermemory.ai/v3/analytics/usage';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}, body: undefined};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
{
"byKey": [
{
"count": 123,
"keyId": "<string>",
"keyName": "<string>",
"lastUsed": "<string>",
"avgDuration": 123
}
],
"hourly": [
{
"count": 123,
"hour": "<string>",
"avgDuration": 123
}
],
"pagination": {
"currentPage": 1,
"limit": 10,
"totalItems": 100,
"totalPages": 10
},
"totalMemories": 123,
"usage": [
{
"avgDuration": 123,
"count": 123,
"lastUsed": "<string>",
"type": "add"
}
]
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Usage stats
The response is of type object
.
Was this page helpful?