Docs API reference Cloud servers SSH keys SSH keys Account-level public keys you can install on new servers.
# GET /cloud/ssh-keys List SSH keys Scope: cloud_read listSshKeys OpenAPI for this operation
Parameters Field in Type Description pagequery integer limitquery integer
Responses 200 SSH keys — data: array<SshKey> 401 Missing, invalid or revoked key
Examples curl CLI Terraform Python JavaScript
Copy curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys' \
-H "Authorization: Bearer $GYRO_TOKEN"Copy # resource gyro_ssh_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/ssh_key
resource "gyro_ssh_key" "laptop" {
name = "laptop"
public_key = file("~/.ssh/id_ed25519.pub")
}Copy import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])Copy const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys", {
method: "GET",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);# POST /cloud/ssh-keys Add an SSH key Scope: cloud_write createSshKey OpenAPI for this operation
Accepts ssh-ed25519, ecdsa-sha2-nistp256/384/521, sk-ssh-ed25519 and ssh-rsa (2048 bit or more). At most 50 keys per account; fingerprints are unique per account.
Request body Field Type Description name required string public_key required string
Responses 201 Created — data: SshKey 401 Missing, invalid or revoked key 403 Key lacks the scope, IP not allowed, or feature disabled 409 State conflict (server_locked, not_actionable, ssh_key_exists, server_limit, idempotency_in_flight) 422 Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)
Examples curl CLI Terraform Python JavaScript
Copy curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys' \
-H "Authorization: Bearer $GYRO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "laptop", "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFaA... me@laptop"}'Copy gyro ssh-key create --help # all flagsCopy # resource gyro_ssh_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/ssh_key
resource "gyro_ssh_key" "laptop" {
name = "laptop"
public_key = file("~/.ssh/id_ed25519.pub")
}Copy import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys", headers=h, json={"name": "laptop", "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFaA... me@laptop"}, timeout=60)
r.raise_for_status()
print(r.json()["data"])Copy const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"name": "laptop", "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFaA... me@laptop"}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);# GET /cloud/ssh-keys/{id} Get an SSH key Scope: cloud_read getSshKey OpenAPI for this operation
Parameters Field in Type Description id required path integer
Responses 200 SSH key — data: SshKey 404 Not found — also returned for objects owned by someone else
Examples curl CLI Terraform Python JavaScript
Copy curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345' \
-H "Authorization: Bearer $GYRO_TOKEN"Copy gyro ssh-key get 12345Copy # resource gyro_ssh_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/ssh_key
resource "gyro_ssh_key" "laptop" {
name = "laptop"
public_key = file("~/.ssh/id_ed25519.pub")
}Copy import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])Copy const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345", {
method: "GET",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);# DELETE /cloud/ssh-keys/{id} Delete an SSH key Scope: cloud_write deleteSshKey OpenAPI for this operation
Removes the key from your account. Servers that already have it keep it.
Parameters Field in Type Description id required path integer
Responses 200 Deleted — data: object 404 Not found — also returned for objects owned by someone else
Examples curl CLI Terraform Python JavaScript
Copy curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345' \
-H "Authorization: Bearer $GYRO_TOKEN"Copy gyro ssh-key delete 12345Copy # resource gyro_ssh_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/ssh_key
resource "gyro_ssh_key" "laptop" {
name = "laptop"
public_key = file("~/.ssh/id_ed25519.pub")
}Copy import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])Copy const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/ssh-keys/12345", {
method: "DELETE",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);