Deployments
List deployments
Lists the deployments attached to an endpoint, including their model, configuration, scaling settings, placement, and current status.
GET
/
v2
/
projects
/
{projectId}
/
endpoints
/
{endpointId}
/
deployments
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
deployments = client.endpoints.deployments.list(
"ep_abc123",
project_id=project_id,
)
for deployment in deployments:
print(deployment.id, deployment.name, deployment.status)
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 deployments = client.endpoints.deployments.list("ep_abc123", {
projectId,
});
for await (const deployment of deployments) {
console.log(deployment.id, deployment.name, deployment.status);
}
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 deployments = client.endpoints.deployments.list("ep_abc123", {
projectId,
});
for await (const deployment of deployments) {
console.log(deployment.id, deployment.name, deployment.status);
}
curl --request GET \
--url https://api.together.ai/v2/projects/{projectId}/endpoints/{endpointId}/deployments \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v2/projects/{projectId}/endpoints/{endpointId}/deployments",
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}/deployments"
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}/deployments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v2/projects/{projectId}/endpoints/{endpointId}/deployments")
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>",
"projectId": "<string>",
"endpointId": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"modelId": "<string>",
"modelRevisionId": "<string>",
"model": "<string>",
"autoscaling": {
"minReplicas": 123,
"maxReplicas": 123,
"scaleDownWindow": "<string>",
"scaleUpWindow": "<string>",
"scaleToZeroWindow": "<string>",
"scalingMetrics": [
{
"name": "active_sessions",
"type": "METRIC_TARGET_TYPE_VALUE",
"target": 123,
"percentile": "<string>"
}
],
"scaleUp": {
"policies": [
{
"type": "SCALING_POLICY_TYPE_PERCENT",
"value": 25,
"periodSeconds": 60
},
{
"type": "SCALING_POLICY_TYPE_PODS",
"value": 10,
"periodSeconds": 60
}
],
"selectPolicy": "SCALING_POLICY_SELECT_MIN"
},
"scaleDown": {
"policies": [
{
"type": "SCALING_POLICY_TYPE_PERCENT",
"value": 25,
"periodSeconds": 60
},
{
"type": "SCALING_POLICY_TYPE_PODS",
"value": 10,
"periodSeconds": 60
}
],
"selectPolicy": "SCALING_POLICY_SELECT_MIN"
}
},
"configId": "<string>",
"config": "<string>",
"etag": "<string>",
"hardware": "<string>",
"trafficMode": "TRAFFIC_MODE_LIVE",
"status": {
"state": "DEPLOYMENT_STATE_PROVISIONING",
"message": "<string>",
"readyReplicas": 123,
"scheduledReplicas": 123,
"details": {
"region": [
{
"region": "<string>",
"scheduledReplicas": 123,
"readyReplicas": 123
}
]
}
},
"speculatorId": "<string>",
"speculatorRevisionId": "<string>",
"speculator": "<string>",
"estimatedEffectiveTrafficShare": 123,
"maxConcurrentRequestsPerReplica": "<string>",
"inactiveTimeout": 123,
"runtimeInfo": {
"engineType": "<string>",
"engineVersion": "<string>",
"functionCallingSupported": true,
"structuredOutputSupported": true
},
"desiredReplicas": 123,
"placement": {
"inline": {
"regions": [
"<string>"
],
"constraint": "ENFORCEMENT_REQUIRED",
"compliancePolicy": {
"hipaa": true
}
}
}
}
],
"object": "list",
"next_cursor": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Authorizations
Path Parameters
Query Parameters
Filter expression using name, state, model, created_at, or updated_at with comparison operators and AND/OR/NOT; state takes a DeploymentState enum name and model takes a model resource name. name supports substring matching with : and prefix/suffix wildcards with *, and accepts a bare deployment name or <project_slug>/<endpoint_name>/<deployment_name>.
Was this page helpful?
⌘I
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
deployments = client.endpoints.deployments.list(
"ep_abc123",
project_id=project_id,
)
for deployment in deployments:
print(deployment.id, deployment.name, deployment.status)
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 deployments = client.endpoints.deployments.list("ep_abc123", {
projectId,
});
for await (const deployment of deployments) {
console.log(deployment.id, deployment.name, deployment.status);
}
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 deployments = client.endpoints.deployments.list("ep_abc123", {
projectId,
});
for await (const deployment of deployments) {
console.log(deployment.id, deployment.name, deployment.status);
}
curl --request GET \
--url https://api.together.ai/v2/projects/{projectId}/endpoints/{endpointId}/deployments \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v2/projects/{projectId}/endpoints/{endpointId}/deployments",
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}/deployments"
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}/deployments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v2/projects/{projectId}/endpoints/{endpointId}/deployments")
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>",
"projectId": "<string>",
"endpointId": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"modelId": "<string>",
"modelRevisionId": "<string>",
"model": "<string>",
"autoscaling": {
"minReplicas": 123,
"maxReplicas": 123,
"scaleDownWindow": "<string>",
"scaleUpWindow": "<string>",
"scaleToZeroWindow": "<string>",
"scalingMetrics": [
{
"name": "active_sessions",
"type": "METRIC_TARGET_TYPE_VALUE",
"target": 123,
"percentile": "<string>"
}
],
"scaleUp": {
"policies": [
{
"type": "SCALING_POLICY_TYPE_PERCENT",
"value": 25,
"periodSeconds": 60
},
{
"type": "SCALING_POLICY_TYPE_PODS",
"value": 10,
"periodSeconds": 60
}
],
"selectPolicy": "SCALING_POLICY_SELECT_MIN"
},
"scaleDown": {
"policies": [
{
"type": "SCALING_POLICY_TYPE_PERCENT",
"value": 25,
"periodSeconds": 60
},
{
"type": "SCALING_POLICY_TYPE_PODS",
"value": 10,
"periodSeconds": 60
}
],
"selectPolicy": "SCALING_POLICY_SELECT_MIN"
}
},
"configId": "<string>",
"config": "<string>",
"etag": "<string>",
"hardware": "<string>",
"trafficMode": "TRAFFIC_MODE_LIVE",
"status": {
"state": "DEPLOYMENT_STATE_PROVISIONING",
"message": "<string>",
"readyReplicas": 123,
"scheduledReplicas": 123,
"details": {
"region": [
{
"region": "<string>",
"scheduledReplicas": 123,
"readyReplicas": 123
}
]
}
},
"speculatorId": "<string>",
"speculatorRevisionId": "<string>",
"speculator": "<string>",
"estimatedEffectiveTrafficShare": 123,
"maxConcurrentRequestsPerReplica": "<string>",
"inactiveTimeout": 123,
"runtimeInfo": {
"engineType": "<string>",
"engineVersion": "<string>",
"functionCallingSupported": true,
"structuredOutputSupported": true
},
"desiredReplicas": 123,
"placement": {
"inline": {
"regions": [
"<string>"
],
"constraint": "ENFORCEMENT_REQUIRED",
"compliancePolicy": {
"hipaa": true
}
}
}
}
],
"object": "list",
"next_cursor": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}