Together AI SDK (v2)
from together import Together
import os
client = Together(
api_key=os.environ.get("TOGETHER_API_KEY"),
)
response = client.beta.clusters.list()
print(response.clusters)import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const response = await client.beta.clusters.list();
console.log(response.clusters);import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const response = await client.beta.clusters.list();
console.log(response.clusters);tg beta clusters list<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v1/compute/clusters",
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/v1/compute/clusters"
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/v1/compute/clusters")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v1/compute/clusters")
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{
"clusters": [
{
"cluster_id": "<string>",
"region": "<string>",
"cluster_name": "<string>",
"volumes": [
{
"volume_id": "<string>",
"volume_name": "<string>",
"size_tib": 123,
"status": "<string>"
}
],
"control_plane_nodes": [
{
"node_id": "<string>",
"status": "<string>",
"host_name": "<string>",
"num_cpu_cores": 123,
"memory_gib": 123,
"network": "<string>",
"phase_transitions": [
{
"transition_time": "2023-11-07T05:31:56Z"
}
],
"public_ipv4": "<string>"
}
],
"gpu_worker_nodes": [
{
"node_id": "<string>",
"status": "<string>",
"host_name": "<string>",
"num_cpu_cores": 123,
"num_gpus": 123,
"memory_gib": 123,
"networks": [
"<string>"
],
"phase_transitions": [
{
"transition_time": "2023-11-07T05:31:56Z"
}
],
"instance_id": "<string>",
"latest_remediation": {
"id": "<string>",
"cluster_id": "<string>",
"instance_id": "<string>",
"reason": "<string>",
"active_health_check_run_id": "<string>",
"passive_health_check_event_id": "<string>",
"requested_by": "<string>",
"create_time": "2023-11-07T05:31:56Z",
"reviewed_by": "<string>",
"review_time": "2023-11-07T05:31:56Z",
"review_comment": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"error_message": "<string>",
"update_time": "2023-11-07T05:31:56Z",
"instance_name": "<string>",
"linked_alerts": [
{
"passive_health_check_alert_id": "<string>",
"cluster_id": "<string>",
"target_vm": "<string>",
"alert_name": "<string>",
"annotations": {},
"started_at": "2023-11-07T05:31:56Z",
"instance_id": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"node_remediation_intent_id": "<string>"
}
]
},
"slurm_worker_hostname": "<string>",
"marked_for_deletion": true,
"public_ipv4": "<string>",
"ib_hca_type": "<string>",
"ib_hca_count": 123,
"nvswitch_count": 123,
"nvswitch_type": "<string>",
"ephemeral_storage": "<string>",
"auto_remediation_enabled": true,
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"kube_config": "<string>",
"num_gpus": 123,
"cuda_version": "<string>",
"nvidia_driver_version": "<string>",
"project_id": "<string>",
"num_cpu_workers": 123,
"phase_transitions": [
{
"transition_time": "2023-11-07T05:31:56Z"
}
],
"desired_preemptible_gpus": 123,
"allocated_preemptible_gpus": 123,
"add_ons": [
{
"name": "<string>",
"add_on_type": "<string>",
"config": {
"dashboard": {
"enabled": true
},
"ingress": {
"enabled": true
},
"torchpass": {
"enabled": true
}
},
"state": {
"dashboard": {},
"ingress": {},
"torchpass": {}
}
}
],
"num_capacity_pool_gpus": 123,
"num_reserved_gpus": 123,
"duration_hours": 123,
"slurm_shm_size_gib": 123,
"capacity_pool_id": "<string>",
"reservation_start_time": "2023-11-07T05:31:56Z",
"reservation_end_time": "2023-11-07T05:31:56Z",
"install_traefik": true,
"created_at": "2023-11-07T05:31:56Z",
"oidc_config": {
"issuer_url": "<string>",
"client_id": "<string>",
"username_claim": "<string>",
"username_prefix": "<string>",
"group_claim": "<string>",
"group_prefix": "<string>",
"ca_cert": "<string>"
},
"cluster_config": {
"kubernetes_dashboard_enabled": true,
"jumphost_enabled": true,
"slurm_startup_scripts": {
"worker_prolog": "<string>",
"worker_epilog": "<string>",
"controller_prolog": "<string>",
"controller_epilog": "<string>",
"login_init_script": "<string>",
"nodeset_init_script": "<string>",
"extra_slurm_conf": "<string>"
},
"ingress": {
"enabled": true
},
"observability": {
"enabled": true
},
"gpu_operator_version": "<string>",
"network_operator_version": "<string>",
"ssh_ca_enabled": true
},
"machine_cluster_id": "<string>",
"first_ready_at": "2023-11-07T05:31:56Z",
"is_in_substrate": true,
"control_plane_ready": true,
"ums_project_id": "<string>",
"ums_org_id": "<string>",
"os_image": "<string>",
"nvidia_driver_version_id": "<string>",
"deleted_gpu_worker_nodes": [
{
"node_id": "<string>",
"status": "<string>",
"host_name": "<string>",
"num_cpu_cores": 123,
"num_gpus": 123,
"memory_gib": 123,
"networks": [
"<string>"
],
"phase_transitions": [
{
"transition_time": "2023-11-07T05:31:56Z"
}
],
"instance_id": "<string>",
"latest_remediation": {
"id": "<string>",
"cluster_id": "<string>",
"instance_id": "<string>",
"reason": "<string>",
"active_health_check_run_id": "<string>",
"passive_health_check_event_id": "<string>",
"requested_by": "<string>",
"create_time": "2023-11-07T05:31:56Z",
"reviewed_by": "<string>",
"review_time": "2023-11-07T05:31:56Z",
"review_comment": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"error_message": "<string>",
"update_time": "2023-11-07T05:31:56Z",
"instance_name": "<string>",
"linked_alerts": [
{
"passive_health_check_alert_id": "<string>",
"cluster_id": "<string>",
"target_vm": "<string>",
"alert_name": "<string>",
"annotations": {},
"started_at": "2023-11-07T05:31:56Z",
"instance_id": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"node_remediation_intent_id": "<string>"
}
]
},
"slurm_worker_hostname": "<string>",
"marked_for_deletion": true,
"public_ipv4": "<string>",
"ib_hca_type": "<string>",
"ib_hca_count": 123,
"nvswitch_count": 123,
"nvswitch_type": "<string>",
"ephemeral_storage": "<string>",
"auto_remediation_enabled": true,
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"node_lifecycle_events": [
{
"node_id": "<string>",
"reason": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
]
}
]
}Clusters
List all GPU clusters
List all GPU clusters.
GET
/
compute
/
clusters
Together AI SDK (v2)
from together import Together
import os
client = Together(
api_key=os.environ.get("TOGETHER_API_KEY"),
)
response = client.beta.clusters.list()
print(response.clusters)import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const response = await client.beta.clusters.list();
console.log(response.clusters);import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const response = await client.beta.clusters.list();
console.log(response.clusters);tg beta clusters list<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v1/compute/clusters",
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/v1/compute/clusters"
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/v1/compute/clusters")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v1/compute/clusters")
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{
"clusters": [
{
"cluster_id": "<string>",
"region": "<string>",
"cluster_name": "<string>",
"volumes": [
{
"volume_id": "<string>",
"volume_name": "<string>",
"size_tib": 123,
"status": "<string>"
}
],
"control_plane_nodes": [
{
"node_id": "<string>",
"status": "<string>",
"host_name": "<string>",
"num_cpu_cores": 123,
"memory_gib": 123,
"network": "<string>",
"phase_transitions": [
{
"transition_time": "2023-11-07T05:31:56Z"
}
],
"public_ipv4": "<string>"
}
],
"gpu_worker_nodes": [
{
"node_id": "<string>",
"status": "<string>",
"host_name": "<string>",
"num_cpu_cores": 123,
"num_gpus": 123,
"memory_gib": 123,
"networks": [
"<string>"
],
"phase_transitions": [
{
"transition_time": "2023-11-07T05:31:56Z"
}
],
"instance_id": "<string>",
"latest_remediation": {
"id": "<string>",
"cluster_id": "<string>",
"instance_id": "<string>",
"reason": "<string>",
"active_health_check_run_id": "<string>",
"passive_health_check_event_id": "<string>",
"requested_by": "<string>",
"create_time": "2023-11-07T05:31:56Z",
"reviewed_by": "<string>",
"review_time": "2023-11-07T05:31:56Z",
"review_comment": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"error_message": "<string>",
"update_time": "2023-11-07T05:31:56Z",
"instance_name": "<string>",
"linked_alerts": [
{
"passive_health_check_alert_id": "<string>",
"cluster_id": "<string>",
"target_vm": "<string>",
"alert_name": "<string>",
"annotations": {},
"started_at": "2023-11-07T05:31:56Z",
"instance_id": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"node_remediation_intent_id": "<string>"
}
]
},
"slurm_worker_hostname": "<string>",
"marked_for_deletion": true,
"public_ipv4": "<string>",
"ib_hca_type": "<string>",
"ib_hca_count": 123,
"nvswitch_count": 123,
"nvswitch_type": "<string>",
"ephemeral_storage": "<string>",
"auto_remediation_enabled": true,
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"kube_config": "<string>",
"num_gpus": 123,
"cuda_version": "<string>",
"nvidia_driver_version": "<string>",
"project_id": "<string>",
"num_cpu_workers": 123,
"phase_transitions": [
{
"transition_time": "2023-11-07T05:31:56Z"
}
],
"desired_preemptible_gpus": 123,
"allocated_preemptible_gpus": 123,
"add_ons": [
{
"name": "<string>",
"add_on_type": "<string>",
"config": {
"dashboard": {
"enabled": true
},
"ingress": {
"enabled": true
},
"torchpass": {
"enabled": true
}
},
"state": {
"dashboard": {},
"ingress": {},
"torchpass": {}
}
}
],
"num_capacity_pool_gpus": 123,
"num_reserved_gpus": 123,
"duration_hours": 123,
"slurm_shm_size_gib": 123,
"capacity_pool_id": "<string>",
"reservation_start_time": "2023-11-07T05:31:56Z",
"reservation_end_time": "2023-11-07T05:31:56Z",
"install_traefik": true,
"created_at": "2023-11-07T05:31:56Z",
"oidc_config": {
"issuer_url": "<string>",
"client_id": "<string>",
"username_claim": "<string>",
"username_prefix": "<string>",
"group_claim": "<string>",
"group_prefix": "<string>",
"ca_cert": "<string>"
},
"cluster_config": {
"kubernetes_dashboard_enabled": true,
"jumphost_enabled": true,
"slurm_startup_scripts": {
"worker_prolog": "<string>",
"worker_epilog": "<string>",
"controller_prolog": "<string>",
"controller_epilog": "<string>",
"login_init_script": "<string>",
"nodeset_init_script": "<string>",
"extra_slurm_conf": "<string>"
},
"ingress": {
"enabled": true
},
"observability": {
"enabled": true
},
"gpu_operator_version": "<string>",
"network_operator_version": "<string>",
"ssh_ca_enabled": true
},
"machine_cluster_id": "<string>",
"first_ready_at": "2023-11-07T05:31:56Z",
"is_in_substrate": true,
"control_plane_ready": true,
"ums_project_id": "<string>",
"ums_org_id": "<string>",
"os_image": "<string>",
"nvidia_driver_version_id": "<string>",
"deleted_gpu_worker_nodes": [
{
"node_id": "<string>",
"status": "<string>",
"host_name": "<string>",
"num_cpu_cores": 123,
"num_gpus": 123,
"memory_gib": 123,
"networks": [
"<string>"
],
"phase_transitions": [
{
"transition_time": "2023-11-07T05:31:56Z"
}
],
"instance_id": "<string>",
"latest_remediation": {
"id": "<string>",
"cluster_id": "<string>",
"instance_id": "<string>",
"reason": "<string>",
"active_health_check_run_id": "<string>",
"passive_health_check_event_id": "<string>",
"requested_by": "<string>",
"create_time": "2023-11-07T05:31:56Z",
"reviewed_by": "<string>",
"review_time": "2023-11-07T05:31:56Z",
"review_comment": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"error_message": "<string>",
"update_time": "2023-11-07T05:31:56Z",
"instance_name": "<string>",
"linked_alerts": [
{
"passive_health_check_alert_id": "<string>",
"cluster_id": "<string>",
"target_vm": "<string>",
"alert_name": "<string>",
"annotations": {},
"started_at": "2023-11-07T05:31:56Z",
"instance_id": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"node_remediation_intent_id": "<string>"
}
]
},
"slurm_worker_hostname": "<string>",
"marked_for_deletion": true,
"public_ipv4": "<string>",
"ib_hca_type": "<string>",
"ib_hca_count": 123,
"nvswitch_count": 123,
"nvswitch_type": "<string>",
"ephemeral_storage": "<string>",
"auto_remediation_enabled": true,
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"node_lifecycle_events": [
{
"node_id": "<string>",
"reason": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
]
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Optional UMS project ID to filter clusters by. When set, only clusters belonging to this project are returned. The caller must be a member of the project; otherwise the result set will be empty.
Response
200 - application/json
OK
Show child attributes
Show child attributes
Was this page helpful?
⌘I