curl --request PATCH \
--url https://api.primeintellect.ai/api/v1/sandbox/volumes/{ref} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"size_gb": 5170
}
'import requests
url = "https://api.primeintellect.ai/api/v1/sandbox/volumes/{ref}"
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/{ref}', 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/{ref}",
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/{ref}"
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/{ref}")
.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/{ref}")
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>",
"namespace": "<string>",
"visibility": "<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>"
}
]
}Update Volume Endpoint
Grow a volume and/or make it public or private.
A new size applies to sandboxes created afterwards (no live resize); visibility is reversible. A foreign volume is not found.
curl --request PATCH \
--url https://api.primeintellect.ai/api/v1/sandbox/volumes/{ref} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"size_gb": 5170
}
'import requests
url = "https://api.primeintellect.ai/api/v1/sandbox/volumes/{ref}"
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/{ref}', 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/{ref}",
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/{ref}"
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/{ref}")
.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/{ref}")
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>",
"namespace": "<string>",
"visibility": "<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
Path Parameters
Body
PATCH body: grow the size, change the visibility, or both.
Repeating the current visibility is a no-op; growing is grow-only.
Response
Successful Response
One volume the caller owns, scoped to its single owner (exactly one of user/team).
namespace is the owner's display namespace: its user or team slug, else the
id form (user id or team-<teamId>). The id form is also used when the
slug equals an existing user id or does not parse as a volume namespace
segment, so a displayed ref always parses and always names the owner that
shows it. namespace/name is the ref to share.
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/update rows carry the joined head
bytes.
Was this page helpful?