Get weights-sync operation
curl --request GET \
--url https://api.together.ai/v1/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.together.ai/v1/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.together.ai/v1/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v1/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}",
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/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}"
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/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v1/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}")
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{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "TRAINING_OPERATION_STATUS_UNSPECIFIED",
"output": {
"weights_version": "100"
},
"error": {
"code": "TRAINING_OPERATION_ERROR_CODE_TIMEOUT",
"message": "Operation timed out"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Operations
Get weights-sync operation
Retrieves the current status and result of a weights-sync operation.
GET
/
rl
/
training-sessions
/
{session_id}
/
operations
/
weights-sync
/
{operation_id}
Get weights-sync operation
curl --request GET \
--url https://api.together.ai/v1/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.together.ai/v1/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.together.ai/v1/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v1/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}",
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/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}"
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/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v1/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}")
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{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "TRAINING_OPERATION_STATUS_UNSPECIFIED",
"output": {
"weights_version": "100"
},
"error": {
"code": "TRAINING_OPERATION_ERROR_CODE_TIMEOUT",
"message": "Operation timed out"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
Async weights-sync operation
Operation ID
Example:
"550e8400-e29b-41d4-a716-446655440000"
Operation status
Available options:
TRAINING_OPERATION_STATUS_UNSPECIFIED, TRAINING_OPERATION_STATUS_PENDING, TRAINING_OPERATION_STATUS_RUNNING, TRAINING_OPERATION_STATUS_COMPLETED, TRAINING_OPERATION_STATUS_FAILED Result on success
Show child attributes
Show child attributes
Error details on failure
Show child attributes
Show child attributes
Was this page helpful?
⌘I