Create Checkpoint Endpoint
curl --request POST \
--url https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/checkpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ttl_seconds": 15768030
}
'import requests
url = "https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/checkpoints"
payload = { "ttl_seconds": 15768030 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ttl_seconds: 15768030})
};
fetch('https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/checkpoints', 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.primeintellect.ai/api/v1/sandbox/{sandbox_id}/checkpoints",
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([
'ttl_seconds' => 15768030
]),
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.primeintellect.ai/api/v1/sandbox/{sandbox_id}/checkpoints"
payload := strings.NewReader("{\n \"ttl_seconds\": 15768030\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.primeintellect.ai/api/v1/sandbox/{sandbox_id}/checkpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ttl_seconds\": 15768030\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/checkpoints")
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 \"ttl_seconds\": 15768030\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"sandbox_id": "<string>",
"state": "<string>",
"depth": 123,
"docker_image": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"parent_id": "<string>",
"team_id": "<string>",
"disk_size_bytes": 123,
"stored_bytes": 123,
"occupied_bytes": 0,
"error": "<string>",
"merge": "merged",
"merge_error": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Sandbox Checkpoints
Create Checkpoint Endpoint
Checkpoint a running VM sandbox’s filesystem.
Returns once the request is accepted. The checkpoint is restorable only
after state becomes DURABLE; a sandbox deleted before then loses it.
With ttl_seconds it is deleted that long after the request.
POST
/
api
/
v1
/
sandbox
/
{sandbox_id}
/
checkpoints
Create Checkpoint Endpoint
curl --request POST \
--url https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/checkpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ttl_seconds": 15768030
}
'import requests
url = "https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/checkpoints"
payload = { "ttl_seconds": 15768030 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ttl_seconds: 15768030})
};
fetch('https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/checkpoints', 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.primeintellect.ai/api/v1/sandbox/{sandbox_id}/checkpoints",
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([
'ttl_seconds' => 15768030
]),
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.primeintellect.ai/api/v1/sandbox/{sandbox_id}/checkpoints"
payload := strings.NewReader("{\n \"ttl_seconds\": 15768030\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.primeintellect.ai/api/v1/sandbox/{sandbox_id}/checkpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ttl_seconds\": 15768030\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/checkpoints")
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 \"ttl_seconds\": 15768030\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"sandbox_id": "<string>",
"state": "<string>",
"depth": 123,
"docker_image": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"parent_id": "<string>",
"team_id": "<string>",
"disk_size_bytes": 123,
"stored_bytes": 123,
"occupied_bytes": 0,
"error": "<string>",
"merge": "merged",
"merge_error": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Response
Successful Response
A filesystem checkpoint. Only DURABLE checkpoints can be restored.
Was this page helpful?