import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const modelUsage = await client.modelGroups.usageStatistics.retrieve('model_group_id', {
chunks: 0,
end_date: '2019-12-27T18:11:19.117Z',
start_date: '2019-12-27T18:11:19.117Z',
});
console.log(modelUsage.data);
{
"data": [
{
"date": "2023-11-07T05:31:56Z",
"prompt_tokens": 123,
"response_tokens": 123,
"summary_tokens": 123
}
],
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z"
}
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const modelUsage = await client.modelGroups.usageStatistics.retrieve('model_group_id', {
chunks: 0,
end_date: '2019-12-27T18:11:19.117Z',
start_date: '2019-12-27T18:11:19.117Z',
});
console.log(modelUsage.data);
{
"data": [
{
"date": "2023-11-07T05:31:56Z",
"prompt_tokens": 123,
"response_tokens": 123,
"summary_tokens": 123
}
],
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z"
}
Successful Response
The response is of type object
.