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

# keys

> Scoped API keys — client.keys, and where the secret appears.

Four methods. API detail: [Authentication](/docs/api/authentication).

<Warning>
  Only `create` and `rotate` ever answer a `secret`. Store it then; `list` never returns one.
</Warning>

## create

```ts theme={"system"}
client.keys.create(body: { name: string; scopes: Scope[] }): Promise<MintedKey>
```

`POST /v1/api_keys`. The reply is the key **plus** `secret`, `org_id`, and `mode` (`test | live`) — the only response shape that carries them. A key can only mint another key in its own mode.

## list

```ts theme={"system"}
client.keys.list(query?: ListQuery): Promise<Page<ApiKey>>
```

`GET /v1/api_keys` — name, `prefix`, scopes, `created_by`; never a secret.

## rotate

```ts theme={"system"}
client.keys.rotate(id: string): Promise<MintedKey>
```

`POST /v1/api_keys/{id}/rotate`. Mints a replacement secret under the same id; the reply carries it once.

## revoke

```ts theme={"system"}
client.keys.revoke(id: string): Promise<Deleted>
```

`DELETE /v1/api_keys/{id}`. Immediate — the next request on the old secret is a `401`.
