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

# API keys

> Create, store and revoke the keys your server uses to start avatar sessions.

Your server uses an API key to start [Realistic Avatar](https://docs.talking-avatar.dev/realistic-avatars/overview.md) sessions, and to manage a private voice agent's [links](https://docs.talking-avatar.dev/voice-agents/private-agents.md). Keys look like `tav_…`.

> [!WARNING]
>
> Keep API keys on your server. Never put one in browser code, a mobile app, a public repository, or a chat. Anyone with a key can start sessions billed to your balance.

## Create a key

**1. Open API keys**

In the dashboard, click **API keys** in the sidebar, then **Create key**.

**2. Name it**

Give it a **Name** (up to 255 characters), such as *Production voice agent*. Add an optional **Description** (up to 1,000 characters), such as *Used by the EU interview cluster*.

**3. Save the key**

The full key is shown **once**. Click **Copy key** and store it in your server's secrets, for example as the environment variable `TALKING_AVATAR_API_KEY`.

Keys are stored hashed, so nobody (including us) can show you a key again. If you lose one, revoke it and create a new one.

## The keys list

| Column | Meaning |
| - | - |
| **Name** | The name and description you gave it |
| **Key** | The start of the key, so you can tell keys apart |
| **Created** | When you created it |
| **Last used** | When it last started a session |

The [Usage](https://docs.talking-avatar.dev/dashboard/usage.md) page shows which key started each session.

## Revoke a key

Click the trash icon next to a key, then **Revoke key**. The key stops working immediately: new sessions with it are refused. Sessions that are already live keep running until they end.

Revoke a key straight away if it may have been exposed.

## Using a key

```js Realistic Avatars theme={null}
import { LiveAvatar } from "@interviewflowai/talking-avatar/server";

const avatar = await LiveAvatar.start({
  apiKey: process.env.TALKING_AVATAR_API_KEY,
  avatar: "ava4",
});
```

```js Private agent links theme={null}
import { createAgentLink } from "@interviewflowai/talking-avatar/server";

const link = await createAgentLink({
  apiKey: process.env.TALKING_AVATAR_API_KEY,
  agentId: "your-agent-id",
});
```

```bash REST API theme={null}
curl https://backend.talking-avatar.dev/api/talking-avatar/voice-agents/AGENT_ID/links \
  -H "Authorization: Bearer $TALKING_AVATAR_API_KEY"
```

A session started with an invalid, revoked or missing key ends with close code `4001`. See [Sessions and errors](https://docs.talking-avatar.dev/realistic-avatars/sessions.md#close-codes).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.