Together AI SDK (Python)
from together import Together
import os
client = Together(
api_key=os.environ.get("TOGETHER_API_KEY"),
)
response = client.evals.create(
type="classify",
parameters=ParametersEvaluationClassifyParameters(
judge=ParametersEvaluationClassifyParametersJudge(
model="openai/gpt-oss-120b",
model_source="serverless",
system_template="You are an expert evaluator...",
),
input_data_file_path="file-abc123",
labels=["good", "bad"],
pass_labels=["good"],
model_to_evaluate="Qwen/Qwen3.5-9B"
)
)
print(response.workflow_id)import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const response = await client.evals.create({
type: 'classify',
parameters: {
judge: {
model: 'openai/gpt-oss-120b',
model_source: 'serverless',
system_template: 'You are an expert evaluator...',
},
input_data_file_path: 'file-abc123',
labels: ['good', 'bad'],
pass_labels: ['good'],
model_to_evaluate: 'Qwen/Qwen3.5-9B',
},
});
console.log(response.workflow_id);
import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const response = await client.evals.create({
type: 'classify',
parameters: {
judge: {
model: 'openai/gpt-oss-120b',
model_source: 'serverless',
system_template: 'You are an expert evaluator...',
},
input_data_file_path: 'file-abc123',
labels: ['good', 'bad'],
pass_labels: ['good'],
model_to_evaluate: 'Qwen/Qwen3.5-9B',
},
});
console.log(response.workflow_id);
curl --request POST \
--url https://api.together.ai/v1/evaluation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "classify",
"parameters": {
"judge": {
"model": "Qwen/Qwen3.5-9B",
"system_template": "Imagine you are a helpful assistant",
"external_api_token": "<string>",
"external_base_url": "<string>",
"num_workers": 5,
"max_tokens": 8192,
"temperature": 0
},
"labels": [
"yes",
"no"
],
"pass_labels": [
"yes"
],
"input_data_file_path": "file-1234-aefd",
"model_to_evaluate": "<string>"
}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v1/evaluation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'classify',
'parameters' => [
'judge' => [
'model' => 'Qwen/Qwen3.5-9B',
'system_template' => 'Imagine you are a helpful assistant',
'external_api_token' => '<string>',
'external_base_url' => '<string>',
'num_workers' => 5,
'max_tokens' => 8192,
'temperature' => 0
],
'labels' => [
'yes',
'no'
],
'pass_labels' => [
'yes'
],
'input_data_file_path' => 'file-1234-aefd',
'model_to_evaluate' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.together.ai/v1/evaluation"
payload := strings.NewReader("{\n \"type\": \"classify\",\n \"parameters\": {\n \"judge\": {\n \"model\": \"Qwen/Qwen3.5-9B\",\n \"system_template\": \"Imagine you are a helpful assistant\",\n \"external_api_token\": \"<string>\",\n \"external_base_url\": \"<string>\",\n \"num_workers\": 5,\n \"max_tokens\": 8192,\n \"temperature\": 0\n },\n \"labels\": [\n \"yes\",\n \"no\"\n ],\n \"pass_labels\": [\n \"yes\"\n ],\n \"input_data_file_path\": \"file-1234-aefd\",\n \"model_to_evaluate\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.together.ai/v1/evaluation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"classify\",\n \"parameters\": {\n \"judge\": {\n \"model\": \"Qwen/Qwen3.5-9B\",\n \"system_template\": \"Imagine you are a helpful assistant\",\n \"external_api_token\": \"<string>\",\n \"external_base_url\": \"<string>\",\n \"num_workers\": 5,\n \"max_tokens\": 8192,\n \"temperature\": 0\n },\n \"labels\": [\n \"yes\",\n \"no\"\n ],\n \"pass_labels\": [\n \"yes\"\n ],\n \"input_data_file_path\": \"file-1234-aefd\",\n \"model_to_evaluate\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v1/evaluation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"classify\",\n \"parameters\": {\n \"judge\": {\n \"model\": \"Qwen/Qwen3.5-9B\",\n \"system_template\": \"Imagine you are a helpful assistant\",\n \"external_api_token\": \"<string>\",\n \"external_base_url\": \"<string>\",\n \"num_workers\": 5,\n \"max_tokens\": 8192,\n \"temperature\": 0\n },\n \"labels\": [\n \"yes\",\n \"no\"\n ],\n \"pass_labels\": [\n \"yes\"\n ],\n \"input_data_file_path\": \"file-1234-aefd\",\n \"model_to_evaluate\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"workflow_id": "eval-1234-1244513",
"status": "pending"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Evaluations
Create an evaluation job
POST
/
evaluation
Together AI SDK (Python)
from together import Together
import os
client = Together(
api_key=os.environ.get("TOGETHER_API_KEY"),
)
response = client.evals.create(
type="classify",
parameters=ParametersEvaluationClassifyParameters(
judge=ParametersEvaluationClassifyParametersJudge(
model="openai/gpt-oss-120b",
model_source="serverless",
system_template="You are an expert evaluator...",
),
input_data_file_path="file-abc123",
labels=["good", "bad"],
pass_labels=["good"],
model_to_evaluate="Qwen/Qwen3.5-9B"
)
)
print(response.workflow_id)import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const response = await client.evals.create({
type: 'classify',
parameters: {
judge: {
model: 'openai/gpt-oss-120b',
model_source: 'serverless',
system_template: 'You are an expert evaluator...',
},
input_data_file_path: 'file-abc123',
labels: ['good', 'bad'],
pass_labels: ['good'],
model_to_evaluate: 'Qwen/Qwen3.5-9B',
},
});
console.log(response.workflow_id);
import Together from "together-ai";
const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});
const response = await client.evals.create({
type: 'classify',
parameters: {
judge: {
model: 'openai/gpt-oss-120b',
model_source: 'serverless',
system_template: 'You are an expert evaluator...',
},
input_data_file_path: 'file-abc123',
labels: ['good', 'bad'],
pass_labels: ['good'],
model_to_evaluate: 'Qwen/Qwen3.5-9B',
},
});
console.log(response.workflow_id);
curl --request POST \
--url https://api.together.ai/v1/evaluation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "classify",
"parameters": {
"judge": {
"model": "Qwen/Qwen3.5-9B",
"system_template": "Imagine you are a helpful assistant",
"external_api_token": "<string>",
"external_base_url": "<string>",
"num_workers": 5,
"max_tokens": 8192,
"temperature": 0
},
"labels": [
"yes",
"no"
],
"pass_labels": [
"yes"
],
"input_data_file_path": "file-1234-aefd",
"model_to_evaluate": "<string>"
}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v1/evaluation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'classify',
'parameters' => [
'judge' => [
'model' => 'Qwen/Qwen3.5-9B',
'system_template' => 'Imagine you are a helpful assistant',
'external_api_token' => '<string>',
'external_base_url' => '<string>',
'num_workers' => 5,
'max_tokens' => 8192,
'temperature' => 0
],
'labels' => [
'yes',
'no'
],
'pass_labels' => [
'yes'
],
'input_data_file_path' => 'file-1234-aefd',
'model_to_evaluate' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.together.ai/v1/evaluation"
payload := strings.NewReader("{\n \"type\": \"classify\",\n \"parameters\": {\n \"judge\": {\n \"model\": \"Qwen/Qwen3.5-9B\",\n \"system_template\": \"Imagine you are a helpful assistant\",\n \"external_api_token\": \"<string>\",\n \"external_base_url\": \"<string>\",\n \"num_workers\": 5,\n \"max_tokens\": 8192,\n \"temperature\": 0\n },\n \"labels\": [\n \"yes\",\n \"no\"\n ],\n \"pass_labels\": [\n \"yes\"\n ],\n \"input_data_file_path\": \"file-1234-aefd\",\n \"model_to_evaluate\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.together.ai/v1/evaluation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"classify\",\n \"parameters\": {\n \"judge\": {\n \"model\": \"Qwen/Qwen3.5-9B\",\n \"system_template\": \"Imagine you are a helpful assistant\",\n \"external_api_token\": \"<string>\",\n \"external_base_url\": \"<string>\",\n \"num_workers\": 5,\n \"max_tokens\": 8192,\n \"temperature\": 0\n },\n \"labels\": [\n \"yes\",\n \"no\"\n ],\n \"pass_labels\": [\n \"yes\"\n ],\n \"input_data_file_path\": \"file-1234-aefd\",\n \"model_to_evaluate\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v1/evaluation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"classify\",\n \"parameters\": {\n \"judge\": {\n \"model\": \"Qwen/Qwen3.5-9B\",\n \"system_template\": \"Imagine you are a helpful assistant\",\n \"external_api_token\": \"<string>\",\n \"external_base_url\": \"<string>\",\n \"num_workers\": 5,\n \"max_tokens\": 8192,\n \"temperature\": 0\n },\n \"labels\": [\n \"yes\",\n \"no\"\n ],\n \"pass_labels\": [\n \"yes\"\n ],\n \"input_data_file_path\": \"file-1234-aefd\",\n \"model_to_evaluate\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"workflow_id": "eval-1234-1244513",
"status": "pending"
}{
"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.
Body
application/json
Was this page helpful?
⌘I