Resize Volume Endpoint
curl --request PATCH \
--url https://api.primeintellect.ai/api/v1/sandbox/volumes/{name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"size_gb": 5170
}
'import requests
url = "https://api.primeintellect.ai/api/v1/sandbox/volumes/{name}"
payload = { "size_gb": 5170 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({size_gb: 5170})
};
fetch('https://api.primeintellect.ai/api/v1/sandbox/volumes/{name}', 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/volumes/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'size_gb' => 5170
]),
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/volumes/{name}"
payload := strings.NewReader("{\n \"size_gb\": 5170\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.primeintellect.ai/api/v1/sandbox/volumes/{name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"size_gb\": 5170\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/v1/sandbox/volumes/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"size_gb\": 5170\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"team_id": "<string>",
"head_checkpoint_id": "<string>",
"occupied_bytes": 0,
"size_gb": 100,
"account_storage_used_bytes": 123,
"account_storage_limit_gb": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Sandbox Volumes
Resize Volume Endpoint
Grow a volume; the new size applies to sandboxes created afterwards.
Running attachments are untouched: there is no live resize.
PATCH
/
api
/
v1
/
sandbox
/
volumes
/
{name}
Resize Volume Endpoint
curl --request PATCH \
--url https://api.primeintellect.ai/api/v1/sandbox/volumes/{name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"size_gb": 5170
}
'import requests
url = "https://api.primeintellect.ai/api/v1/sandbox/volumes/{name}"
payload = { "size_gb": 5170 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({size_gb: 5170})
};
fetch('https://api.primeintellect.ai/api/v1/sandbox/volumes/{name}', 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/volumes/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'size_gb' => 5170
]),
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/volumes/{name}"
payload := strings.NewReader("{\n \"size_gb\": 5170\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.primeintellect.ai/api/v1/sandbox/volumes/{name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"size_gb\": 5170\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/v1/sandbox/volumes/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"size_gb\": 5170\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"team_id": "<string>",
"head_checkpoint_id": "<string>",
"occupied_bytes": 0,
"size_gb": 100,
"account_storage_used_bytes": 123,
"account_storage_limit_gb": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
Response
Successful Response
One volume, scoped to its single owner (exactly one of user/team).
occupied_bytes is the current published version's non-hole uncompressed size (the head checkpoint's occupiedBytes). The GET response fills the account fields with the caller's volume-storage usage (bytes) and wallet limit (whole GiB); list items leave them null and the page-level VolumeListResponse carries them instead. occupied_bytes defaults to 0 legitimately: create_volume returns a bare Volume row (nothing published yet, no head to join), and list/get/resize rows carry the joined head bytes.
Was this page helpful?