GET
/
v4
/
model-deployments
/
{model_deployment_id}
/
usage-statistics
import SGPClient from 'sgp';

const client = new SGPClient({
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const modelUsage = await client.models.deployments.usageStatistics.retrieve('model_deployment_id', {
    chunks: 0,
    end_date: '2019-12-27T18:11:19.117Z',
    start_date: '2019-12-27T18:11:19.117Z',
  });

  console.log(modelUsage.data);
}

main();
{
  "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"
}

Authorizations

x-api-key
string
header
required

Path Parameters

model_deployment_id
string
required

Query Parameters

start_date
string | null
required
end_date
string | null
required
chunks
integer | null
required

Response

200
application/json
Successful Response
data
object[]
required

The list of data points for the given period

start_date
string
required

The start date of the data points. Equal to the first date in the data list

end_date
string
required

The end date of the data points. Equal to the last date in the data list