curl --request POST \
--url https://api.cool.computer/api/computers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"blank": false,
"visibility": "public",
"auto_delete_after": "<string>",
"start": {
"command": "python3 -m http.server 3000",
"port": 3000
}
}
'import requests
url = "https://api.cool.computer/api/computers"
payload = {
"slug": "<string>",
"blank": False,
"visibility": "public",
"auto_delete_after": "<string>",
"start": {
"command": "python3 -m http.server 3000",
"port": 3000
}
}
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({
slug: '<string>',
blank: false,
visibility: 'public',
auto_delete_after: '<string>',
start: {command: 'python3 -m http.server 3000', port: 3000}
})
};
fetch('https://api.cool.computer/api/computers', 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.cool.computer/api/computers",
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([
'slug' => '<string>',
'blank' => false,
'visibility' => 'public',
'auto_delete_after' => '<string>',
'start' => [
'command' => 'python3 -m http.server 3000',
'port' => 3000
]
]),
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.cool.computer/api/computers"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"blank\": false,\n \"visibility\": \"public\",\n \"auto_delete_after\": \"<string>\",\n \"start\": {\n \"command\": \"python3 -m http.server 3000\",\n \"port\": 3000\n }\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.cool.computer/api/computers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"blank\": false,\n \"visibility\": \"public\",\n \"auto_delete_after\": \"<string>\",\n \"start\": {\n \"command\": \"python3 -m http.server 3000\",\n \"port\": 3000\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cool.computer/api/computers")
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 \"slug\": \"<string>\",\n \"blank\": false,\n \"visibility\": \"public\",\n \"auto_delete_after\": \"<string>\",\n \"start\": {\n \"command\": \"python3 -m http.server 3000\",\n \"port\": 3000\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"hostname": "<string>",
"slug": "<string>",
"ip": "<string>",
"status": "<string>",
"visibility": "private",
"access": "owner",
"site": true,
"network_policy": {
"mode": "open",
"allowed_hosts": [
"api.example.com"
]
},
"created_at": "2023-11-07T05:31:56Z",
"public_url": "<string>",
"email_address": "jsmith@example.com",
"auto_delete_at": "2023-11-07T05:31:56Z",
"creation_mode": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}Create a computer
Creates and starts a computer. The request body is optional; omitting it assigns a random available name. Admission uses fresh measured runtime-host headroom. Send an Idempotency-Key when a network failure might cause a retry.
curl --request POST \
--url https://api.cool.computer/api/computers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"blank": false,
"visibility": "public",
"auto_delete_after": "<string>",
"start": {
"command": "python3 -m http.server 3000",
"port": 3000
}
}
'import requests
url = "https://api.cool.computer/api/computers"
payload = {
"slug": "<string>",
"blank": False,
"visibility": "public",
"auto_delete_after": "<string>",
"start": {
"command": "python3 -m http.server 3000",
"port": 3000
}
}
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({
slug: '<string>',
blank: false,
visibility: 'public',
auto_delete_after: '<string>',
start: {command: 'python3 -m http.server 3000', port: 3000}
})
};
fetch('https://api.cool.computer/api/computers', 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.cool.computer/api/computers",
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([
'slug' => '<string>',
'blank' => false,
'visibility' => 'public',
'auto_delete_after' => '<string>',
'start' => [
'command' => 'python3 -m http.server 3000',
'port' => 3000
]
]),
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.cool.computer/api/computers"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"blank\": false,\n \"visibility\": \"public\",\n \"auto_delete_after\": \"<string>\",\n \"start\": {\n \"command\": \"python3 -m http.server 3000\",\n \"port\": 3000\n }\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.cool.computer/api/computers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"blank\": false,\n \"visibility\": \"public\",\n \"auto_delete_after\": \"<string>\",\n \"start\": {\n \"command\": \"python3 -m http.server 3000\",\n \"port\": 3000\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cool.computer/api/computers")
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 \"slug\": \"<string>\",\n \"blank\": false,\n \"visibility\": \"public\",\n \"auto_delete_after\": \"<string>\",\n \"start\": {\n \"command\": \"python3 -m http.server 3000\",\n \"port\": 3000\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"hostname": "<string>",
"slug": "<string>",
"ip": "<string>",
"status": "<string>",
"visibility": "private",
"access": "owner",
"site": true,
"network_policy": {
"mode": "open",
"allowed_hosts": [
"api.example.com"
]
},
"created_at": "2023-11-07T05:31:56Z",
"public_url": "<string>",
"email_address": "jsmith@example.com",
"auto_delete_at": "2023-11-07T05:31:56Z",
"creation_mode": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}Authorizations
A Cool Computers API key, user access token, or claimed agent access token in the Authorization header. Follow https://www.cool.computer/auth.md for agent registration and https://www.cool.computer/authentication.md for direct user credentials.
Headers
A caller-generated key for safely retrying this side effect. The server retains the key and response for 24 hours. Reusing it with the same request replays the original response; reusing it with different input returns 409.
1 - 128^[!-~]+$"req_01J6M6Y9TF9Q9QF6M1ZP8K4R2A"
Body
Optional stable name. The service names api, mail, and www are reserved.
^[a-z0-9]{1,63}$private, public Positive Go duration such as 24h.
Outbound access policy. open allows public destinations, none blocks outbound access, and allowlist permits only the named public hosts. Private and reserved addresses remain blocked.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
{
"command": "python3 -m http.server 3000",
"port": 3000
}
Response
The current computer state.
private, public owner, can_use The URL serves the computer's published files: from the edge, or from its VM's built-in site server, which answers what no file matches with the program on the exposed port.
Outbound access policy. open allows public destinations, none blocks outbound access, and allowlist permits only the named public hosts. Private and reserved addresses remain blocked.
Show child attributes
Show child attributes

