Get Model usage for a group
curl --request GET \
--url https://api.egp.scale.com/v4/model-groups/{model_group_id}/usage-statisticsimport requests
url = "https://api.egp.scale.com/v4/model-groups/{model_group_id}/usage-statistics"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.egp.scale.com/v4/model-groups/{model_group_id}/usage-statistics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.egp.scale.com/v4/model-groups/{model_group_id}/usage-statistics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.egp.scale.com/v4/model-groups/{model_group_id}/usage-statistics"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.egp.scale.com/v4/model-groups/{model_group_id}/usage-statistics")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/model-groups/{model_group_id}/usage-statistics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"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"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Models
Get Model usage for a group
GET
/
v4
/
model-groups
/
{model_group_id}
/
usage-statistics
Get Model usage for a group
curl --request GET \
--url https://api.egp.scale.com/v4/model-groups/{model_group_id}/usage-statisticsimport requests
url = "https://api.egp.scale.com/v4/model-groups/{model_group_id}/usage-statistics"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.egp.scale.com/v4/model-groups/{model_group_id}/usage-statistics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.egp.scale.com/v4/model-groups/{model_group_id}/usage-statistics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.egp.scale.com/v4/model-groups/{model_group_id}/usage-statistics"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.egp.scale.com/v4/model-groups/{model_group_id}/usage-statistics")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/model-groups/{model_group_id}/usage-statistics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"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"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
Query Parameters
Response
Successful Response
The list of data points for the given period
Show child attributes
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

