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

# baseten route api-key

> Manage your routes API keys (PRE-RELEASE)

<Note>
  PRE-RELEASE: route commands are not GA yet. Their arguments, flags, and output may change.
</Note>

Manage the routes API keys you created, such as with harness setup, across all your machines and teams.

## list

```sh theme={"system"}
baseten route api-key list [OPTIONS]
```

List the routes API keys you created, across all your machines and teams. Key values are never shown.

### Options

<ParamField body="-q, --jq" type="TEXT">
  Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
</ParamField>

<ParamField body="-o, --output" type="TEXT" default="text">
  Output format

  One of: `text`, `json`, `jsonl`, `none`
</ParamField>

<ParamField body="--profile" type="TEXT">
  Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile
</ParamField>

<ParamField body="-v, --verbose" type="BOOL">
  Enable verbose logging
</ParamField>

### Examples

List your routes API keys

```sh theme={"system"}
baseten route api-key list
```

### Filter output with `--jq`

Print key prefixes

```sh theme={"system"}
baseten route api-key list --jq '.keys[].prefix'
```

### Output

**Text mode (`--output text`):** Table with NAME, PREFIX, TEAM, CREATED, and LAST USED columns.

**JSON mode (`--output json`):** payload type `managementapi.APIKeys`.

## delete

```sh theme={"system"}
baseten route api-key delete [OPTIONS]
```

Delete one routes API key by prefix, or all of them with `--all`. Harnesses using a deleted key lose access until you rerun harness setup on that machine, which creates a new key.

### Options

<ParamField body="--all" type="BOOL">
  Delete all your routes API keys, on every machine and team.

  Mutually exclusive with other flags in group `key`.
</ParamField>

<ParamField body="-q, --jq" type="TEXT">
  Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
</ParamField>

<ParamField body="-o, --output" type="TEXT" default="text">
  Output format

  One of: `text`, `json`, `jsonl`, `none`
</ParamField>

<ParamField body="--prefix" type="TEXT">
  Prefix of the key to delete, as shown by route api-key list.

  Mutually exclusive with other flags in group `key`.
</ParamField>

<ParamField body="--profile" type="TEXT">
  Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile
</ParamField>

<ParamField body="--yes" type="BOOL">
  Skip the interactive confirmation prompt. Required when stdin is not a terminal.
</ParamField>

<ParamField body="-v, --verbose" type="BOOL">
  Enable verbose logging
</ParamField>

### Examples

Delete a lost machine's key

```sh theme={"system"}
baseten route api-key delete --prefix <prefix>
```

Delete all your routes API keys without prompting

```sh theme={"system"}
baseten route api-key delete --all --yes
```

### Filter output with `--jq`

Print deleted prefixes

```sh theme={"system"}
baseten route api-key delete --prefix <prefix> --yes --jq '.deleted[]'
```

### Output

**Text mode (`--output text`):** Each deleted prefix, on stderr.

**JSON mode (`--output json`):** payload type `cmd.RouteAPIKeyDeleteResult`.

deleted lists the deleted prefixes and failed the ones that could not be deleted. The command fails if any deletion failed.
