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

# Model 2: Hosted Sessions

> Chert hosts the room; your participant joins it.

For teams without LiveKit infrastructure that want their own humans or software on FaceTime calls, including a “FaceTime us” button.

<h2 id="how">
  How it works
</h2>

Chert creates a LiveKit room, bridges FaceTime into it, and returns a short-lived, room-scoped participant token. Your client joins with a standard LiveKit SDK. Chert mints the token; you join Chert's room.

<h2 id="outbound">
  Outbound session
</h2>

```http theme={null}
POST /v1/sessions
{
  "facetime_handle": "+15551234567",
  "media": "video",
  "mode": "human"
}

→ 201
{
  "session_id": "sess_9f2c…",
  "call_id": "call_7d1a…",
  "livekit_url": "wss://chert-….livekit.cloud",
  "participant_token": "eyJ…",
  "expires_at": "2026-08-24T18:00:00Z"
}
```

```javascript theme={null}
import { Room } from "livekit-client";

const room = new Room();
await room.connect(livekit_url, participant_token);
await room.localParticipant.enableCameraAndMicrophone();

room.on("trackSubscribed", (track) => attach(track));
```

<Warning>
  **Keep credentials server-side**

  Only the participant token reaches the browser. Your Chert API key stays on your server.
</Warning>

<h2 id="inbound">
  Inbound
</h2>

Set the line to `customer_decides`. A `call.incoming` webhook asks you to respond with `{ "action": "accept" }` or `{ "action": "decline" }`. Acceptance includes the session payload.

<h2 id="ending">
  Ending
</h2>

Call `DELETE /v1/sessions/{id}`, or let either party hang up. Chert emits `call.ended` and the token expires.
