---
title: "Save an SSH key"
method: POST
path: "/agent/compute/ssh-keys"
tags: ["Compute"]
---

# Save an SSH key

`POST /agent/compute/ssh-keys`

## Request

- Base URL: `https://edge.network`
- URL: `https://edge.network/agent/compute/ssh-keys`
- Auth: HTTP bearer

Save a public key on the account. Returns an id usable in ssh_key_ids at VM creation, or attach later with attachVmSshKey.

## Headers

- `X-Dry-Run` 'true' | 'false'
- `Idempotency-Key` string

## Request body

- object
  - `name` string, required: Friendly name, e.g. "alice-laptop".
  - `public_key` string, required: ssh-ed25519, ssh-rsa, or ecdsa-sha2-* public key string.

## Response `201`

Success.

- object
  - `ssh_key` SshKey, required
    - `id` string, required
    - `name` string, required
    - `public_key` string
    - `created_at` string, date-time
  - `tell_user` string: Human-readable summary of what happened, for the agent to relay to its operator.

## Other responses

- `400`: Validation error — the response body explains what to fix.
- `401`: Missing or invalid agent access code. The body includes self-signup pointers.
- `429`: Rate limited. Honour Retry-After and the RateLimit-* headers before retrying.

---

[API](https://skmtc.dev/edge/apis/edge-network-agent-api.md) · [All operations](https://skmtc.dev/edge/apis/edge-network-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/edge/apis/edge-network-agent-api/revisions/49b5f2adf020?raw)
