---
title: "detach ssh-key"
method: DELETE
path: "/api/v0/instances/{id}/ssh/{ssh_key_id}/"
tags: ["Instances"]
---

# detach ssh-key

`DELETE /api/v0/instances/{id}/ssh/{ssh_key_id}/`

Detaches an SSH key from a specified instance, removing SSH access for that key.

CLI Usage: `vastai detach <instance_id> <ssh_key_id>`

## Path parameters

- `id` integer, required
- `ssh_key_id` integer, required

## Response `200`

SSH key successfully detached

- object
  - `success` boolean
  - `msg` string

## Other responses

- `400` — Bad Request
- `404` — Instance or SSH key not found
- `429` — Too Many Requests
- `500` — Internal Server Error

---

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