Together AI SDK (Python)
from together import Together
import os
client = Together(
api_key=os.environ.get("TOGETHER_API_KEY"),
)
response = client.endpoints.list()
for endpoint in response.data:
print(endpoint.id)import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const endpoints = await client.endpoints.list();
for (const endpoint of endpoints.data) {
console.log(endpoint);
}
import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const endpoints = await client.endpoints.list();
for (const endpoint of endpoints.data) {
console.log(endpoint);
}
curl "https://api.together.ai/v1/endpoints" \
-H "Authorization: Bearer $TOGETHER_API_KEY" \
-H "Content-Type: application/json"
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v1/endpoints",
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/endpoints"
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/endpoints")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v1/endpoints")
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{
"object": "list",
"data": [
{
"object": "endpoint",
"id": "endpoint-5c0c20db-62fe-4f41-8ffc-d9e4ea1a264e",
"name": "allenai/OLMo-7B",
"model": "allenai/OLMo-7B",
"type": "serverless",
"owner": "together",
"state": "STARTED",
"created_at": "2024-02-28T21:34:35.444Z"
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Endpoints
List all endpoints
Returns a list of all endpoints associated with your account. You can filter the results by type (dedicated or serverless).
GET
/
endpoints
Together AI SDK (Python)
from together import Together
import os
client = Together(
api_key=os.environ.get("TOGETHER_API_KEY"),
)
response = client.endpoints.list()
for endpoint in response.data:
print(endpoint.id)import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const endpoints = await client.endpoints.list();
for (const endpoint of endpoints.data) {
console.log(endpoint);
}
import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const endpoints = await client.endpoints.list();
for (const endpoint of endpoints.data) {
console.log(endpoint);
}
curl "https://api.together.ai/v1/endpoints" \
-H "Authorization: Bearer $TOGETHER_API_KEY" \
-H "Content-Type: application/json"
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v1/endpoints",
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/endpoints"
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/endpoints")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v1/endpoints")
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{
"object": "list",
"data": [
{
"object": "endpoint",
"id": "endpoint-5c0c20db-62fe-4f41-8ffc-d9e4ea1a264e",
"name": "allenai/OLMo-7B",
"model": "allenai/OLMo-7B",
"type": "serverless",
"owner": "together",
"state": "STARTED",
"created_at": "2024-02-28T21:34:35.444Z"
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"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
Filter endpoints by type
Available options:
dedicated, serverless Filter endpoints by usage type
Available options:
on-demand, reserved If true, return only endpoints owned by the caller
Was this page helpful?
⌘I