# Authentication

Every request carries your API key as a Bearer token. Where to find it, how to send it and how to rotate it.

The API only listens on `127.0.0.1`, so nothing outside your computer can reach it. On top of that, every request needs your API key, so other apps and websites on the same machine can't control the voice changer without it.

## Find your key

Open **Settings** in Voices AI Live. With **Stream Deck and other apps** turned on, the **Developer** section shows the endpoint and your API key, masked. Use the eye button to show it or the copy button to copy it.

## Send it with every request

Pass the key as a Bearer token in the `Authorization` header:

```bash
curl http://127.0.0.1:19470/v1/status \
  -H "Authorization: Bearer $VOICES_AI_API_KEY"
```

The same works from code:

```javascript
const res = await fetch('http://127.0.0.1:19470/v1/status', {
  headers: { Authorization: `Bearer ${process.env.VOICES_AI_API_KEY}` },
});
```

The events stream needs the header too. A browser's built-in `EventSource` can't set headers, so read the stream with `fetch` instead, as shown in [Stream realtime events](/reference/stream-events).

## Missing or wrong key

Requests without a valid key get a `401`:

```json
{
  "error": "Invalid or missing API key"
}
```

## Rotate the key

If a key ends up somewhere it shouldn't, click **Regenerate** next to it in **Settings > Developer**. The old key stops working right away, so update your integrations with the new one.

## Browser apps

The API allows requests from any web page (CORS), so tools that run in a browser can call it directly. The key is what keeps them out: only send it from pages you trust, and never put it in code you publish.
