curl --request POST \
--url https://api.primeintellect.ai/api/v1/slurm-clusters/{team_id}/{job_id}/resize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"numNodes": 2
}'import requests
url = "https://api.primeintellect.ai/api/v1/slurm-clusters/{team_id}/{job_id}/resize"
payload = { "numNodes": 2 }
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({numNodes: 2})
};
fetch('https://api.primeintellect.ai/api/v1/slurm-clusters/{team_id}/{job_id}/resize', 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/slurm-clusters/{team_id}/{job_id}/resize",
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([
'numNodes' => 2
]),
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/slurm-clusters/{team_id}/{job_id}/resize"
payload := strings.NewReader("{\n \"numNodes\": 2\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/slurm-clusters/{team_id}/{job_id}/resize")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"numNodes\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/v1/slurm-clusters/{team_id}/{job_id}/resize")
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 \"numNodes\": 2\n}"
response = http.request(request)
puts response.read_body{
"numNodes": 123,
"added": [
"<string>"
],
"removed": [
"<string>"
]
}{
"errors": [
{
"param": "<string>",
"details": "<string>"
}
]
}Resize Cluster
Resize a Slurm cluster by changing its worker node count.
Requires factory:write (see module docstring); slurm_clusters
scopes alone are rejected. Team-admin gated like add/remove member.
The cluster must have
self-service enabled (checked by the resize service). Grows by
claiming eligible idle nodes (same filters as deploy); shrinks by
releasing only idle nodes, never touching running jobs.
Returns the verified membership after the mutation settles — the actual final size may differ from the request if node release was best-effort and fell short.
curl --request POST \
--url https://api.primeintellect.ai/api/v1/slurm-clusters/{team_id}/{job_id}/resize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"numNodes": 2
}'import requests
url = "https://api.primeintellect.ai/api/v1/slurm-clusters/{team_id}/{job_id}/resize"
payload = { "numNodes": 2 }
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({numNodes: 2})
};
fetch('https://api.primeintellect.ai/api/v1/slurm-clusters/{team_id}/{job_id}/resize', 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/slurm-clusters/{team_id}/{job_id}/resize",
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([
'numNodes' => 2
]),
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/slurm-clusters/{team_id}/{job_id}/resize"
payload := strings.NewReader("{\n \"numNodes\": 2\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/slurm-clusters/{team_id}/{job_id}/resize")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"numNodes\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/v1/slurm-clusters/{team_id}/{job_id}/resize")
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 \"numNodes\": 2\n}"
response = http.request(request)
puts response.read_body{
"numNodes": 123,
"added": [
"<string>"
],
"removed": [
"<string>"
]
}{
"errors": [
{
"param": "<string>",
"details": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request to resize a Slurm cluster's worker node count.
Target worker-node count (not a delta), so retried requests are idempotent. The service enforces a ceiling of max(64, current_size), so oversized clusters can shrink but not grow past 64.
x >= 1Response
Successful Response
Was this page helpful?