Set clock sync
curl --request PUT \
--url https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": false
}
'import requests
url = "https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync"
payload = { "enabled": False }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: false})
};
fetch('https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync', 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://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => false
]),
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://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync"
payload := strings.NewReader("{\n \"enabled\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": false\n}"
response = http.request(request)
puts response.read_body{
"enabled": false,
"configurable": true
}{
"error": "Sandbox 'parked-agent' is suspended and automatic resume is disabled; resume it explicitly before sending traffic.",
"code": "SANDBOX_AUTO_RESUME_DISABLED"
}{
"error": "Wall-clock sync is not configurable under gVisor: the host clock is authoritative.",
"code": "CLOCK_SYNC_UNSUPPORTED"
}Runtime Metadata
Set clock sync
Enable or disable built-in host wall-clock sync inside a VM sandbox.
PUT
/
api
/
v1
/
clock-sync
Set clock sync
curl --request PUT \
--url https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": false
}
'import requests
url = "https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync"
payload = { "enabled": False }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: false})
};
fetch('https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync', 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://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => false
]),
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://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync"
payload := strings.NewReader("{\n \"enabled\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": false\n}"
response = http.request(request)
puts response.read_body{
"enabled": false,
"configurable": true
}{
"error": "Sandbox 'parked-agent' is suspended and automatic resume is disabled; resume it explicitly before sending traffic.",
"code": "SANDBOX_AUTO_RESUME_DISABLED"
}{
"error": "Wall-clock sync is not configurable under gVisor: the host clock is authoritative.",
"code": "CLOCK_SYNC_UNSUPPORTED"
}Enable or disable the sandbox daemon’s built-in
This disables both periodic (10s) and post-resume
CLOCK_REALTIME syncer. Workloads inside the sandbox can call the same control surface over /run/tensorlake/guest.sock (PUT /v1/clock-sync); see How clocks work in sandboxes.
Example request
SetSANDBOX_URL to the sandbox_url returned by Get Sandbox and authenticate with your Tensorlake API key:
curl -X PUT "${SANDBOX_URL%/}/api/v1/clock-sync" \
-H "Authorization: Bearer $TENSORLAKE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
CLOCK_REALTIME steps and waits for any in-flight clock_settime call to finish before returning 200 OK.
Send {"enabled": true} to re-enable syncing and wake the corrector immediately to re-anchor guest CLOCK_REALTIME to host UTC.
Behavior and errors
State lives in daemon memory, so it persists across resident suspend and resume, full-memory snapshots, and live migration, and resets toenabled: true on a fresh boot or filesystem-only snapshot restore.
400 Bad Request: malformed JSON body413 Payload Too Large: request body exceeds 4 KB422 Unprocessable Entity: unknown field in JSON body501 Not Implemented: runtime doesn’t allow toggling wall-clock sync (code: "CLOCK_SYNC_UNSUPPORTED"), such as GPU sandboxes running under gVisor or VMs lacking/dev/ptp0(KVM virtual PTP) orCAP_SYS_TIME
Authorizations
Body
application/json
Response
Updated wall-clock sync status
Was this page helpful?