Instances

Add SSH key to instance

Changed on

Append an SSH public key to an existing instance's authorized_keys.

Behavior:

  • If public_key is provided, that raw key material is appended to authorized_keys. If the same public key is already attached, the request is a no-op (no error).
  • If public_key is omitted, Thunder generates a new key pair, appends the public half to authorized_keys, and returns the private key in the response. The private key is only returned once — store it immediately.

Note: SSH keys saved in your account (Authentication section of the console) are a separate store and are NOT automatically attached to instances. To use one of those keys, copy its public key material into the public_key field on this request.

post/instances/{id}/add_key

Request

  • Base URL
    https://api.thundercompute.com:8443/v1
  • Auth
    API key in header Authorization

Path parameters

idstring required

Instance ID

Request body

public_keystring

Optional SSH public key material. Omit to have a key pair generated and the private key returned.

Response

OK

keystring

Private key (only when generated)

messagestring

Status message

successboolean required

Whether the key was successfully added

uuidstring required

Changes

    • breaking

      removed subschema #1 from the request body oneOf list

    • breaking

      the request's body type changed from no type to object

    • info

      added the new optional request property