MENU navbar-image

Introduction

CloudCompute REST API for GPU offers, instances, and SSH keys.

Authenticate with your API key (`Authorization: Bearer cc-…`) from the **API access** page in the dashboard.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

Create a key at /api-access in the dashboard. The raw token is shown once at creation.

Endpoints

POST api/v1/chat/completions

requires authentication

Example request:
curl --request POST \
    "https://app.cloudcompute.ru/api/v1/api/v1/chat/completions" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://app.cloudcompute.ru/api/v1/api/v1/chat/completions"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/v1/chat/completions

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/v1/models

requires authentication

Example request:
curl --request GET \
    --get "https://app.cloudcompute.ru/api/v1/api/v1/models" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://app.cloudcompute.ru/api/v1/api/v1/models"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "error": {
        "message": "Invalid API key.",
        "type": "invalid_request_error",
        "code": 401
    }
}
 

Request      

GET api/v1/models

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/v1/offers

requires authentication

Example request:
curl --request GET \
    --get "https://app.cloudcompute.ru/api/v1/api/v1/offers" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://app.cloudcompute.ru/api/v1/api/v1/offers"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "error": {
        "message": "Invalid API key.",
        "code": "invalid_api_key"
    }
}
 

Request      

GET api/v1/offers

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/v1/instances

requires authentication

Example request:
curl --request GET \
    --get "https://app.cloudcompute.ru/api/v1/api/v1/instances" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://app.cloudcompute.ru/api/v1/api/v1/instances"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "error": {
        "message": "Invalid API key.",
        "code": "invalid_api_key"
    }
}
 

Request      

GET api/v1/instances

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/v1/instances

requires authentication

Example request:
curl --request POST \
    "https://app.cloudcompute.ru/api/v1/api/v1/instances" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": 16,
    \"ask_id\": 16,
    \"name\": \"n\",
    \"stats\": \"architecto\",
    \"template_image\": \"n\",
    \"template_id\": 16,
    \"template_hash_id\": \"n\",
    \"runtype\": \"architecto\",
    \"disk_gb\": 22,
    \"offer_disk_space\": 7,
    \"install_monitoring\": false,
    \"ssh_key_ids\": [
        16
    ]
}"
const url = new URL(
    "https://app.cloudcompute.ru/api/v1/api/v1/instances"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": 16,
    "ask_id": 16,
    "name": "n",
    "stats": "architecto",
    "template_image": "n",
    "template_id": 16,
    "template_hash_id": "n",
    "runtype": "architecto",
    "disk_gb": 22,
    "offer_disk_space": 7,
    "install_monitoring": false,
    "ssh_key_ids": [
        16
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/instances

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

type   integer     

Example: 16

ask_id   integer  optional    

Example: 16

name   string  optional    

validation.max. Example: n

stats   string  optional    

Example: architecto

template_image   string  optional    

Must match the regex /^$|^([a-z0-9][a-z0-9.\/-]*)(?::[@a-zA-Z0-9][@a-zA-Z0-9.-]*|@sha256:[a-fA-F0-9]{64})?$/u. validation.max. Example: n

template_id   integer  optional    

Example: 16

template_hash_id   string  optional    

validation.max. Example: n

runtype   string  optional    

Example: architecto

disk_gb   integer  optional    

validation.min validation.max. Example: 22

offer_disk_space   number  optional    

validation.min validation.max. Example: 7

install_monitoring   boolean  optional    

Example: false

ssh_key_ids   integer[]  optional    

Must match an existing stored value.

GET api/v1/instances/{instanceId}

requires authentication

Example request:
curl --request GET \
    --get "https://app.cloudcompute.ru/api/v1/api/v1/instances/564" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://app.cloudcompute.ru/api/v1/api/v1/instances/564"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "error": {
        "message": "Invalid API key.",
        "code": "invalid_api_key"
    }
}
 

Request      

GET api/v1/instances/{instanceId}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

instanceId   string     

Example: 564

PATCH api/v1/instances/{instanceId}

requires authentication

Example request:
curl --request PATCH \
    "https://app.cloudcompute.ru/api/v1/api/v1/instances/564" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"label\": \"b\",
    \"name\": \"n\"
}"
const url = new URL(
    "https://app.cloudcompute.ru/api/v1/api/v1/instances/564"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "label": "b",
    "name": "n"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/v1/instances/{instanceId}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

instanceId   string     

Example: 564

Body Parameters

label   string  optional    

validation.max. Example: b

name   string  optional    

validation.max. Example: n

DELETE api/v1/instances/{instanceId}

requires authentication

Example request:
curl --request DELETE \
    "https://app.cloudcompute.ru/api/v1/api/v1/instances/564" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://app.cloudcompute.ru/api/v1/api/v1/instances/564"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/instances/{instanceId}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

instanceId   string     

Example: 564

GET api/v1/ssh-keys

requires authentication

Example request:
curl --request GET \
    --get "https://app.cloudcompute.ru/api/v1/api/v1/ssh-keys" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://app.cloudcompute.ru/api/v1/api/v1/ssh-keys"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "error": {
        "message": "Invalid API key.",
        "code": "invalid_api_key"
    }
}
 

Request      

GET api/v1/ssh-keys

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/v1/ssh-keys

requires authentication

Example request:
curl --request POST \
    "https://app.cloudcompute.ru/api/v1/api/v1/ssh-keys" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"public_key\": \"architecto\",
    \"name\": \"architecto\"
}"
const url = new URL(
    "https://app.cloudcompute.ru/api/v1/api/v1/ssh-keys"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "public_key": "architecto",
    "name": "architecto"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/ssh-keys

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

public_key   string     

Example: architecto

name   string     

Example: architecto

DELETE api/v1/ssh-keys/{sshKeyId}

requires authentication

Example request:
curl --request DELETE \
    "https://app.cloudcompute.ru/api/v1/api/v1/ssh-keys/564" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://app.cloudcompute.ru/api/v1/api/v1/ssh-keys/564"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/ssh-keys/{sshKeyId}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

sshKeyId   string     

Example: 564