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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.