Together AI SDK (Python)
from together import Together
client = Together()
identity = client.whoami()
if identity.type != "project_api_key":
raise RuntimeError("TOGETHER_API_KEY must be a project API key")
project_id = identity.project.id
rollouts = client.endpoints.rollouts.list(
"ep_abc123",
project_id=project_id,
)
for rollout in rollouts:
print(rollout.id, rollout.state)import Together from "together-ai";
const client = new Together();
const identity = await client.whoami();
if (identity.type !== "project_api_key") {
throw new Error("TOGETHER_API_KEY must be a project API key");
}
const projectId = identity.project.id;
const rollouts = client.endpoints.rollouts.list("ep_abc123", {
projectId,
});
for await (const rollout of rollouts) {
console.log(rollout.id, rollout.state);
}
import Together from "together-ai";
const client = new Together();
const identity = await client.whoami();
if (identity.type !== "project_api_key") {
throw new Error("TOGETHER_API_KEY must be a project API key");
}
const projectId = identity.project.id;
const rollouts = client.endpoints.rollouts.list("ep_abc123", {
projectId,
});
for await (const rollout of rollouts) {
console.log(rollout.id, rollout.state);
}
curl --request GET \
--url https://api.together.ai/v2/projects/{projectId}/endpoints/{endpointId}/rollouts \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v2/projects/{projectId}/endpoints/{endpointId}/rollouts",
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/{endpointId}/rollouts"
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/{endpointId}/rollouts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v2/projects/{projectId}/endpoints/{endpointId}/rollouts")
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{
"data": [
{
"id": "<string>",
"endpointId": "<string>",
"sourceDeploymentId": "<string>",
"targetDeploymentId": "<string>",
"strategy": "ROLLOUT_STRATEGY_TYPE_ROLLING",
"state": "ROLLOUT_STATE_RUNNING",
"createdAt": "2023-11-07T05:31:56Z",
"status": {
"totalSteps": 123,
"steps": [
{
"stepIndex": 123,
"targetTrafficPercent": 123,
"state": "ROLLOUT_STEP_STATE_PENDING",
"metrics": [
{
"name": "<string>",
"stat": "METRIC_STAT_TYPE_AVG",
"percentile": 123,
"check": "METRIC_CHECK_TYPE_THRESHOLD",
"sourceValue": 123,
"targetValue": 123,
"threshold": 123,
"operator": "THRESHOLD_OPERATOR_GT",
"maxRegressionPercent": 123,
"direction": "REGRESSION_DIRECTION_HIGHER_IS_WORSE",
"verdict": "METRIC_VERDICT_PASS",
"failureReason": "<string>"
}
],
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"failureReason": "<string>"
}
],
"condition": {
"category": "ROLLOUT_FAILURE_CATEGORY_METRIC_REGRESSION",
"message": "<string>",
"atStep": 123,
"observedAt": "2023-11-07T05:31:56Z",
"metrics": [
{
"name": "<string>",
"stat": "METRIC_STAT_TYPE_AVG",
"percentile": 123,
"check": "METRIC_CHECK_TYPE_THRESHOLD",
"sourceValue": 123,
"targetValue": 123,
"threshold": 123,
"operator": "THRESHOLD_OPERATOR_GT",
"maxRegressionPercent": 123,
"direction": "REGRESSION_DIRECTION_HIGHER_IS_WORSE",
"verdict": "METRIC_VERDICT_PASS",
"failureReason": "<string>"
}
],
"type": "CapacityLimited"
},
"updatedAt": "2023-11-07T05:31:56Z",
"conditions": [
{
"category": "ROLLOUT_FAILURE_CATEGORY_METRIC_REGRESSION",
"message": "<string>",
"atStep": 123,
"observedAt": "2023-11-07T05:31:56Z",
"metrics": [
{
"name": "<string>",
"stat": "METRIC_STAT_TYPE_AVG",
"percentile": 123,
"check": "METRIC_CHECK_TYPE_THRESHOLD",
"sourceValue": 123,
"targetValue": 123,
"threshold": 123,
"operator": "THRESHOLD_OPERATOR_GT",
"maxRegressionPercent": 123,
"direction": "REGRESSION_DIRECTION_HIGHER_IS_WORSE",
"verdict": "METRIC_VERDICT_PASS",
"failureReason": "<string>"
}
],
"type": "CapacityLimited"
}
]
},
"currentStep": 123,
"currentTrafficPercent": 123,
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"etag": "<string>",
"pauseInfo": {
"pausedAt": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
],
"object": "list",
"next_cursor": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Rollouts
List endpoint rollouts
Lists rollout histories for an endpoint. Use filter=ROLLOUT_FILTER_ACTIVE to return only the active rollout, if one exists.
GET
/
v2
/
projects
/
{projectId}
/
endpoints
/
{endpointId}
/
rollouts
Together AI SDK (Python)
from together import Together
client = Together()
identity = client.whoami()
if identity.type != "project_api_key":
raise RuntimeError("TOGETHER_API_KEY must be a project API key")
project_id = identity.project.id
rollouts = client.endpoints.rollouts.list(
"ep_abc123",
project_id=project_id,
)
for rollout in rollouts:
print(rollout.id, rollout.state)import Together from "together-ai";
const client = new Together();
const identity = await client.whoami();
if (identity.type !== "project_api_key") {
throw new Error("TOGETHER_API_KEY must be a project API key");
}
const projectId = identity.project.id;
const rollouts = client.endpoints.rollouts.list("ep_abc123", {
projectId,
});
for await (const rollout of rollouts) {
console.log(rollout.id, rollout.state);
}
import Together from "together-ai";
const client = new Together();
const identity = await client.whoami();
if (identity.type !== "project_api_key") {
throw new Error("TOGETHER_API_KEY must be a project API key");
}
const projectId = identity.project.id;
const rollouts = client.endpoints.rollouts.list("ep_abc123", {
projectId,
});
for await (const rollout of rollouts) {
console.log(rollout.id, rollout.state);
}
curl --request GET \
--url https://api.together.ai/v2/projects/{projectId}/endpoints/{endpointId}/rollouts \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v2/projects/{projectId}/endpoints/{endpointId}/rollouts",
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/{endpointId}/rollouts"
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/{endpointId}/rollouts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v2/projects/{projectId}/endpoints/{endpointId}/rollouts")
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{
"data": [
{
"id": "<string>",
"endpointId": "<string>",
"sourceDeploymentId": "<string>",
"targetDeploymentId": "<string>",
"strategy": "ROLLOUT_STRATEGY_TYPE_ROLLING",
"state": "ROLLOUT_STATE_RUNNING",
"createdAt": "2023-11-07T05:31:56Z",
"status": {
"totalSteps": 123,
"steps": [
{
"stepIndex": 123,
"targetTrafficPercent": 123,
"state": "ROLLOUT_STEP_STATE_PENDING",
"metrics": [
{
"name": "<string>",
"stat": "METRIC_STAT_TYPE_AVG",
"percentile": 123,
"check": "METRIC_CHECK_TYPE_THRESHOLD",
"sourceValue": 123,
"targetValue": 123,
"threshold": 123,
"operator": "THRESHOLD_OPERATOR_GT",
"maxRegressionPercent": 123,
"direction": "REGRESSION_DIRECTION_HIGHER_IS_WORSE",
"verdict": "METRIC_VERDICT_PASS",
"failureReason": "<string>"
}
],
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"failureReason": "<string>"
}
],
"condition": {
"category": "ROLLOUT_FAILURE_CATEGORY_METRIC_REGRESSION",
"message": "<string>",
"atStep": 123,
"observedAt": "2023-11-07T05:31:56Z",
"metrics": [
{
"name": "<string>",
"stat": "METRIC_STAT_TYPE_AVG",
"percentile": 123,
"check": "METRIC_CHECK_TYPE_THRESHOLD",
"sourceValue": 123,
"targetValue": 123,
"threshold": 123,
"operator": "THRESHOLD_OPERATOR_GT",
"maxRegressionPercent": 123,
"direction": "REGRESSION_DIRECTION_HIGHER_IS_WORSE",
"verdict": "METRIC_VERDICT_PASS",
"failureReason": "<string>"
}
],
"type": "CapacityLimited"
},
"updatedAt": "2023-11-07T05:31:56Z",
"conditions": [
{
"category": "ROLLOUT_FAILURE_CATEGORY_METRIC_REGRESSION",
"message": "<string>",
"atStep": 123,
"observedAt": "2023-11-07T05:31:56Z",
"metrics": [
{
"name": "<string>",
"stat": "METRIC_STAT_TYPE_AVG",
"percentile": 123,
"check": "METRIC_CHECK_TYPE_THRESHOLD",
"sourceValue": 123,
"targetValue": 123,
"threshold": 123,
"operator": "THRESHOLD_OPERATOR_GT",
"maxRegressionPercent": 123,
"direction": "REGRESSION_DIRECTION_HIGHER_IS_WORSE",
"verdict": "METRIC_VERDICT_PASS",
"failureReason": "<string>"
}
],
"type": "CapacityLimited"
}
]
},
"currentStep": 123,
"currentTrafficPercent": 123,
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"etag": "<string>",
"pauseInfo": {
"pausedAt": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
],
"object": "list",
"next_cursor": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Project identifier.
Endpoint identifier.
Query Parameters
Maximum number of rollouts to return. Max 500, defaults to 50.
Cursor from a previous rollout list response.
Narrow results to active or terminal rollouts. Omit to list all rollouts.
Available options:
ROLLOUT_FILTER_ACTIVE, ROLLOUT_FILTER_TERMINAL Was this page helpful?
⌘I