API reference
WebRTC rooms.
A room is a browser-side voice conversation with the same agent you would put on a phone call — no phone number, no PSTN, no dial-in. You get a URL and a short-lived join token; your user opens it and starts talking.
Free test rooms
POST /v1/rooms/test is the fastest way to hear an agent. It places no credit hold, so it is the right tool for iterating on a prompt before you spend anything.
curl -X POST https://api.rexa.ai/v1/rooms/test \
-H "Authorization: Bearer vk_live_..." \
-H "Content-Type: application/json" \
-d '{
"agent_config": {
"prompt": "You are a friendly scheduling assistant. Greet the caller and offer three time slots."
}
}'Returns 201 Created with the room:
{
"id": "019eb8c6-8515-7b97-9143-c947f2f175f2",
"url": "https://rooms.rexa.ai/r/abcd-efgh-ijkl",
"token": "ey...<short-lived join token>",
"expires_at": "2026-08-08T14:33:00.000Z"
}Three limits are enforced server-side, and it is better to design around them than to discover them: there is no billing, the TTL is capped at roughly 120 seconds and any ttl_seconds you send is ignored, and there is a per-tenant rate limit of about 20 rooms per hour. Exceeding the cap returns 429 with retry_after_seconds in error.details.
Production rooms
POST /v1/rooms creates a billed room with full control over lifetime. ttl_seconds accepts 60 to 3600 and defaults to 900.
curl -X POST https://api.rexa.ai/v1/rooms \
-H "Authorization: Bearer vk_live_..." \
-H "Idempotency-Key: 3b1f0c22-5c8a-4f1e-9a44-2f0f2d6b1e77" \
-H "Content-Type: application/json" \
-d '{
"agent_config": {
"prompt": "Answer questions about the order and offer to transfer to a person.",
"voice_id": "<id from GET /v1/voices>"
},
"ttl_seconds": 900
}'Returns 202 Accepted with the same room shape. Send an Idempotency-Key so a retry returns the existing room rather than provisioning a second one.
Connecting from the browser
Connect to the returned url and token with PipecatClient or the Daily SDK. The token is short-lived and scoped to that room — mint it server-side and hand it to the browser; never ship an API key to the client.
Rooms or phone calls?
| Rooms | Phone calls | |
|---|---|---|
| Reach | Anyone with the link, in a browser | Anyone with a phone number |
| Telephony needed | None | A DID on your connected provider |
| Setup | One API call | Provider connection first |
| Best for | Demos, in-app support, prompt iteration | Outbound campaigns, inbound lines |
Next
- Quickstart — the five-minute path, starting with a test room.
- Outbound calls — the same agent on the phone.
- Authentication — API keys and how to keep them server-side.