Create Checkpoint
curl --request POST \
--url https://app.opencomputer.dev/api/sandboxes/{id}/checkpoints \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"kind": "<string>",
"retentionPolicy": {}
}
'import requests
url = "https://app.opencomputer.dev/api/sandboxes/{id}/checkpoints"
payload = {
"name": "<string>",
"kind": "<string>",
"retentionPolicy": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', kind: '<string>', retentionPolicy: {}})
};
fetch('https://app.opencomputer.dev/api/sandboxes/{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://app.opencomputer.dev/api/sandboxes/{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([
'name' => '<string>',
'kind' => '<string>',
'retentionPolicy' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://app.opencomputer.dev/api/sandboxes/{id}/checkpoints"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"kind\": \"<string>\",\n \"retentionPolicy\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://app.opencomputer.dev/api/sandboxes/{id}/checkpoints")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"kind\": \"<string>\",\n \"retentionPolicy\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.opencomputer.dev/api/sandboxes/{id}/checkpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"kind\": \"<string>\",\n \"retentionPolicy\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "cp-abc123",
"sandboxID": "sb-abc123",
"name": "before-migration",
"status": "processing",
"sizeBytes": 0,
"createdAt": "2025-01-15T10:30:00Z"
}
Checkpoints
Create Checkpoint
POST
/
api
/
sandboxes
/
{id}
/
checkpoints
Create Checkpoint
curl --request POST \
--url https://app.opencomputer.dev/api/sandboxes/{id}/checkpoints \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"kind": "<string>",
"retentionPolicy": {}
}
'import requests
url = "https://app.opencomputer.dev/api/sandboxes/{id}/checkpoints"
payload = {
"name": "<string>",
"kind": "<string>",
"retentionPolicy": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', kind: '<string>', retentionPolicy: {}})
};
fetch('https://app.opencomputer.dev/api/sandboxes/{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://app.opencomputer.dev/api/sandboxes/{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([
'name' => '<string>',
'kind' => '<string>',
'retentionPolicy' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://app.opencomputer.dev/api/sandboxes/{id}/checkpoints"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"kind\": \"<string>\",\n \"retentionPolicy\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://app.opencomputer.dev/api/sandboxes/{id}/checkpoints")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"kind\": \"<string>\",\n \"retentionPolicy\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.opencomputer.dev/api/sandboxes/{id}/checkpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"kind\": \"<string>\",\n \"retentionPolicy\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "cp-abc123",
"sandboxID": "sb-abc123",
"name": "before-migration",
"status": "processing",
"sizeBytes": 0,
"createdAt": "2025-01-15T10:30:00Z"
}
Create a checkpoint of the sandbox state. Each sandbox can have up to 10 full
checkpoints and up to 100 disk-only checkpoints. By default, creating past the
limit for that checkpoint type returns an error. Set
retentionPolicy.mode to
delete_oldest to delete the oldest eligible checkpoint of the same type first
so the new checkpoint can be created.
string
required
Sandbox ID
string
required
Checkpoint name (unique per sandbox)
string
default:"full"
Checkpoint type. Use
full to preserve disk, memory, and CPU state, or
disk_only to preserve only disk state with a larger per-sandbox limit.object
Optional retention policy. Use
{ "mode": "delete_oldest", "maxCount": 10 }
for full checkpoints or { "mode": "delete_oldest", "maxCount": 100 } for
disk-only checkpoints to delete the oldest eligible checkpoint of the same
type before creating a new one.{
"id": "cp-abc123",
"sandboxID": "sb-abc123",
"name": "before-migration",
"status": "processing",
"sizeBytes": 0,
"createdAt": "2025-01-15T10:30:00Z"
}
⌘I