> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vast.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# vastai detach ssh

Detach an ssh key from an instance

## Usage

```bash theme={null}
vastai detach instance_id ssh_key_id
```

## Arguments

<ParamField path="instance_id" type="integer" required>
  id of the instance
</ParamField>

<ParamField path="ssh_key_id" type="string" required>
  id of the key to detach to the instance
</ParamField>

## Description

Example: vastai detach 99999 12345

## Examples

```bash theme={null}
vastai detach ssh <INSTANCE_ID> <SSH_KEY_ID>
```

## Global Options

The following options are available for all commands:

| Option          | Description                                           |
| --------------- | ----------------------------------------------------- |
| `--url URL`     | Server REST API URL                                   |
| `--retry N`     | Retry limit                                           |
| `--raw`         | Output machine-readable JSON                          |
| `--explain`     | Verbose explanation of API calls                      |
| `--api-key KEY` | API key (defaults to `~/.config/vastai/vast_api_key`) |
