POST
/
api
/
v0
/
instances
/
{id}
/
ssh
/
attach ssh-key
curl --request POST \
  --url https://console.vast.ai/api/v0/instances/{id}/ssh/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "ssh_key": "ssh-rsa AAAAB3NzaC1yc2EAAA..."
}'
{
  "success": true,
  "msg": "SSH key attached successfully"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
integer
required

ID of the instance to attach the SSH key to

Body

application/json
ssh_key
string

The SSH key to attach to the instance

Example:

"ssh-rsa AAAAB3NzaC1yc2EAAA..."

Response

SSH key attached successfully

success
boolean
Example:

true

msg
string
Example:

"SSH key attached successfully"