Add a Live AI Avatar to a Bolt.new App (One-Click Starter)
Open the Realtime Avatar starter in Bolt.new in one click, or paste a prompt into an existing Bolt project, to add a live AI avatar video call. Where the API key goes, and what has not been tested in Bolt yet.
Bolt.new opens any public GitHub repo, so the fastest start is the starter repo: a Vite, React and TypeScript app with one page that renders a live AI avatar call through the AvatarCall component, and a server route that holds your API key. Press Call, allow the microphone, and talk; the avatar listens while she speaks and stops when you interrupt.
It uses the public example avatar seed-rin-ashfall, so the first call works on a fresh key before you have created a character of your own.
1. Get an API key
Try it free. Create a free account, then create a key in Settings, API keys. The free Sandbox plan includes 8 realtime minutes, once per account, and the prompts here cap every call at 120 seconds.
2. Open the starter in Bolt
- Open the starter in Bolt. Bolt opens the repo in its in-browser environment, where
npm run devserves the page and the API route on one port. - Create a file named
.envwithREALTIME_AVATAR_API_KEY=your_keyand restart the dev server. - Press Call Rin in the preview and allow the microphone.
Where the API key goes
In .env, as REALTIME_AVATAR_API_KEY, with no VITE_ prefix. Vite exposes only VITE_ variables to the page, so this one is read by the starter's server route (server/app.ts) and is never shipped to the browser. The starter's .gitignore already excludes .env.
In Bolt's preview that server route runs inside your own browser tab, so the key is read there and is never sent to your app's visitors. When you publish, the Node route needs a host that runs Node (npm run build, then npm start). The Supabase Edge Function below does not: it keeps the key as a Supabase secret.
With Supabase, or in an existing Bolt project
Connect Supabase from Bolt's integrations and use the Edge Function the starter already contains, supabase/functions/realtime-avatar/index.ts, with REALTIME_AVATAR_API_KEY stored as an Edge Function secret. Its supabase/config.toml turns off JWT verification for that one function, because the gateway would otherwise reject the browser's CORS preflight; the function runs its own checks.
In an existing Bolt project, paste this prompt instead:
Add a live AI avatar video call to this app with the Realtime Avatar SDK.
Packages: realtime-avatar (pin exactly 0.26.0), livekit-client, @livekit/components-react, zod.
Rules, do not break them:
1. The API key is a server secret named REALTIME_AVATAR_API_KEY. Never put it in browser code and never in a VITE_ or NEXT_PUBLIC_ variable. Ask me for it as a secret.
2. The browser never calls Realtime Avatar directly. It calls ONE server route of ours that holds the key. The SDK ships that route; it answers POST <base>/connect and POST <base>/end and relays the platform's answer unchanged. Do not wrap or reshape what it returns.
3. The server decides the call: instructions, maxSeconds and which avatar ids are allowed. Ignore anything the browser sends for those.
4. Use the public example avatar "seed-rin-ashfall" and allow only that id for now.
Reference: https://realtimeavatar.ai/llms.txt and https://realtimeavatar.ai/docs/quickstart.md
This project uses Supabase (connect it from Bolt's Supabase integration first).
Server: a Supabase Edge Function named "realtime-avatar".
supabase/functions/realtime-avatar/index.ts:
import { realtimeAvatarHono } from "npm:realtime-avatar@0.26.0/hono";
const cors = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "authorization, x-client-info, apikey, content-type",
"Access-Control-Allow-Methods": "GET, POST, OPTIONS",
};
const route = realtimeAvatarHono({
apiKey: () => Deno.env.get("REALTIME_AVATAR_API_KEY") ?? "",
authorize: ({ operation }) =>
operation === "connect" || operation === "end" ? undefined : new Response("Not found", { status: 404 }),
session: ({ avatarId }) =>
avatarId === "seed-rin-ashfall"
? { instructions: "You are Rin, a warm, curious guide. Short spoken sentences, one question at a time.", maxSeconds: 120 }
: new Response("Avatar not allowed", { status: 403 }),
});
Deno.serve(async (req) => {
if (req.method === "OPTIONS") return new Response(null, { status: 204, headers: cors });
const res = await route({ req: { raw: req } });
const headers = new Headers(res.headers);
for (const [k, v] of Object.entries(cors)) headers.set(k, v);
return new Response(res.body, { status: res.status, headers });
});
In supabase/config.toml add:
[functions.realtime-avatar]
verify_jwt = false
(The gateway's JWT check rejects the browser's CORS preflight; the function does its own checks.)
Store REALTIME_AVATAR_API_KEY as an Edge Function secret.
Client: a page with a "Call Rin" button. Clicking it mounts the call component below (it only runs in the browser). When the call ends, show the button again.
import { AvatarCall, createProxyClient } from "realtime-avatar/react";
const base = import.meta.env.VITE_SUPABASE_URL + "/functions/v1/realtime-avatar";
const key = import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY ?? import.meta.env.VITE_SUPABASE_ANON_KEY;
const client = createProxyClient({
proxyUrl: base,
// Supabase's gateway wants the project's public key on every request.
fetch: (input, init) => {
const headers = new Headers(init?.headers);
headers.set("apikey", key);
headers.set("authorization", "Bearer " + key);
return fetch(input, { ...init, headers });
},
});
<AvatarCall
client={client}
avatarId="seed-rin-ashfall"
poster="https://realtimeavatar.ai/api/assets/public/characters/rin-ashfall/portrait.png"
idleVideoUrl="https://realtimeavatar.ai/api/assets/public/characters/rin-ashfall/idle-10s.mp4"
style={{ width: "100%", maxWidth: 420, aspectRatio: "3 / 4" }}
onEnded={() => setInCall(false)}
>
{(call) => (
<div style={{ position: "absolute", bottom: 16, left: 0, right: 0, textAlign: "center" }}>
{call.status === "waiting" ? <p>In line: {call.queuePosition}</p> : null}
<button onClick={call.end}>End call</button>
</div>
)}
</AvatarCall>
The microphone only works on https or http://localhost.What works and what has not been tested
- Checked on 2026-10-05: the starter installs and builds cleanly, its Edge Function passes
deno check, and a live call started through its Node route on a local machine returned a complete session grant. - Checked on 2026-11-15: the SDK version the starter and the prompt pin,
realtime-avatar0.26.0, exports every function they use. - Not tested end to end: a full call inside Bolt's in-browser preview. There, the starter's server route runs in your browser tab, so its request to the Realtime Avatar API is a cross-origin browser request. The API has answered that request's CORS preflight since 2026-10-05, but a complete call in the preview has not been confirmed. If Call fails with a network error there, use the Supabase Edge Function above.
Before you share the link
As generated, anyone who can open the app can start a call, and every call spends your balance. Before going public, ask the builder to require a signed-in user in the route's authorize hook (return a 401 when there is none), and set maxSeconds to what you will pay for per call. See Authentication for what authorize gates, and pricing for what a minute costs.
Your own character
Create an avatar from one portrait on the Avatars page, then put its ava_… id in VITE_REALTIME_AVATAR_ID and REALTIME_AVATAR_IDS, and swap the poster and idleVideoUrl in src/avatar.ts for your avatar's own, or remove them.
Other builders
Compare and cost guides
- Realtime Avatar pricing
- Avatar API cost calculator
- Realtime Avatar vs Tavus, HeyGen LiveAvatar, Anam and Simli
- Realtime AI avatar APIs compared
- Realtime avatar API pricing, worked out
- HeyGen and LiveAvatar API pricing explained
- Choosing a HeyGen alternative for realtime avatars
- Tavus pricing per minute
- A Tavus alternative for live AI characters
- Meta Muse Realtime Avatar vs Realtime Avatar
- A realtime AI avatar in React Native or Expo
- Live avatars in 2026: a field guide to the research