Skip to content
OpenRelay is in early access, and the /v1 API is stable. New capabilities ship in the changelog.
API ReferenceComputeVMs

Attach an org SSH key to a VM

Adds one of the org's SSH keys to the VM's allowed set, so the gateway accepts that key for SSH into the guest. Attaching a key already attached answers 204. The key must be a live key of the VM's organization, and a terminated VM answers 400.

Required permission

Requires the compute.operate permission. See Permissions for the roles and API key permissions that include it.

Command line

The orl CLI wraps this endpoint:

orl vms ssh-key attach <id> --ssh-key-id <ssh-key-id>
POST
/v1/vms/{id}/ssh-keys

Authorization

apiKey
headerAuthorizationBearer <token>

OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).

Path Parameters

id*string

Request Body

application/json
  1. body
sshKeyId*string

Response Body

Attached

Example Request
curl -X POST 'https://api.openrelay.inc/v1/vms/string/ssh-keys' \  -H 'Content-Type: application/json' \  -d '{  "sshKeyId": "string"}'
Example Response
Empty