Skip to main content
Register an SSH key
Register an SSH public key with the Compute API before creating an instance. New instances use the most recently registered key, including registrations made in the console. Existing instances keep their original key.
Send only the public key, normally the file ending in .pub. Never send the private key.

Request

Create a local ssh-key.json file containing:
Replace the placeholder with one complete OpenSSH public key (up to 8,192 characters). Accepted types are Ed25519, ECDSA P-256/P-384/P-521, sk-ssh-ed25519@openssh.com, sk-ecdsa-sha2-nistp256@openssh.com, and RSA with at least 2,048 bits. Then send the file:

Response

A successful registration returns 201 Created with id, content, and created_at. id is a UUID. created_at is a date-time string or null. Save the ID so you can retrieve the key. Registering the same key again creates another record with a new ID. It does not return the existing ID or a duplicate-key conflict. A trailing newline is preserved.

Validation and scope

Invalid key content returns 400. Rejected inputs include malformed keys, RSA keys shorter than 2048 bits, options prefixes such as no-pty, SSH certificates, and multiple key lines. A missing or invalid API key returns 401. Account restrictions can return 403, throttling returns 429, and a server error returns 500. This API supports registration and retrieval by ID. Key listing, deletion, names, and fingerprints are not available in this release. Use the key with the instance creation workflow. For authentication and throttling errors, see Handle errors and rate limits.

Authorizations

Authorization
string
header
required

An API key issued by Hive Compute support. See Authentication above for how to request one.

Body

application/json
content
string
required

The public key, in OpenSSH format.

Maximum string length: 8192
Example:

"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIETCectK27yhdmuct8RFCynCjeWek5/ShKk6ISJZFSx+ you@laptop"

Response

The key was registered.

id
string<uuid>
content
string

The public key, as registered.

created_at
string<date-time> | null