curl --request POST \
--url https://api.app.simplismart.ai/usage/stats/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_customer_id": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"sources": [
"<string>"
],
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"group_by": [
"<string>"
],
"feature_ids": [
"<string>"
],
"property_filters": {},
"expand": [
"<string>"
],
"deployment_ids": [
"<string>"
],
"deployment_slugs": [
"<string>"
],
"model_names": [
"<string>"
],
"training_job_ids": [
"<string>"
],
"training_job_names": [
"<string>"
],
"model_repo_ids": [
"<string>"
],
"model_repo_names": [
"<string>"
],
"statuses": [
"<string>"
]
}
'import requests
url = "https://api.app.simplismart.ai/usage/stats/"
payload = {
"external_customer_id": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"sources": ["<string>"],
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"group_by": ["<string>"],
"feature_ids": ["<string>"],
"property_filters": {},
"expand": ["<string>"],
"deployment_ids": ["<string>"],
"deployment_slugs": ["<string>"],
"model_names": ["<string>"],
"training_job_ids": ["<string>"],
"training_job_names": ["<string>"],
"model_repo_ids": ["<string>"],
"model_repo_names": ["<string>"],
"statuses": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_customer_id: '<string>',
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z',
sources: ['<string>'],
workspace_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
group_by: ['<string>'],
feature_ids: ['<string>'],
property_filters: {},
expand: ['<string>'],
deployment_ids: ['<string>'],
deployment_slugs: ['<string>'],
model_names: ['<string>'],
training_job_ids: ['<string>'],
training_job_names: ['<string>'],
model_repo_ids: ['<string>'],
model_repo_names: ['<string>'],
statuses: ['<string>']
})
};
fetch('https://api.app.simplismart.ai/usage/stats/', 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.app.simplismart.ai/usage/stats/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'external_customer_id' => '<string>',
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z',
'sources' => [
'<string>'
],
'workspace_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'group_by' => [
'<string>'
],
'feature_ids' => [
'<string>'
],
'property_filters' => [
],
'expand' => [
'<string>'
],
'deployment_ids' => [
'<string>'
],
'deployment_slugs' => [
'<string>'
],
'model_names' => [
'<string>'
],
'training_job_ids' => [
'<string>'
],
'training_job_names' => [
'<string>'
],
'model_repo_ids' => [
'<string>'
],
'model_repo_names' => [
'<string>'
],
'statuses' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.app.simplismart.ai/usage/stats/"
payload := strings.NewReader("{\n \"external_customer_id\": \"<string>\",\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"sources\": [\n \"<string>\"\n ],\n \"workspace_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"group_by\": [\n \"<string>\"\n ],\n \"feature_ids\": [\n \"<string>\"\n ],\n \"property_filters\": {},\n \"expand\": [\n \"<string>\"\n ],\n \"deployment_ids\": [\n \"<string>\"\n ],\n \"deployment_slugs\": [\n \"<string>\"\n ],\n \"model_names\": [\n \"<string>\"\n ],\n \"training_job_ids\": [\n \"<string>\"\n ],\n \"training_job_names\": [\n \"<string>\"\n ],\n \"model_repo_ids\": [\n \"<string>\"\n ],\n \"model_repo_names\": [\n \"<string>\"\n ],\n \"statuses\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.app.simplismart.ai/usage/stats/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_customer_id\": \"<string>\",\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"sources\": [\n \"<string>\"\n ],\n \"workspace_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"group_by\": [\n \"<string>\"\n ],\n \"feature_ids\": [\n \"<string>\"\n ],\n \"property_filters\": {},\n \"expand\": [\n \"<string>\"\n ],\n \"deployment_ids\": [\n \"<string>\"\n ],\n \"deployment_slugs\": [\n \"<string>\"\n ],\n \"model_names\": [\n \"<string>\"\n ],\n \"training_job_ids\": [\n \"<string>\"\n ],\n \"training_job_names\": [\n \"<string>\"\n ],\n \"model_repo_ids\": [\n \"<string>\"\n ],\n \"model_repo_names\": [\n \"<string>\"\n ],\n \"statuses\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.app.simplismart.ai/usage/stats/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_customer_id\": \"<string>\",\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"sources\": [\n \"<string>\"\n ],\n \"workspace_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"group_by\": [\n \"<string>\"\n ],\n \"feature_ids\": [\n \"<string>\"\n ],\n \"property_filters\": {},\n \"expand\": [\n \"<string>\"\n ],\n \"deployment_ids\": [\n \"<string>\"\n ],\n \"deployment_slugs\": [\n \"<string>\"\n ],\n \"model_names\": [\n \"<string>\"\n ],\n \"training_job_ids\": [\n \"<string>\"\n ],\n \"training_job_names\": [\n \"<string>\"\n ],\n \"model_repo_ids\": [\n \"<string>\"\n ],\n \"model_repo_names\": [\n \"<string>\"\n ],\n \"statuses\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [],
"total_cost": 0
}{
"error": "Provide either sources or id/name filters, not both"
}{
"error": "Failed to fetch sources for plan_type=X"
}Get Usage Analytics
Usage analytics from the billing engine. Requires the view_billing permission. The response is the billing engine result (items[], total_cost, …). Query skip_merge=true skips local merging.
curl --request POST \
--url https://api.app.simplismart.ai/usage/stats/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_customer_id": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"sources": [
"<string>"
],
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"group_by": [
"<string>"
],
"feature_ids": [
"<string>"
],
"property_filters": {},
"expand": [
"<string>"
],
"deployment_ids": [
"<string>"
],
"deployment_slugs": [
"<string>"
],
"model_names": [
"<string>"
],
"training_job_ids": [
"<string>"
],
"training_job_names": [
"<string>"
],
"model_repo_ids": [
"<string>"
],
"model_repo_names": [
"<string>"
],
"statuses": [
"<string>"
]
}
'import requests
url = "https://api.app.simplismart.ai/usage/stats/"
payload = {
"external_customer_id": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"sources": ["<string>"],
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"group_by": ["<string>"],
"feature_ids": ["<string>"],
"property_filters": {},
"expand": ["<string>"],
"deployment_ids": ["<string>"],
"deployment_slugs": ["<string>"],
"model_names": ["<string>"],
"training_job_ids": ["<string>"],
"training_job_names": ["<string>"],
"model_repo_ids": ["<string>"],
"model_repo_names": ["<string>"],
"statuses": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_customer_id: '<string>',
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z',
sources: ['<string>'],
workspace_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
group_by: ['<string>'],
feature_ids: ['<string>'],
property_filters: {},
expand: ['<string>'],
deployment_ids: ['<string>'],
deployment_slugs: ['<string>'],
model_names: ['<string>'],
training_job_ids: ['<string>'],
training_job_names: ['<string>'],
model_repo_ids: ['<string>'],
model_repo_names: ['<string>'],
statuses: ['<string>']
})
};
fetch('https://api.app.simplismart.ai/usage/stats/', 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.app.simplismart.ai/usage/stats/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'external_customer_id' => '<string>',
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z',
'sources' => [
'<string>'
],
'workspace_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'group_by' => [
'<string>'
],
'feature_ids' => [
'<string>'
],
'property_filters' => [
],
'expand' => [
'<string>'
],
'deployment_ids' => [
'<string>'
],
'deployment_slugs' => [
'<string>'
],
'model_names' => [
'<string>'
],
'training_job_ids' => [
'<string>'
],
'training_job_names' => [
'<string>'
],
'model_repo_ids' => [
'<string>'
],
'model_repo_names' => [
'<string>'
],
'statuses' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.app.simplismart.ai/usage/stats/"
payload := strings.NewReader("{\n \"external_customer_id\": \"<string>\",\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"sources\": [\n \"<string>\"\n ],\n \"workspace_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"group_by\": [\n \"<string>\"\n ],\n \"feature_ids\": [\n \"<string>\"\n ],\n \"property_filters\": {},\n \"expand\": [\n \"<string>\"\n ],\n \"deployment_ids\": [\n \"<string>\"\n ],\n \"deployment_slugs\": [\n \"<string>\"\n ],\n \"model_names\": [\n \"<string>\"\n ],\n \"training_job_ids\": [\n \"<string>\"\n ],\n \"training_job_names\": [\n \"<string>\"\n ],\n \"model_repo_ids\": [\n \"<string>\"\n ],\n \"model_repo_names\": [\n \"<string>\"\n ],\n \"statuses\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.app.simplismart.ai/usage/stats/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_customer_id\": \"<string>\",\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"sources\": [\n \"<string>\"\n ],\n \"workspace_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"group_by\": [\n \"<string>\"\n ],\n \"feature_ids\": [\n \"<string>\"\n ],\n \"property_filters\": {},\n \"expand\": [\n \"<string>\"\n ],\n \"deployment_ids\": [\n \"<string>\"\n ],\n \"deployment_slugs\": [\n \"<string>\"\n ],\n \"model_names\": [\n \"<string>\"\n ],\n \"training_job_ids\": [\n \"<string>\"\n ],\n \"training_job_names\": [\n \"<string>\"\n ],\n \"model_repo_ids\": [\n \"<string>\"\n ],\n \"model_repo_names\": [\n \"<string>\"\n ],\n \"statuses\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.app.simplismart.ai/usage/stats/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_customer_id\": \"<string>\",\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"sources\": [\n \"<string>\"\n ],\n \"workspace_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"group_by\": [\n \"<string>\"\n ],\n \"feature_ids\": [\n \"<string>\"\n ],\n \"property_filters\": {},\n \"expand\": [\n \"<string>\"\n ],\n \"deployment_ids\": [\n \"<string>\"\n ],\n \"deployment_slugs\": [\n \"<string>\"\n ],\n \"model_names\": [\n \"<string>\"\n ],\n \"training_job_ids\": [\n \"<string>\"\n ],\n \"training_job_names\": [\n \"<string>\"\n ],\n \"model_repo_ids\": [\n \"<string>\"\n ],\n \"model_repo_names\": [\n \"<string>\"\n ],\n \"statuses\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [],
"total_cost": 0
}{
"error": "Provide either sources or id/name filters, not both"
}{
"error": "Failed to fetch sources for plan_type=X"
}Authorizations
Simplismart API key (Settings > API Keys).
Query Parameters
Skip local merging of the response.
Body
Defaults to your organisation.
Start of range.
End of range.
Plan to report on. Setting it enables automatic source selection.
shared, private, byoc, reserved, compilation, training Cannot be combined with id/name filters.
Used for automatic source selection.
Any of source, feature_id, properties.token_uuid, properties.user_id.
Aggregation window.
MINUTE, 15MIN, 30MIN, HOUR, 3HOUR, 6HOUR, 12HOUR, DAY, WEEK Keys: token_uuid, user_id, billing_class, workload, gpu_type. Token and user IDs must belong to your org.
Defaults to ["price"].
Only for plan_type private, byoc, reserved.
Same as above.
plan_type shared only.
plan_type training only.
plan_type training only.
plan_type compilation only.
plan_type compilation only.
Restrict by status.