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

# api-keys

> DevHelm CLI api-keys commands — list, create, revoke, and delete API keys

Manage API keys from the command line. Create keys for CI/CD pipelines, service integrations, and team members.

## Commands

| Command                        | Description          |
| ------------------------------ | -------------------- |
| `devhelm api-keys list`        | List all API keys    |
| `devhelm api-keys get <id>`    | Get API key details  |
| `devhelm api-keys create`      | Create a new API key |
| `devhelm api-keys delete <id>` | Delete an API key    |
| `devhelm api-keys revoke <id>` | Revoke an API key    |

## api-keys list

```bash theme={null}
devhelm api-keys list
```

Lists all API keys with their names, full key values, creation dates, and last-used timestamps.

<Warning>
  `list` and `get` return the **full `dh_live_*` key value**, not a masked prefix. Treat the output as sensitive — don't paste it into logs or CI output.
</Warning>

<Note>
  API key IDs are **numeric** (e.g. `42`), unlike most other resources which use UUIDs.
</Note>

## api-keys get

```bash theme={null}
devhelm api-keys get 42
```

## api-keys create

```bash theme={null}
devhelm api-keys create --name "CI Pipeline"
```

| Flag           | Type   | Required | Description                             |
| -------------- | ------ | -------- | --------------------------------------- |
| `--name`       | string | Yes      | Key display name                        |
| `--expires-at` | string | —        | Expiration timestamp in ISO 8601 format |

Create a key with an expiration date:

```bash theme={null}
devhelm api-keys create \
  --name "Contractor access" \
  --expires-at "2026-09-01T00:00:00Z"
```

The create response includes the full key value — copy it into your secret store right away.

## api-keys delete

Permanently delete an API key. Prompts for confirmation; pass `--yes` (`-y`) in scripts and CI.

```bash theme={null}
devhelm api-keys delete 42
```

## api-keys revoke

Revoke an API key. The key remains visible in the list but can no longer authenticate.

```bash theme={null}
devhelm api-keys revoke 42
```

## Next steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/cli/authentication">
    Token resolution order and saved contexts.
  </Card>

  <Card title="Authentication reference" icon="lock" href="/authentication">
    API token formats and security best practices.
  </Card>
</CardGroup>
