curl --request GET \
--url https://api.together.ai/v2/projects/{projectId}/endpoints/{id}/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.together.ai/v2/projects/{projectId}/endpoints/{id}/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.together.ai/v2/projects/{projectId}/endpoints/{id}/analytics', 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.together.ai/v2/projects/{projectId}/endpoints/{id}/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.together.ai/v2/projects/{projectId}/endpoints/{id}/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.together.ai/v2/projects/{projectId}/endpoints/{id}/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v2/projects/{projectId}/endpoints/{id}/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"endpointId": "<string>",
"timeRange": {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z"
},
"metrics": {
"endpointId": "<string>",
"timeRange": {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z"
},
"requestMetrics": {
"totalRequests": "<string>",
"successfulRequests": "<string>",
"failedRequests": "<string>",
"requestsPerSecond": 123,
"requestsByStatusCode": {}
},
"latencyMetrics": {
"ttftP50Ms": 123,
"ttftP90Ms": 123,
"ttftP99Ms": 123,
"latencyP50Ms": 123,
"latencyP90Ms": 123,
"latencyP99Ms": 123,
"itlP50Ms": 123,
"itlP90Ms": 123,
"itlP99Ms": 123
},
"throughputMetrics": {
"tokensPerSecond": 123,
"requestsPerSecond": 123,
"avgBatchSize": 123,
"avgBatchDepth": 123
},
"errorMetrics": {
"errorRate": 123,
"errorsByType": {}
},
"resourceUtilization": {
"cpuUtilization": 123,
"gpuUtilization": 123,
"memoryUtilization": 123,
"gpuMemoryUtilization": 123,
"networkBandwidthMbps": 123
},
"tokenMetrics": {
"totalInputTokens": "<string>",
"totalOutputTokens": "<string>",
"avgInputTokens": 123,
"avgOutputTokens": 123
},
"deploymentMetrics": [
{
"deploymentId": "<string>",
"endpointId": "<string>",
"timeRange": {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z"
},
"requestMetrics": {
"totalRequests": "<string>",
"successfulRequests": "<string>",
"failedRequests": "<string>",
"requestsPerSecond": 123,
"requestsByStatusCode": {}
},
"latencyMetrics": {
"ttftP50Ms": 123,
"ttftP90Ms": 123,
"ttftP99Ms": 123,
"latencyP50Ms": 123,
"latencyP90Ms": 123,
"latencyP99Ms": 123,
"itlP50Ms": 123,
"itlP90Ms": 123,
"itlP99Ms": 123
},
"throughputMetrics": {
"tokensPerSecond": 123,
"requestsPerSecond": 123,
"avgBatchSize": 123,
"avgBatchDepth": 123
},
"errorMetrics": {
"errorRate": 123,
"errorsByType": {}
},
"resourceUtilization": {
"cpuUtilization": 123,
"gpuUtilization": 123,
"memoryUtilization": 123,
"gpuMemoryUtilization": 123,
"networkBandwidthMbps": 123
},
"tokenMetrics": {
"totalInputTokens": "<string>",
"totalOutputTokens": "<string>",
"avgInputTokens": 123,
"avgOutputTokens": 123
}
}
]
},
"timeSeries": [
{
"timestamp": "2023-11-07T05:31:56Z",
"values": {}
}
],
"deploymentAnalytics": [
{
"deploymentId": "<string>",
"endpointId": "<string>",
"timeRange": {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z"
},
"metrics": {
"deploymentId": "<string>",
"endpointId": "<string>",
"timeRange": {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z"
},
"requestMetrics": {
"totalRequests": "<string>",
"successfulRequests": "<string>",
"failedRequests": "<string>",
"requestsPerSecond": 123,
"requestsByStatusCode": {}
},
"latencyMetrics": {
"ttftP50Ms": 123,
"ttftP90Ms": 123,
"ttftP99Ms": 123,
"latencyP50Ms": 123,
"latencyP90Ms": 123,
"latencyP99Ms": 123,
"itlP50Ms": 123,
"itlP90Ms": 123,
"itlP99Ms": 123
},
"throughputMetrics": {
"tokensPerSecond": 123,
"requestsPerSecond": 123,
"avgBatchSize": 123,
"avgBatchDepth": 123
},
"errorMetrics": {
"errorRate": 123,
"errorsByType": {}
},
"resourceUtilization": {
"cpuUtilization": 123,
"gpuUtilization": 123,
"memoryUtilization": 123,
"gpuMemoryUtilization": 123,
"networkBandwidthMbps": 123
},
"tokenMetrics": {
"totalInputTokens": "<string>",
"totalOutputTokens": "<string>",
"avgInputTokens": 123,
"avgOutputTokens": 123
}
},
"timeSeries": [
{
"timestamp": "2023-11-07T05:31:56Z",
"values": {}
}
]
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Get endpoint analytics
Returns aggregated request, token, latency, throughput, error, and resource-utilization metrics for an endpoint over a time range. Optionally includes time-series buckets and a per-deployment breakdown.
curl --request GET \
--url https://api.together.ai/v2/projects/{projectId}/endpoints/{id}/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.together.ai/v2/projects/{projectId}/endpoints/{id}/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.together.ai/v2/projects/{projectId}/endpoints/{id}/analytics', 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.together.ai/v2/projects/{projectId}/endpoints/{id}/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.together.ai/v2/projects/{projectId}/endpoints/{id}/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.together.ai/v2/projects/{projectId}/endpoints/{id}/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v2/projects/{projectId}/endpoints/{id}/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"endpointId": "<string>",
"timeRange": {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z"
},
"metrics": {
"endpointId": "<string>",
"timeRange": {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z"
},
"requestMetrics": {
"totalRequests": "<string>",
"successfulRequests": "<string>",
"failedRequests": "<string>",
"requestsPerSecond": 123,
"requestsByStatusCode": {}
},
"latencyMetrics": {
"ttftP50Ms": 123,
"ttftP90Ms": 123,
"ttftP99Ms": 123,
"latencyP50Ms": 123,
"latencyP90Ms": 123,
"latencyP99Ms": 123,
"itlP50Ms": 123,
"itlP90Ms": 123,
"itlP99Ms": 123
},
"throughputMetrics": {
"tokensPerSecond": 123,
"requestsPerSecond": 123,
"avgBatchSize": 123,
"avgBatchDepth": 123
},
"errorMetrics": {
"errorRate": 123,
"errorsByType": {}
},
"resourceUtilization": {
"cpuUtilization": 123,
"gpuUtilization": 123,
"memoryUtilization": 123,
"gpuMemoryUtilization": 123,
"networkBandwidthMbps": 123
},
"tokenMetrics": {
"totalInputTokens": "<string>",
"totalOutputTokens": "<string>",
"avgInputTokens": 123,
"avgOutputTokens": 123
},
"deploymentMetrics": [
{
"deploymentId": "<string>",
"endpointId": "<string>",
"timeRange": {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z"
},
"requestMetrics": {
"totalRequests": "<string>",
"successfulRequests": "<string>",
"failedRequests": "<string>",
"requestsPerSecond": 123,
"requestsByStatusCode": {}
},
"latencyMetrics": {
"ttftP50Ms": 123,
"ttftP90Ms": 123,
"ttftP99Ms": 123,
"latencyP50Ms": 123,
"latencyP90Ms": 123,
"latencyP99Ms": 123,
"itlP50Ms": 123,
"itlP90Ms": 123,
"itlP99Ms": 123
},
"throughputMetrics": {
"tokensPerSecond": 123,
"requestsPerSecond": 123,
"avgBatchSize": 123,
"avgBatchDepth": 123
},
"errorMetrics": {
"errorRate": 123,
"errorsByType": {}
},
"resourceUtilization": {
"cpuUtilization": 123,
"gpuUtilization": 123,
"memoryUtilization": 123,
"gpuMemoryUtilization": 123,
"networkBandwidthMbps": 123
},
"tokenMetrics": {
"totalInputTokens": "<string>",
"totalOutputTokens": "<string>",
"avgInputTokens": 123,
"avgOutputTokens": 123
}
}
]
},
"timeSeries": [
{
"timestamp": "2023-11-07T05:31:56Z",
"values": {}
}
],
"deploymentAnalytics": [
{
"deploymentId": "<string>",
"endpointId": "<string>",
"timeRange": {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z"
},
"metrics": {
"deploymentId": "<string>",
"endpointId": "<string>",
"timeRange": {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z"
},
"requestMetrics": {
"totalRequests": "<string>",
"successfulRequests": "<string>",
"failedRequests": "<string>",
"requestsPerSecond": 123,
"requestsByStatusCode": {}
},
"latencyMetrics": {
"ttftP50Ms": 123,
"ttftP90Ms": 123,
"ttftP99Ms": 123,
"latencyP50Ms": 123,
"latencyP90Ms": 123,
"latencyP99Ms": 123,
"itlP50Ms": 123,
"itlP90Ms": 123,
"itlP99Ms": 123
},
"throughputMetrics": {
"tokensPerSecond": 123,
"requestsPerSecond": 123,
"avgBatchSize": 123,
"avgBatchDepth": 123
},
"errorMetrics": {
"errorRate": 123,
"errorsByType": {}
},
"resourceUtilization": {
"cpuUtilization": 123,
"gpuUtilization": 123,
"memoryUtilization": 123,
"gpuMemoryUtilization": 123,
"networkBandwidthMbps": 123
},
"tokenMetrics": {
"totalInputTokens": "<string>",
"totalOutputTokens": "<string>",
"avgInputTokens": 123,
"avgOutputTokens": 123
}
},
"timeSeries": [
{
"timestamp": "2023-11-07T05:31:56Z",
"values": {}
}
]
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Restrict to a single deployment under this endpoint.
Inclusive start of the time range. Defaults to 24 hours ago if unset.
Exclusive end of the time range. Defaults to now if unset.
When true, include per-bucket time series in the response.
Time-series bucket duration, such as 1m, 1h, or 1d. Defaults to 1d.
Response
OK
Endpoint-wide usage and performance analytics with optional time-series and per-deployment breakdowns.
ID of the endpoint summarized by these analytics.
Closed-open time range covered by the analytics.
Show child attributes
Show child attributes
Aggregated metrics over the time range.
Show child attributes
Show child attributes
Per-bucket metric samples, included only when includeTimeSeries is true.
Show child attributes
Show child attributes
Per-deployment analytics.
Show child attributes
Show child attributes
Was this page helpful?