Together AI SDK (Python)
from together import Together
client = Together()
instance_types = client.endpoints.hardware.list()
for instance_type in instance_types.data:
print(instance_type.name, instance_type.price_cents_per_hour)import Together from "together-ai";
const client = new Together();
const instanceTypes = await client.endpoints.hardware.list();
for (const instanceType of instanceTypes.data) {
console.log(instanceType.name, instanceType.priceCentsPerHour);
}
import Together from "together-ai";
const client = new Together();
const instanceTypes = await client.endpoints.hardware.list();
for (const instanceType of instanceTypes.data) {
console.log(instanceType.name, instanceType.priceCentsPerHour);
}
curl --request GET \
--url https://api.together.ai/v2/public/inference-instance-types \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v2/public/inference-instance-types",
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/public/inference-instance-types"
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/public/inference-instance-types")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v2/public/inference-instance-types")
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>",
"name": "<string>",
"description": "<string>",
"gpuType": "<string>",
"gpuCount": 123,
"gpuMemoryGib": 123,
"priceCentsPerHour": 123,
"regions": [
{
"name": "<string>",
"headroom": {
"relation": "RELATION_EQ",
"value": 123
},
"compliance": [
{
"policy": {
"hipaa": true
},
"headroom": {
"relation": "RELATION_EQ",
"value": 123
}
}
]
}
]
}
],
"object": "list",
"next_cursor": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Instance types
List inference instance types
Lists hardware instance types currently available to inference deployments, including GPU resources, pricing, regions, and best-effort capacity headroom.
GET
/
v2
/
public
/
inference-instance-types
Together AI SDK (Python)
from together import Together
client = Together()
instance_types = client.endpoints.hardware.list()
for instance_type in instance_types.data:
print(instance_type.name, instance_type.price_cents_per_hour)import Together from "together-ai";
const client = new Together();
const instanceTypes = await client.endpoints.hardware.list();
for (const instanceType of instanceTypes.data) {
console.log(instanceType.name, instanceType.priceCentsPerHour);
}
import Together from "together-ai";
const client = new Together();
const instanceTypes = await client.endpoints.hardware.list();
for (const instanceType of instanceTypes.data) {
console.log(instanceType.name, instanceType.priceCentsPerHour);
}
curl --request GET \
--url https://api.together.ai/v2/public/inference-instance-types \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v2/public/inference-instance-types",
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/public/inference-instance-types"
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/public/inference-instance-types")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v2/public/inference-instance-types")
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>",
"name": "<string>",
"description": "<string>",
"gpuType": "<string>",
"gpuCount": 123,
"gpuMemoryGib": 123,
"priceCentsPerHour": 123,
"regions": [
{
"name": "<string>",
"headroom": {
"relation": "RELATION_EQ",
"value": 123
},
"compliance": [
{
"policy": {
"hipaa": true
},
"headroom": {
"relation": "RELATION_EQ",
"value": 123
}
}
]
}
]
}
],
"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.
Was this page helpful?
⌘I