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
# Configurations are listed per model. A supported model's base_model is
# the resource name to pass as reference_model.
model = client.models.retrieve_supported("arch_abc123")
configs = client.models.configs.list(
project_id=project_id,
reference_model=model.base_model,
)
for config in configs:
print(config.id, config.reference_model)
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;
// Configurations are listed per model. A supported model's baseModel is
// the resource name to pass as referenceModel.
const model = await client.models.retrieveSupported("arch_abc123");
const configs = client.models.configs.list({
projectId,
referenceModel: model.baseModel,
});
for await (const config of configs) {
console.log(config.id, config.referenceModel);
}
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;
// Configurations are listed per model. A supported model's baseModel is
// the resource name to pass as referenceModel.
const model = await client.models.retrieveSupported("arch_abc123");
const configs = client.models.configs.list({
projectId,
referenceModel: model.baseModel,
});
for await (const config of configs) {
console.log(config.id, config.referenceModel);
}
curl --request GET \
--url https://api.together.ai/v2/projects/{projectId}/configs \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v2/projects/{projectId}/configs",
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}/configs"
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}/configs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v2/projects/{projectId}/configs")
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>",
"certifications": [
{
"target": "CERTIFICATION_TARGET_DE_SERVERLESS",
"certificationType": "CERTIFICATION_TYPE_CERTIFIED",
"certifiedAt": "2023-11-07T05:31:56Z",
"certifiedBy": "<string>",
"model": "<string>",
"modelRevisionId": "<string>",
"notes": "<string>",
"draftModel": "<string>",
"draftModelRevisionId": "<string>"
}
],
"referenceModelId": "<string>",
"selectors": [
{
"key": "<string>",
"value": "<string>"
}
],
"projectId": "<string>",
"referenceModel": "<string>",
"draftModel": "<string>"
}
],
"object": "list",
"next_cursor": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Model configurations
List model configurations
Lists production-ready configuration revisions compatible with a reference model. Specify the model with referenceModel or the deprecated referenceModelId; if both are supplied, they must identify the same model. Results include public configurations and configurations owned by the specified project.
GET
/
v2
/
projects
/
{projectId}
/
configs
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
# Configurations are listed per model. A supported model's base_model is
# the resource name to pass as reference_model.
model = client.models.retrieve_supported("arch_abc123")
configs = client.models.configs.list(
project_id=project_id,
reference_model=model.base_model,
)
for config in configs:
print(config.id, config.reference_model)
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;
// Configurations are listed per model. A supported model's baseModel is
// the resource name to pass as referenceModel.
const model = await client.models.retrieveSupported("arch_abc123");
const configs = client.models.configs.list({
projectId,
referenceModel: model.baseModel,
});
for await (const config of configs) {
console.log(config.id, config.referenceModel);
}
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;
// Configurations are listed per model. A supported model's baseModel is
// the resource name to pass as referenceModel.
const model = await client.models.retrieveSupported("arch_abc123");
const configs = client.models.configs.list({
projectId,
referenceModel: model.baseModel,
});
for await (const config of configs) {
console.log(config.id, config.referenceModel);
}
curl --request GET \
--url https://api.together.ai/v2/projects/{projectId}/configs \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v2/projects/{projectId}/configs",
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}/configs"
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}/configs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v2/projects/{projectId}/configs")
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>",
"certifications": [
{
"target": "CERTIFICATION_TARGET_DE_SERVERLESS",
"certificationType": "CERTIFICATION_TYPE_CERTIFIED",
"certifiedAt": "2023-11-07T05:31:56Z",
"certifiedBy": "<string>",
"model": "<string>",
"modelRevisionId": "<string>",
"notes": "<string>",
"draftModel": "<string>",
"draftModelRevisionId": "<string>"
}
],
"referenceModelId": "<string>",
"selectors": [
{
"key": "<string>",
"value": "<string>"
}
],
"projectId": "<string>",
"referenceModel": "<string>",
"draftModel": "<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.
Query Parameters
Deprecated. Use referenceModel. Reference model identifier filter; if both are set, they must agree.
Model resource-name filter using projects/{projectId}/models/{modelId}; alternative to referenceModelId. If both are set, they must agree.
Maximum number of results to return.
Cursor from a previous list response.
Was this page helpful?
⌘I