curl --request GET \
--url https://api.cool.computer/api/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cool.computer/api/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cool.computer/api/usage', 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/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cool.computer/api/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cool.computer/api/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cool.computer/api/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"default_visibility": "<string>",
"resources": {
"allocation": {
"available": true,
"vcpu": 123,
"guest_memory_ceiling_mib": 123,
"rootfs_bytes": 123,
"pid_limit": 123,
"open_files_limit": 123
},
"usage": {
"available": true,
"memory": {
"available": true,
"account_limit_mib": 123,
"account_used_mib": 123,
"active_vms": 123,
"sampled_vms": 123,
"unavailable_reason": "<string>",
"sampled_at": "2023-11-07T05:31:56Z",
"sample_age_ms": 123
},
"storage": {
"available": true,
"account_used_bytes": 123,
"account_limit_bytes": 123,
"account_available_bytes": 123,
"unavailable_reason": "<string>"
},
"computers": [
{
"id": "<string>",
"name": "<string>",
"status": "<string>",
"sample_available": true,
"cgroup_sample_available": true,
"firecracker_rss_available": true,
"firecracker_cpu_available": true,
"network_sample_available": true,
"disk_sample_available": true,
"allocated_vcpu": 123,
"cgroup_current_mib": 123,
"cgroup_current_bytes": 123,
"firecracker_rss_bytes": 123,
"firecracker_cpu_seconds": 123,
"cpu_counter_epoch": "<string>",
"balloon": {
"target_mib": 123,
"actual_mib": 123,
"swap_in": 123,
"swap_out": 123,
"major_faults": 123,
"minor_faults": 123,
"free_memory": 123,
"total_memory": 123,
"available_memory": 123,
"disk_caches": 123,
"hugetlb_allocations": 123,
"hugetlb_failures": 123
},
"network_counter_epoch": "<string>",
"guest_ingress_bytes_total": 123,
"guest_egress_bytes_total": 123,
"disk_referenced_bytes": 123,
"disk_available_bytes": 123
}
],
"sampled_at": "2023-11-07T05:31:56Z",
"unavailable_reason": "<string>"
}
},
"computer_quota": {
"limit": 123,
"used": 123,
"rule": "<string>",
"computers": [
{
"id": "<string>",
"name": "<string>",
"status": "<string>"
}
]
},
"site_creations": {
"limit": 123,
"used": 123,
"window_hours": 123
},
"transfers": {
"single_file_bytes": 123,
"archive_payload_bytes": 123,
"archive_entries": 123,
"upload_request_bytes": 123,
"exec_stream_stdin_bytes": 123
},
"network": {
"allowed_host_limit": 123,
"protocols": [
"<string>"
],
"connect_ports": [
123
],
"direct_public_protocols_by_mode": {
"open": [
"<string>"
],
"allowlist": [
"<string>"
],
"none": [
"<string>"
]
}
}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {},
"suggestions": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {},
"suggestions": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {},
"suggestions": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {},
"suggestions": [
"<string>"
]
}Get account usage
Returns the account’s effective limits and defaults next to what it uses now: the computer quota with the computers using it, per-computer resource allocation, sampled memory and storage usage, sites created in the last 24 hours against the daily limit, transfer limits, and network policy limits. Call this before creating a computer or stating account-specific limits.
curl --request GET \
--url https://api.cool.computer/api/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cool.computer/api/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cool.computer/api/usage', 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/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cool.computer/api/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cool.computer/api/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cool.computer/api/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"default_visibility": "<string>",
"resources": {
"allocation": {
"available": true,
"vcpu": 123,
"guest_memory_ceiling_mib": 123,
"rootfs_bytes": 123,
"pid_limit": 123,
"open_files_limit": 123
},
"usage": {
"available": true,
"memory": {
"available": true,
"account_limit_mib": 123,
"account_used_mib": 123,
"active_vms": 123,
"sampled_vms": 123,
"unavailable_reason": "<string>",
"sampled_at": "2023-11-07T05:31:56Z",
"sample_age_ms": 123
},
"storage": {
"available": true,
"account_used_bytes": 123,
"account_limit_bytes": 123,
"account_available_bytes": 123,
"unavailable_reason": "<string>"
},
"computers": [
{
"id": "<string>",
"name": "<string>",
"status": "<string>",
"sample_available": true,
"cgroup_sample_available": true,
"firecracker_rss_available": true,
"firecracker_cpu_available": true,
"network_sample_available": true,
"disk_sample_available": true,
"allocated_vcpu": 123,
"cgroup_current_mib": 123,
"cgroup_current_bytes": 123,
"firecracker_rss_bytes": 123,
"firecracker_cpu_seconds": 123,
"cpu_counter_epoch": "<string>",
"balloon": {
"target_mib": 123,
"actual_mib": 123,
"swap_in": 123,
"swap_out": 123,
"major_faults": 123,
"minor_faults": 123,
"free_memory": 123,
"total_memory": 123,
"available_memory": 123,
"disk_caches": 123,
"hugetlb_allocations": 123,
"hugetlb_failures": 123
},
"network_counter_epoch": "<string>",
"guest_ingress_bytes_total": 123,
"guest_egress_bytes_total": 123,
"disk_referenced_bytes": 123,
"disk_available_bytes": 123
}
],
"sampled_at": "2023-11-07T05:31:56Z",
"unavailable_reason": "<string>"
}
},
"computer_quota": {
"limit": 123,
"used": 123,
"rule": "<string>",
"computers": [
{
"id": "<string>",
"name": "<string>",
"status": "<string>"
}
]
},
"site_creations": {
"limit": 123,
"used": 123,
"window_hours": 123
},
"transfers": {
"single_file_bytes": 123,
"archive_payload_bytes": 123,
"archive_entries": 123,
"upload_request_bytes": 123,
"exec_stream_stdin_bytes": 123
},
"network": {
"allowed_host_limit": 123,
"protocols": [
"<string>"
],
"connect_ports": [
123
],
"direct_public_protocols_by_mode": {
"open": [
"<string>"
],
"allowlist": [
"<string>"
],
"none": [
"<string>"
]
}
}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {},
"suggestions": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {},
"suggestions": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {},
"suggestions": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {},
"suggestions": [
"<string>"
]
}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.
Response
Effective account limits and usage.
Effective limits and defaults next to sampled resource usage for the authenticated account. Read this before stating account-specific limits.

