Quickstart
Create a speech-to-speech Assistant, connect it through a WebRTC Channel, and make a browser call. After the call, read its transcript from the Exchange API.
Create your first Assistant with an AI agent
Use the Reecall Platform MCP server to let an AI agent guide you through setup. Follow the MCP connection instructions to connect the Platform server to your AI client, then give your agent this prompt:
Code
API tutorial prerequisites
- A Reecall account with a Project and a project-scoped API key. See Authentication to create the key.
- An HTTP client on your backend or workstation to send requests. The final query uses
curlfrom a terminal. - Node.js and npm for the browser example. Use a Node.js version supported by Vite.
- A browser with a microphone and speakers or headphones.
All request paths below are relative to your Reecall deployment host. They include the service prefix, such as /data_next or /calls. The Data API server URL in the API reference already includes /data_next; do not add that prefix twice.
Replace every placeholder with your own value. Response examples are excerpts, not the complete response schemas.
Use the API key only on your backend
Send Reecall API requests from your backend or workstation. Pass only the returned LiveKit wsUrl and connection token to the browser. Do not put your Reecall API key in the browser example.
Step 1: choose a model and voice
List the available speech-to-speech models:
Code
Choose an enabled model with a voice you want to use. Save the model's id as stsId and one id from its voices array as voiceId. Use a voice from the selected model.
This tutorial uses native STS, so you do not need separate STT, LLM, or TTS model IDs.
Step 2: create an Assistant
Send the selected model and voice IDs with the Assistant's instructions:
Code
Code
Save the returned id as assistantId. Your project-scoped key supplies the Project and Organization automatically.
Step 3: create a WebRTC Channel
Create a Channel that routes browser calls to this Assistant:
Code
Code
Save the returned id as channelId. Reuse this Channel for later calls to the same Assistant.
Step 4: request connection credentials
Request a connection token from the Calls API using the Channel ID:
Code
Code
Save both values. The token grants access to the call's LiveKit room and has a one-hour lifetime. Request new credentials for each new conversation.
Step 5: connect and talk
Create a local browser project. These commands use Vite's manual setup to resolve the LiveKit SDK's npm import:
Code
Create index.html in the project directory:
Code
Create main.js alongside it. Replace wsUrl and token with the values from Step 4:
Code
Start the local app:
Code
Open the localhost URL printed in the terminal. Click Connect, allow microphone access, and speak to the Assistant. You should hear its greeting and responses. Click End call when you finish.
This example starts audio playback from a button click and attaches the Assistant's subscribed audio tracks to the page. See LiveKit's JavaScript SDK for the client API.
Keep this example local. In a deployed application, have your backend authorize connection requests and return fresh credentials instead of hardcoding them in JavaScript. Serve the browser app over HTTPS when hosting it outside localhost.
Step 6: read the conversation record
After ending the call, query the Data API from your backend or terminal. Replace the deployment host, API key, and Assistant ID in this command:
Code
The response is an array ordered with the newest Exchange first. A completed conversation includes fields such as:
Code
Read messages in the full response for the transcript. If the Exchange still has status: "inProgress", wait for final processing and query again. A recording and extracted data depend on additional configuration and are not required for this tutorial.
Troubleshooting
| Problem | What to check |
|---|---|
An API request returns 403 | Use the API key's token, check it has not been revoked, and confirm its scope. See Authentication. |
| Channel creation reports a duplicate | An Assistant can have only one WebRTC Channel. Reuse the existing Channel instead of creating another. |
| The browser cannot connect | Use the Channel's ID in Step 4 and copy both returned credentials. Request new credentials if the token has expired. |
| The microphone does not work | Allow microphone access for the localhost app and check your selected input device. |
| You cannot hear the Assistant | Check your output device, browser audio permissions, and whether the STS model and voice are compatible. Start the connection with the Connect button. |
| The Exchange query returns an empty array | Confirm that you connected and started a conversation, then allow time for the record to appear. Use the same Project and Assistant as in the earlier steps. |
Next steps
- Assistants & Models explains the alternatives to native STS. The Assistant creation guide shows the three-model configuration.
- SIP Channel connects an Assistant to your phone system.
- Tools and MCPs adds actions during a conversation.
- Post-conversation processing sends completed results to your other systems.