# keys

> Your organization's own provider keys (BYOK): Gateway calls each provider with its key.

Your organization's own provider keys (BYOK): Gateway calls each provider with its key.

## nexus keys add

```sh
nexus keys add <provider> <key> [--team <slug|id>] [--user <me|id>]
```

Bring your own provider key (owners and admins); encrypted at rest. With --team or --user, a team's or a person's key, which their calls use first.

| Option | Meaning |
| --- | --- |
| `--team <slug|id>` | The team that holds the key: its slug or id |
| `--user <me|id>` | The person who holds the key: me, or their user id |

```sh
nexus keys add anthropic sk-ant-…
```

## nexus keys list

```sh
nexus keys list
```

Your provider keys, masked, with the teams' and people's keys you may read.

```sh
nexus keys list --json
```

## nexus keys history

```sh
nexus keys history <provider> [--team <slug|id>] [--user <me|id>]
```

A provider key's versions: who added each, when, and its last four characters.

| Option | Meaning |
| --- | --- |
| `--team <slug|id>` | The team that holds the key: its slug or id |
| `--user <me|id>` | The person who holds the key: me, or their user id |

## nexus keys replace

```sh
nexus keys replace <provider> <key> [--team <slug|id>] [--user <me|id>] [--dry-run]
```

Replace a provider key, checked against its provider first (owners and admins).

| Option | Meaning |
| --- | --- |
| `--team <slug|id>` | The team that holds the key: its slug or id |
| `--user <me|id>` | The person who holds the key: me, or their user id |
| `--dry-run` | Show what would change, change nothing |

## nexus keys disable

```sh
nexus keys disable <provider> [--team <slug|id>] [--user <me|id>] [--dry-run]
```

Stop calls from using a provider key; it stays sealed (owners and admins).

| Option | Meaning |
| --- | --- |
| `--team <slug|id>` | The team that holds the key: its slug or id |
| `--user <me|id>` | The person who holds the key: me, or their user id |
| `--dry-run` | Show what would change, change nothing |

## nexus keys enable

```sh
nexus keys enable <provider> [--team <slug|id>] [--user <me|id>] [--dry-run]
```

Use a disabled or rejected provider key again, checked against its provider first (owners and admins).

| Option | Meaning |
| --- | --- |
| `--team <slug|id>` | The team that holds the key: its slug or id |
| `--user <me|id>` | The person who holds the key: me, or their user id |
| `--dry-run` | Show what would change, change nothing |

## nexus keys remove

```sh
nexus keys remove <provider> [--team <slug|id>] [--user <me|id>] [--dry-run]
```

Delete a provider key; its versions stay (owners and admins).

| Option | Meaning |
| --- | --- |
| `--team <slug|id>` | The team that holds the key: its slug or id |
| `--user <me|id>` | The person who holds the key: me, or their user id |
| `--dry-run` | Show what would change, change nothing |

## nexus keys revoke

```sh
nexus keys revoke <scoped key id> [--dry-run]
```

Revoke a module's scoped key before it expires (owners and admins): its key id (keyId in the JSON of nexus spend, or the audit log), or its smk_… id.

| Option | Meaning |
| --- | --- |
| `--dry-run` | Show what would change, change nothing |
