v1

latestOpenAPI 3.1.02026-07-13897404.3 KB
Instances

attach ssh-key

Attaches an SSH key to the specified instance, allowing SSH access using the provided key.

CLI Usage: vastai attach ssh <instance_id> <ssh_key>

post/api/v0/instances/{id}/ssh/

Path parameters

idinteger required

ID of the instance to attach the SSH key to

Request body

ssh_keystring

The SSH key to attach to the instance

Example request

{
  "ssh_key": "ssh-rsa AAAAB3NzaC1yc2EAAA..."
}

Response

SSH key attached successfully

successboolean
msgstring

Example response

{
  "success": true,
  "msg": "SSH key attached successfully"
}