Create a cluster
Create node_count machines of one offer on a private network, with SSH between them, /shared on every machine (not on container machines) and the chosen stack. All or nothing: every machine starts or none does, and a cluster that could not start costs nothing. Billing starts when every machine is up and joined (up_at), for every machine at once at hourly_rate_per_node, and runs until the cluster is terminated. The answer is the cluster in provisioning; poll GET /clusters/{id} for ready. Your balance must cover at least one hour of the whole cluster, and never less than $10.
curl --request POST \
--url https://www.runcrate.ai/api/v1/clusters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"offer_id": "<string>",
"node_count": 33,
"stack": "none",
"ssh_key_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"storage_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"include_community": false
}
'import requests
url = "https://www.runcrate.ai/api/v1/clusters"
payload = {
"name": "<string>",
"offer_id": "<string>",
"node_count": 33,
"stack": "none",
"ssh_key_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"storage_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"include_community": False
}
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({
name: '<string>',
offer_id: '<string>',
node_count: 33,
stack: 'none',
ssh_key_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
storage_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
include_community: false
})
};
fetch('https://www.runcrate.ai/api/v1/clusters', 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",
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>',
'offer_id' => '<string>',
'node_count' => 33,
'stack' => 'none',
'ssh_key_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'storage_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'include_community' => false
]),
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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"offer_id\": \"<string>\",\n \"node_count\": 33,\n \"stack\": \"none\",\n \"ssh_key_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"storage_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"include_community\": false\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"offer_id\": \"<string>\",\n \"node_count\": 33,\n \"stack\": \"none\",\n \"ssh_key_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"storage_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"include_community\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.runcrate.ai/api/v1/clusters")
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 \"name\": \"<string>\",\n \"offer_id\": \"<string>\",\n \"node_count\": 33,\n \"stack\": \"none\",\n \"ssh_key_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"storage_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"include_community\": false\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>"
}
}{
"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": {}
}
}{
"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.
Headers
1 to 255 visible ASCII characters. The same key in the same environment returns the cluster it created (200) instead of creating another.
1 - 255^[\x21-\x7e]+$Body
1 to 63 letters, digits or hyphens, starting with a letter or digit. Machines are named <name>-<rank>.
^[A-Za-z0-9][A-Za-z0-9-]{0,62}$From GET /clusters/offers.
Number of machines: within the offer's min_nodes and max_nodes, and one of its allowed_node_counts when it has them.
2 <= x <= 64Software installed across the machines. Must be one of the offer's stacks.
none, slurm, kubernetes, ray SSH keys added on every machine. Optional: keyless SSH certificates always work.
20A volume synced into /shared/volume on the head. Not on community hosts; list offers with volume=true.
Needed when the offer is on community hosts.
Response
The cluster this Idempotency-Key already created.
Show child attributes
Show child attributes
curl --request POST \
--url https://www.runcrate.ai/api/v1/clusters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"offer_id": "<string>",
"node_count": 33,
"stack": "none",
"ssh_key_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"storage_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"include_community": false
}
'import requests
url = "https://www.runcrate.ai/api/v1/clusters"
payload = {
"name": "<string>",
"offer_id": "<string>",
"node_count": 33,
"stack": "none",
"ssh_key_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"storage_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"include_community": False
}
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({
name: '<string>',
offer_id: '<string>',
node_count: 33,
stack: 'none',
ssh_key_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
storage_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
include_community: false
})
};
fetch('https://www.runcrate.ai/api/v1/clusters', 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",
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>',
'offer_id' => '<string>',
'node_count' => 33,
'stack' => 'none',
'ssh_key_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'storage_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'include_community' => false
]),
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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"offer_id\": \"<string>\",\n \"node_count\": 33,\n \"stack\": \"none\",\n \"ssh_key_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"storage_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"include_community\": false\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"offer_id\": \"<string>\",\n \"node_count\": 33,\n \"stack\": \"none\",\n \"ssh_key_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"storage_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"include_community\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.runcrate.ai/api/v1/clusters")
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 \"name\": \"<string>\",\n \"offer_id\": \"<string>\",\n \"node_count\": 33,\n \"stack\": \"none\",\n \"ssh_key_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"storage_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"include_community\": false\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>"
}
}{
"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": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}