API reference
Add SSH key to instance
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.
View MarkdownPOST/instances/{id}/add_key
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.
Parameters
id· path- Instance ID
Request body
application/json
| Field | Type | Description |
|---|---|---|
public_key | string | Optional SSH public key material. Omit to have a key pair generated and the private key returned. |
Responses
200 · OK
| Field | Type | Description |
|---|---|---|
key | string | Private key (only when generated) |
message | string | Status message |
successRequired | boolean | Whether the key was successfully added |
uuidRequired | string |
400 · Bad Request
| Field | Type | Description |
|---|---|---|
code | integer | |
error | string | |
message | string |
401 · Unauthorized
| Field | Type | Description |
|---|---|---|
code | integer | |
error | string | |
message | string |
404 · Not Found
| Field | Type | Description |
|---|---|---|
code | integer | |
error | string | |
message | string |
500 · Internal Server Error
| Field | Type | Description |
|---|---|---|
code | integer | |
error | string | |
message | string |
Operation specification
The downloadable Markdown includes the published OpenAPI schema. Use the API origin provided by your compute account.