---
title: "create ssh-key"
method: POST
path: "/api/v0/ssh/"
tags: ["Accounts"]
---

# create ssh-key

`POST /api/v0/ssh/`

Creates a new SSH key and associates it with your account.
The key will be automatically added to all your current instances.

CLI Usage: `vastai create ssh-key <ssh_key>`

## Request body

- object
  - `ssh_key` string, required — The public SSH key to add (from .pub file)

## Response `200`

SSH key created successfully

- object
  - `success` boolean
  - `key` object
    - `id` integer — The ID of the created SSH key
    - `user_id` integer — The user ID who owns the key
    - `public_key` string — The public SSH key content
    - `created_at` string, date-time
    - `deleted_at` string, date-time, nullable

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `429` — Too Many Requests

---

[API](https://skmtc.net/vast/apis/vast-ai-api.md) · [All operations](https://skmtc.net/vast/apis/vast-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vast/vast-ai-api/revisions/4ed14f79f796/schema)
