Back to the blog

October 21, 2026 · 10 min · engineering · api · agents

.md

Embodied Narratives: Realtime AI Avatars for Interactive Storytelling Beyond Static Video

Explore how Realtime Avatar empowers developers to build interactive stories with live video avatars, offering a dynamic alternative to static AI video.

For builders aiming to develop interactive stories with video, Realtime Avatar offers a platform to embody narratives through live, conversational AI avatars. Unlike services that generate short, pre-rendered video clips from text prompts or images, our system provides a real-time character driven by your application's narrative logic. This allows for dynamic, evolving story experiences where the avatar responds live, complete with audio-synced lips and expressive movements, creating a more immersive and adaptive storytelling medium.

The Canvas of Live Narrative: Beyond Static Generation

Platforms like Perchance.org host various community-built AI tools, including generators that can produce short video clips from text or images. These often serve as experimental avenues, offering quick visual interpretations that might range in quality and consistency. Other dedicated 'story to video' generators similarly focus on automating the production of pre-rendered scenes, voiceovers, and music, yielding a finished video artifact.

Our approach diverges by focusing on live presence. Instead of generating a fixed video, Realtime Avatar provides an API and SDK to stream an AI character that converses in real time. This character is generated from a single portrait image, and the platform handles the complexity of synthesizing a looping idle video, a motion library, speech recognition, and audio-clocked lip synchronization. The narrative logic — the 'story generator' aspect — resides with your application, powered by your chosen language model and contextual controls. The avatar then becomes the live, speaking embodiment of that narrative.

Architecting Interactive Narratives with Live Avatars

The foundation of an interactive story built with Realtime Avatar is your defined character and the context you provide for each conversation. Your application orchestrates the story's progression, supplying instructions to the avatar based on user input, branching plot points, or tool calls. This is where the 'story generation' truly happens: your server determines the character's persona, immediate goals, and conversational guardrails. The avatar acts as a responsive, real-time interface to that evolving narrative.

For instance, an adventure game might dynamically update an avatar's instructions as the player explores new areas, or a training simulation could adapt its responses to a learner's performance. The interactive nature means the story isn't a fixed sequence but a collaborative unfolding, mediated by a live character.

Implementing a Live Storyteller

Integrating a live avatar into your story application begins with our TypeScript SDK (realtime-avatar). The SDK abstracts much of the real-time streaming complexity, allowing you to focus on character and narrative. Your server-side code provides the secure API key and defines the session parameters, including the avatar's identity and its initial instructions.

Consider the following example for setting up a basic interactive call: your server defines the character's core persona and the maximum duration for the interaction.

import { realtimeAvatarServerRoute } from "realtime-avatar/tanstack-start";

const handlers = realtimeAvatarServerRoute({
  apiKey: () => process.env.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 })
});

On the client side, you mount the AvatarCall component, referencing the server's proxy route and specifying the avatar. The SDK handles the microphone input, sends it to the server, and streams back the avatar's real-time video and audio.

import { AvatarCall, createProxyClient } from "realtime-avatar/react";

const client = createProxyClient({ proxyUrl: "/api/realtime-avatar" });

<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>

Beyond Words: Visual Interaction

To deepen the immersion in your interactive stories, Realtime Avatar supports sending camera images to the AI, allowing the character to 'see' what the user shows them. This opens new narrative possibilities, where characters can react to physical objects, drawings, or visual cues presented by the user.

import { useAvatarCamera } from "realtime-avatar/react";

function CameraControl({ allowed, active }: { allowed: boolean; active: boolean }) {
  const camera = useAvatarCamera({ allowed, active });
  return <>
    <p>Share camera images with AI to let the character see what you show.</p>
    <button style={{ minHeight: 44 }} disabled={!camera.available}
      aria-pressed={camera.enabled} onClick={() => void camera.toggle()}>
      {camera.pending ? "Cancel camera request" : camera.enabled ? "Stop sharing camera" : "Share camera"}
    </button>
    <p role="status">{camera.error ? "Camera unavailable. Check camera permissions and try again." : ""}</p>
  </>;
}

The camera input is sampled periodically, providing occasional visual understanding rather than continuous motion recognition. This capability can be leveraged to introduce puzzles, reveal hidden narrative elements, or simply add another layer of responsive interaction to your story.

Economies of Presence: Sustaining Your Story

Building interactive stories with live video avatars often raises questions about operational cost. Realtime Avatar's usage-based pricing is designed to accommodate continuous, real-time engagement. Live-call overage meters at approximately $5 per hour of realtime interaction, making it feasible to allow users extended conversations with your story's characters. This pricing model supports shipping features that encourage sustained interaction, rather than limiting experiences to short, one-off engagements.

It is important to note that the platform generates avatars from a single portrait image. Creation from a supplied video is not supported. Additionally, real-time latency can vary based on factors like startup state, the model in use, and network conditions, so specific latency numbers are not promised without a cited measurement protocol.

Shipping Your Embodied Story

The path from a narrative concept to an embodied, interactive story involves defining your character, crafting a dynamic narrative structure, and integrating these elements with a real-time avatar. Our platform provides the infrastructure to bring your story to life through a live video character, allowing you to focus on creative execution rather than the underlying real-time media pipeline. You can begin experimenting in the Studio, where a roster of resident live avatars can provide immediate feedback on conversational dynamics.

For the technical integration, our typed TypeScript SDK, generated from an OpenAPI specification, offers a robust framework for development. Agent-readable documentation is available, outlining how to connect your external language models and manage session context.

Whether you are building a new interactive experience or augmenting an existing narrative project, the ability to feature a live, conversing character introduces a new dimension of engagement. The tools are in place to allow you to build and ship an application where stories are not just told, but lived through a real-time, embodied AI.

Meet the live avatars. Hold the first conversation.

Enter the studio