---
title: "Create demo session"
description: "Start a voice conversation with Qomni's demo agent from the public\nwebsite, without a key. The answer is a LiveKit participant token for a\nnew room in the demo workspace's cell, with the demo agent already\ndispatched into it: join `url` with `token` within 60 seconds, publish\nthe microphone and play the agent's audio. The call is in test mode and\nends by itself after `max_duration_seconds`, or after 20 seconds\nwithout the visitor speaking.\n\nLimits: 3 sessions per IP in 10 minutes and 10 in 24 hours\n(`rate_limited`), and a daily cap of demo minutes for everyone\n(`demo_unavailable`). CORS answers only the website's origin. An API\nkey sent anyway is ignored.\n"
---

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

Path: Qomni Agents API › Realtime

`POST /demo_sessions`

Start a voice conversation with Qomni's demo agent from the public
website, without a key. The answer is a LiveKit participant token for a
new room in the demo workspace's cell, with the demo agent already
dispatched into it: join `url` with `token` within 60 seconds, publish
the microphone and play the agent's audio. The call is in test mode and
ends by itself after `max_duration_seconds`, or after 20 seconds
without the visitor speaking.

Limits: 3 sessions per IP in 10 minutes and 10 in 24 hours
(`rate_limited`), and a daily cap of demo minutes for everyone
(`demo_unavailable`). CORS answers only the website's origin. An API
key sent anyway is ignored.

## Request body

_Optional._

- `language` (`createDemoSession.language`; string, optional) — The language the demo agent speaks.
  - one of `"es"`, `"en"`, `"pt-br"`; default `"en"`
- `agent` (`createDemoSession.agent`; string, optional) — Which demo agent answers - a receptionist, appointment booking, lead qualification, first-level support, collections or appointment reminders.
  - one of `"reception"`, `"scheduling"`, `"qualification"`, `"support"`, `"collections"`, `"reminders"`; default `"reception"`

## Example request

```json
{
  "language": "es",
  "agent": "reception"
}
```

## Code samples

### TypeScript

```typescript
import { Qomni } from "@qomni/sdk";

const qomni = new Qomni({ apiKey: process.env.QOMNI_KEY! });

const demoSession = await qomni.agents.createDemoSession({
  language: "es",
  agent: "reception"
});
console.log(demoSession);

```

### cURL

```bash
curl --request POST \
  --url https://api.qomni.ai/agents/v1/demo_sessions \
  --header 'Content-Type: application/json' \
  --data '
{
  "language": "es",
  "agent": "reception"
}
'
```

### Python

```python
import requests

url = "https://api.qomni.ai/agents/v1/demo_sessions"

payload = {
    "language": "es",
    "agent": "reception"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

The demo session.

#### Example

```json
{
  "url": "http://example.com",
  "token": "string",
  "room": "string",
  "expires_at": "2019-08-24T14:15:22Z",
  "max_duration_seconds": 0
}
```

- `url` (`createDemoSession.response.201.url`; string, required) — The cell's LiveKit (`wss://…`).
  - format `uri`
- `token` (`createDemoSession.response.201.token`; string, required) — A LiveKit participant token for `room` only, microphone only.
- `room` (`createDemoSession.response.201.room`; string, required)
  - pattern `^demo-[0-9a-z]+$`
- `expires_at` (`createDemoSession.response.201.expires_at`; string, required) — Join before this instant.
  - format `date-time`
- `max_duration_seconds` (`createDemoSession.response.201.max_duration_seconds`; integer, required) — The call ends by itself after this long.

### 422

The request does not match the contract (`validation_failed`).

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "request_id": "string",
    "fields": {
      "property1": [
        "string"
      ],
      "property2": [
        "string"
      ]
    }
  }
}
```

- `error` (`createDemoSession.response.422.error`; object, required)
  - `code` (`createDemoSession.response.422.error.code`; string, required) — Stable, machine-readable; each operation lists the codes it can return.
    - pattern `^[a-z][a-z0-9_]*$`
  - `message` (`createDemoSession.response.422.error.message`; string, required) — For people; may change at any time.
  - `request_id` (`createDemoSession.response.422.error.request_id`; string, optional)
  - `fields` (`createDemoSession.response.422.error.fields`; map<array<string>>, optional) — Only for validation_failed, the messages per field.

### 429

Too many demo sessions from this address (`rate_limited`); retry after `Retry-After` seconds.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "request_id": "string",
    "fields": {
      "property1": [
        "string"
      ],
      "property2": [
        "string"
      ]
    }
  }
}
```

- `error` (`createDemoSession.response.429.error`; object, required)
  - `code` (`createDemoSession.response.429.error.code`; string, required) — Stable, machine-readable; each operation lists the codes it can return.
    - pattern `^[a-z][a-z0-9_]*$`
  - `message` (`createDemoSession.response.429.error.message`; string, required) — For people; may change at any time.
  - `request_id` (`createDemoSession.response.429.error.request_id`; string, optional)
  - `fields` (`createDemoSession.response.429.error.fields`; map<array<string>>, optional) — Only for validation_failed, the messages per field.

### 503

The demo has used today's minutes (`demo_unavailable`), or is not offered in this environment.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "request_id": "string",
    "fields": {
      "property1": [
        "string"
      ],
      "property2": [
        "string"
      ]
    }
  }
}
```

- `error` (`createDemoSession.response.503.error`; object, required)
  - `code` (`createDemoSession.response.503.error.code`; string, required) — Stable, machine-readable; each operation lists the codes it can return.
    - pattern `^[a-z][a-z0-9_]*$`
  - `message` (`createDemoSession.response.503.error.message`; string, required) — For people; may change at any time.
  - `request_id` (`createDemoSession.response.503.error.request_id`; string, optional)
  - `fields` (`createDemoSession.response.503.error.fields`; map<array<string>>, optional) — Only for validation_failed, the messages per field.


Source: https://docs.qomni.ai/agents-api/demo-sessions/create/index.md
