const url = 'https://api.supermemory.ai/v3/analytics/chat';
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);
}
{
"analytics": {
"apiUsage": {
"current": 123,
"limit": 123
},
"latency": {
"current": 123,
"trend": [
123
],
"unit": "<string>"
},
"usage": {
"currentDay": "Sun",
"tokensByDay": {
"Fri": 123,
"Mon": 123,
"Sat": 123,
"Sun": 123,
"Thu": 123,
"Tue": 123,
"Wed": 123
}
}
},
"overview": {
"7d": {
"amountSaved": {
"current": 123,
"previousPeriod": 123
},
"tokensProcessed": {
"current": 123,
"previousPeriod": 123
},
"tokensSent": {
"current": 123,
"previousPeriod": 123
},
"totalTokensSaved": {
"current": 123,
"previousPeriod": 123
}
},
"30d": {
"amountSaved": {
"current": 123,
"previousPeriod": 123
},
"tokensProcessed": {
"current": 123,
"previousPeriod": 123
},
"tokensSent": {
"current": 123,
"previousPeriod": 123
},
"totalTokensSaved": {
"current": 123,
"previousPeriod": 123
}
},
"90d": {
"amountSaved": {
"current": 123,
"previousPeriod": 123
},
"tokensProcessed": {
"current": 123,
"previousPeriod": 123
},
"tokensSent": {
"current": 123,
"previousPeriod": 123
},
"totalTokensSaved": {
"current": 123,
"previousPeriod": 123
}
},
"lifetime": {
"amountSaved": {
"current": 123,
"previousPeriod": 123
},
"tokensProcessed": {
"current": 123,
"previousPeriod": 123
},
"tokensSent": {
"current": 123,
"previousPeriod": 123
},
"totalTokensSaved": {
"current": 123,
"previousPeriod": 123
}
}
}
}
Get chat analytics for dashboard
const url = 'https://api.supermemory.ai/v3/analytics/chat';
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);
}
{
"analytics": {
"apiUsage": {
"current": 123,
"limit": 123
},
"latency": {
"current": 123,
"trend": [
123
],
"unit": "<string>"
},
"usage": {
"currentDay": "Sun",
"tokensByDay": {
"Fri": 123,
"Mon": 123,
"Sat": 123,
"Sun": 123,
"Thu": 123,
"Tue": 123,
"Wed": 123
}
}
},
"overview": {
"7d": {
"amountSaved": {
"current": 123,
"previousPeriod": 123
},
"tokensProcessed": {
"current": 123,
"previousPeriod": 123
},
"tokensSent": {
"current": 123,
"previousPeriod": 123
},
"totalTokensSaved": {
"current": 123,
"previousPeriod": 123
}
},
"30d": {
"amountSaved": {
"current": 123,
"previousPeriod": 123
},
"tokensProcessed": {
"current": 123,
"previousPeriod": 123
},
"tokensSent": {
"current": 123,
"previousPeriod": 123
},
"totalTokensSaved": {
"current": 123,
"previousPeriod": 123
}
},
"90d": {
"amountSaved": {
"current": 123,
"previousPeriod": 123
},
"tokensProcessed": {
"current": 123,
"previousPeriod": 123
},
"tokensSent": {
"current": 123,
"previousPeriod": 123
},
"totalTokensSaved": {
"current": 123,
"previousPeriod": 123
}
},
"lifetime": {
"amountSaved": {
"current": 123,
"previousPeriod": 123
},
"tokensProcessed": {
"current": 123,
"previousPeriod": 123
},
"tokensSent": {
"current": 123,
"previousPeriod": 123
},
"totalTokensSaved": {
"current": 123,
"previousPeriod": 123
}
}
}
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Chat analytics data
The response is of type object
.
Was this page helpful?