Add workers
Adds workers to a ready or degraded cluster whose offer allows resizing (resize). Each is the same machine as the rest, joins the private network and the stack, and is billed from when it is up.
POST
/
clusters
/
{id}
/
nodes
Add workers
curl --request POST \
--url https://www.runcrate.ai/api/v1/clusters/{id}/nodes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"count": 1
}'import requests
url = "https://www.runcrate.ai/api/v1/clusters/{id}/nodes"
payload = { "count": 1 }
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({count: 1})
};
fetch('https://www.runcrate.ai/api/v1/clusters/{id}/nodes', 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://www.runcrate.ai/api/v1/clusters/{id}/nodes",
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([
'count' => 1
]),
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://www.runcrate.ai/api/v1/clusters/{id}/nodes"
payload := strings.NewReader("{\n \"count\": 1\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://www.runcrate.ai/api/v1/clusters/{id}/nodes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"count\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.runcrate.ai/api/v1/clusters/{id}/nodes")
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 \"count\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "provisioning",
"stack": "none",
"stack_status": "pending",
"stack_detail": "<string>",
"node_count": 123,
"gpu_type": "<string>",
"gpus_per_node": 123,
"deployment_type": "vm",
"host_tier": "datacenter",
"location": "<string>",
"interconnect": {
"kind": "infiniband",
"label": "<string>",
"rate_gbps": 123,
"note": "<string>"
},
"hourly_rate_per_node": 123,
"hourly_rate": 123,
"created_at": "2023-11-07T05:31:56Z",
"up_at": "2023-11-07T05:31:56Z",
"ready_at": "2023-11-07T05:31:56Z",
"terminated_at": "2023-11-07T05:31:56Z",
"nodes": [
{
"rank": 123,
"role": "head",
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "train-1",
"status": "<string>",
"stage": "<string>",
"overlay_address": "<string>",
"gpus": 123,
"ip": "<string>",
"ssh_command": "<string>"
}
],
"connection": {
"head_ssh": "<string>",
"hostfile": "<string>",
"env": {
"MASTER_ADDR": "<string>",
"MASTER_PORT": "<string>",
"NCCL_SOCKET_IFNAME": "<string>"
},
"snippets": {
"torchrun": "<string>",
"mpirun": "<string>",
"deepspeed": "<string>",
"sbatch": "<string>",
"kubectl_tunnel": "<string>",
"ray_tunnel": "<string>"
}
},
"shared": {
"path": "/shared",
"available": true,
"detail": "<string>",
"volume": {
"id": "<string>",
"name": "<string>",
"path": "/shared/volume"
}
},
"events": [
{
"id": 123,
"at": "2023-11-07T05:31:56Z",
"kind": "<string>",
"rank": 123,
"message": "<string>"
}
],
"last_test": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "nccl_all_reduce",
"status": "running",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"result": {
"sizes": [
{
"bytes": 123,
"algbw_gb_s": 123,
"busbw_gb_s": 123,
"time_us": 123
}
],
"peak_busbw_gb_s": 123,
"nodes": 123,
"gpus": 123,
"error": "<string>",
"note": "<string>"
}
},
"billing": {
"billed_since": "2023-11-07T05:31:56Z",
"nodes_billed": 123
},
"resize": true,
"country_code": "<string>",
"failure_reason": "<string>",
"failure_detail": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Authorizations
Use a Runcrate API key with the rc_live_* prefix as the bearer token. Create one at https://www.runcrate.ai/dashboard/api-keys.
Path Parameters
Cluster ID
Body
application/json
Required range:
1 <= x <= 62Response
The cluster with its new machines.
Show child attributes
Show child attributes
⌘I
Add workers
curl --request POST \
--url https://www.runcrate.ai/api/v1/clusters/{id}/nodes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"count": 1
}'import requests
url = "https://www.runcrate.ai/api/v1/clusters/{id}/nodes"
payload = { "count": 1 }
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({count: 1})
};
fetch('https://www.runcrate.ai/api/v1/clusters/{id}/nodes', 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://www.runcrate.ai/api/v1/clusters/{id}/nodes",
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([
'count' => 1
]),
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://www.runcrate.ai/api/v1/clusters/{id}/nodes"
payload := strings.NewReader("{\n \"count\": 1\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://www.runcrate.ai/api/v1/clusters/{id}/nodes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"count\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.runcrate.ai/api/v1/clusters/{id}/nodes")
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 \"count\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "provisioning",
"stack": "none",
"stack_status": "pending",
"stack_detail": "<string>",
"node_count": 123,
"gpu_type": "<string>",
"gpus_per_node": 123,
"deployment_type": "vm",
"host_tier": "datacenter",
"location": "<string>",
"interconnect": {
"kind": "infiniband",
"label": "<string>",
"rate_gbps": 123,
"note": "<string>"
},
"hourly_rate_per_node": 123,
"hourly_rate": 123,
"created_at": "2023-11-07T05:31:56Z",
"up_at": "2023-11-07T05:31:56Z",
"ready_at": "2023-11-07T05:31:56Z",
"terminated_at": "2023-11-07T05:31:56Z",
"nodes": [
{
"rank": 123,
"role": "head",
"instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "train-1",
"status": "<string>",
"stage": "<string>",
"overlay_address": "<string>",
"gpus": 123,
"ip": "<string>",
"ssh_command": "<string>"
}
],
"connection": {
"head_ssh": "<string>",
"hostfile": "<string>",
"env": {
"MASTER_ADDR": "<string>",
"MASTER_PORT": "<string>",
"NCCL_SOCKET_IFNAME": "<string>"
},
"snippets": {
"torchrun": "<string>",
"mpirun": "<string>",
"deepspeed": "<string>",
"sbatch": "<string>",
"kubectl_tunnel": "<string>",
"ray_tunnel": "<string>"
}
},
"shared": {
"path": "/shared",
"available": true,
"detail": "<string>",
"volume": {
"id": "<string>",
"name": "<string>",
"path": "/shared/volume"
}
},
"events": [
{
"id": 123,
"at": "2023-11-07T05:31:56Z",
"kind": "<string>",
"rank": 123,
"message": "<string>"
}
],
"last_test": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "nccl_all_reduce",
"status": "running",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"result": {
"sizes": [
{
"bytes": 123,
"algbw_gb_s": 123,
"busbw_gb_s": 123,
"time_us": 123
}
],
"peak_busbw_gb_s": 123,
"nodes": 123,
"gpus": 123,
"error": "<string>",
"note": "<string>"
}
},
"billing": {
"billed_since": "2023-11-07T05:31:56Z",
"nodes_billed": 123
},
"resize": true,
"country_code": "<string>",
"failure_reason": "<string>",
"failure_detail": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}