Prerequisites
- An Anam API key (get one here)
- A modern web browser with microphone access
- A local web server (we’ll show you how)
Create Your First Persona
1
Create the HTML structure
Create a new file called
index.html
and add this basic structure:index.html
2
Add the JavaScript
Now add the script that will automatically start your persona. Add this
<script>
tag just before the closing </body>
tag:3
Add your API key
Replace
your-api-key-here
with your actual Anam API key in the script.4
Complete file example
Your final
index.html
file should look like this:index.html
5
Start a local server
To serve your html file, you’ll need a local web server. You can use one of
the following methods depending on which development tools you have installed.
6
Open and test
- Navigate to
http://localhost:8000
in your browser - Allow microphone access when prompted
- Cara will appear automatically and you can start talking!
- When you’re done, close the browser tab to end the session.
What just happened?
- Obtaining a Session Token: Your API key was exchanged for a temporary session token that enables the persona connection
- Establishing a WebRTC Stream: The Anam SDK established a real-time video/audio connection to display your persona
- Voice Interaction: Cara listens to your microphone and responds with natural speech and facial expressions
What’s next?
Now that you’ve got Cara up and running, here are some exciting directions to explore:Customize your persona's appearance and personality
Make your persona truly your own by changing their look, voice, and how they
respond
Build more engaging applications
Work through advanced examples that show you how to create richer, more
interactive experiences
Respond to conversation events
Learn how to react when your persona starts talking, finishes speaking, or
encounters different situations