import os
from datetime import datetime
from scale_gp import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
model_usage = client.model_groups.usage_statistics.retrieve(
model_group_id="model_group_id",
chunks=0,
end_date=datetime.fromisoformat("2019-12-27T18:11:19.117"),
start_date=datetime.fromisoformat("2019-12-27T18:11:19.117"),
)
print(model_usage.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 os
from datetime import datetime
from scale_gp import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
model_usage = client.model_groups.usage_statistics.retrieve(
model_group_id="model_group_id",
chunks=0,
end_date=datetime.fromisoformat("2019-12-27T18:11:19.117"),
start_date=datetime.fromisoformat("2019-12-27T18:11:19.117"),
)
print(model_usage.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 list of data points for the given period
Show child attributes
The start date of the data points. Equal to the first date in the data list
The end date of the data points. Equal to the last date in the data list