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

# LiveKit

> Capture LiveKit Agents conversations and attach traces to simulations.

Use the LiveKit integration to capture transcript turns, audio, and native LiveKit spans. Bluejay builds the conversation at hang-up.

## Set up the SDK

Set `BLUEJAY_API_KEY` as shown in the [quickstart](https://docs.getbluejay.ai/sdk/overview.md). Install the LiveKit extra for Python or LiveKit Agents 1.10.1 or later for Node.js.

```bash Python icon="https://mintcdn.com/bluejay/73RDPPJpgHtl6PiO/logo/python.svg?fit=max&auto=format&n=73RDPPJpgHtl6PiO&q=85&s=ce56f186813559443f877804e7aef209" theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install "bluejay-sdk[livekit]>=0.4.0"
```

```bash TypeScript icon="https://mintcdn.com/bluejay/73RDPPJpgHtl6PiO/logo/typescript.svg?fit=max&auto=format&n=73RDPPJpgHtl6PiO&q=85&s=d4b45d3e44d76cf40cfb09b3d24831f5" theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Install the SDK preview tarball first.
npm install @livekit/agents
```

Create the client once at startup. In your existing LiveKit job, attach Bluejay before starting the session.

```python Python icon="https://mintcdn.com/bluejay/73RDPPJpgHtl6PiO/logo/python.svg?fit=max&auto=format&n=73RDPPJpgHtl6PiO&q=85&s=ce56f186813559443f877804e7aef209" theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from bluejay import BluejayClient

client = BluejayClient(tracing=True)

# In your LiveKit job, after creating the AgentSession:
client.instrument_livekit(ctx, session, external_agent_id="support-voice")
await session.start(room=ctx.room, agent=SupportAgent())
```

```typescript TypeScript icon="https://mintcdn.com/bluejay/73RDPPJpgHtl6PiO/logo/typescript.svg?fit=max&auto=format&n=73RDPPJpgHtl6PiO&q=85&s=d4b45d3e44d76cf40cfb09b3d24831f5" theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { BluejayClient } from "@getbluejay/sdk";
import { instrumentLiveKit } from "@getbluejay/sdk/livekit";

const client = new BluejayClient({ tracing: true });

// In the LiveKit job, start your existing AgentSession through the integration.
await instrumentLiveKit(client, ctx, session, { externalAgentId: "support-voice" }, {
  room: ctx.room,
  agent,
  record: { audio: true },
});
```

Use the external ID configured on your Bluejay agent. You can also pass `agent_id` with its Bluejay ID. The integration uses LiveKit's native model and tool spans. Pass `record_audio=False` if you want spans and transcript without uploading audio.

## Verify a call

Place a call and hang up. Open the conversation in [Logs](https://docs.getbluejay.ai/monitor/logs) to inspect its transcript, audio, and trace.

## Attach traces to a simulation

For Bluejay test calls, the SDK reads the `X-Simulation-Result-Id` participant attribute. If your transport supplies the ID as job metadata or a header, read it there and pass `simulation_result_id` to `instrument_livekit()`. See [Connect LiveKit](https://docs.getbluejay.ai/integrations/livekit.md) for how each transport delivers it, and [Run simulations](https://docs.getbluejay.ai/sdk/simulations.md) to queue a test from Python.

Node.js uses LiveKit’s finalized recording and FFmpeg to upload audio at hang-up. Keep FFmpeg on the worker’s PATH and set LiveKit’s recording options to the categories you want to capture. Set `recordAudio: false` to skip the Bluejay audio upload.


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