Black Friday deposit bonus·Top up $50+ and get $10 · Top up $100+ and get $25·Ends November 30Top up →
Use case

AI VTuber livestream:
an endless video host your chat can steer

Run an AI VTuber from the API: a live video that never stops, a director that writes every next shot, one kept voice, and viewer chat turned into directions.

Last updated 2026-11-05

Prepaid, no subscriptionREST or MCPOne key for models, data and agents
live video$ curl -N https://lovelyrouter.com/v1/videos/live -d '{"model": "lt… event: session · event: chunk 0.mp4> POST …/prompt "she turns to the window" event: chunk 1.mp4 · event: chunk 2.mp4 ✓ streaming · steered live
Black Friday

Black Friday deposit bonus

Every qualifying top-up earns free credit, on top of any other offer.

Ends November 30

Deposit $50
+$10
20% bonus
Deposit $100
+$25
25% bonus
Sign up and claim

An AI VTuber needs three things a recorded clip can't give it: video that keeps going, a voice that stays the same, and a way for the audience to change what happens next. The live video API does all three. POST /v1/videos/live opens a stream that delivers a new ~5 second mp4 chunk every few seconds, each one carrying on from the motion of the one before. A chat model, the director, writes every next shot from your character's persona. The voice heard in the first spoken chunk is kept for the whole stream, or you send your own clip. And while it plays, POST /v1/videos/live/{id}/direct takes a message, so your bot can pass on what viewers ask for and see it on screen within seconds. Try it with no code in the live playground.

Hand it to your AI agent

Copy this prompt into Claude Code, Cursor, Codex or any coding agent. It tells the agent where the docs are and how to use your API key.

Build an AI VTuber for me: stream live video from the Lovely Router live video API with one kept voice, and turn filtered viewer chat messages into directions.

- Docs (read first): https://lovelyrouter.com/docs/models/live-video.md and https://lovelyrouter.com/docs/api/audio.md
- Live video: POST https://lovelyrouter.com/v1/videos/live (server-sent events with mp4 chunks), steer with .../prompt or .../direct; `consent: true` required. Sending the chunks to a streaming platform is this project's job.
- Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt.

My task: <the character, a voice clip, the platform and where the chat comes from>
01

How it works

010203
  1. Draw the host

    Make the first frame with the image generation API: your VTuber in their room, framed for the stream. The live model keeps the faces, clothes and room of that picture for the whole session, however long it runs.

  2. Give them a voice and a persona

    Send voice, a clip of about 5 seconds of clear speech from one speaker, and every chunk speaks in it. The clip can be your own recording, a voice you have permission to use, or a voice you designed with text to speech. Then pass a director with instructions: who the host is, how they talk, what the show is about (up to 2,000 characters).

  3. Go live

    The director writes each chunk's prompt while the one before renders: what is on screen, what happens, what the camera does and what the host says, about 10 words per chunk. Chunks arrive a little faster than they play, so you buffer two and play them back to back.

  4. Let chat steer

    Your bot reads the stream chat, picks the messages worth acting on, and sends each one to /direct. The director works it into the next shot it writes, and a direction that arrives after a shot was written gets that shot rewritten before it starts.

02

Start a stream

010203
cURL
curl -N https://lovelyrouter.com/v1/videos/live \
  -H "Authorization: Bearer $LOVELY_API_KEY" \
  -F model=ltx-live \
  -F prompt="Miko, a cheerful streamer with silver twin tails and a hoodie with cat ears, talks to the camera from her cosy room, fairy lights behind her" \
  -F seconds=600 \
  -F size=384x704 \
  -F camera=fixed \
  -F image=@miko-room.png \
  -F voice=@miko-voice.wav \
  -F director=claude-haiku-5.5 \
  -F director_instructions="Miko is upbeat and a bit silly. She chats with her viewers, answers their questions in one short sentence and reacts to what they ask for." \
  -F consent=true

In a multipart request the director's notes go in director_instructions; in JSON, director is an object with model and instructions. The answer is a stream of server-sent events: session first (with the session id), a chunk event with an mp4 url for every ~5 seconds of video, next when the director has written a coming shot, and end at the close. Chunk URLs need no API key, so your player can load them directly. When a viewer asks for something, send it as a direction:

Python
import os
import requests

H = {"Authorization": f"Bearer {os.environ['LOVELY_API_KEY']}"}

def direct(live_id: str, viewer: str, message: str) -> None:
    """Pass one chat message on to the director."""
    requests.post(
        f"https://lovelyrouter.com/v1/videos/live/{live_id}/direct",
        headers=H,
        json={"message": f"A viewer called {viewer} says: {message}"},
        timeout=30,
    ).raise_for_status()

# From your chat bot, after your own filters:
direct(LIVE_ID, "nightowl", "Show us your cat!")

The live video guide has the full event list, a Python reader for the stream and how to play the chunks gaplessly.

03

The tools for the job

Live video API

POST /v1/videos/live with ltx-live: 704×384 landscape or 384×704 portrait, 24 fps, with sound, faster than real time once a GPU is warm. Reference: live video.

The director

Any chat model your key can use, as an id or {"model", "instructions"}. It sees your prompt, the last 15 shots and your directions. A fast, inexpensive model is plenty; claude-haiku-5.5 takes about 6 seconds per call, within the roughly 10 seconds it has.

Two ways to steer

POST …/direct is a suggestion the director works into the story, and it keeps applying (a new place, a mood, a language) where that makes sense. POST …/prompt replaces the next chunk's prompt word for word, for a scripted moment such as a sponsor read or a "be right back".

A kept voice

With voice, every chunk speaks in your clip. Without it, keep_voice (on by default) keeps the voice heard in the first chunk with speech.

A fixed camera

camera: "fixed" makes the stream one locked-off shot: only the people move, and the room each chunk starts from is cleaned so the background doesn't drift over a long session.

The first frame and the voice clip

Draw the room with the images API and design a voice with text to speech, or clone one you have the rights to with voice cloning.

04

What you build yourself

{}

The API makes the video; the broadcast is yours. Play the chunk URLs in your own page or player (two <video> elements, swapping as each one ends, play them without gaps) and capture that in your streaming software to send it to the platform you stream on. Reading the platform's chat, filtering it and deciding which messages become directions is your bot's job: the director does what it is told, so filter for spam and abuse before anything reaches /direct. A session takes up to 100 directions, so pick the best ones rather than forwarding every line.

05

Limits to plan around

10 minutes per session

seconds goes up to 600. For a longer show, start the next session when one ends and pass the last chunk's final frame as image, so the host and the room carry on. The new session's first chunk has to render before it plays, so plan a short break or a pre-made clip at each change.

One open session per account

A second one is refused with 429 until the first ends.

A cold start

When no GPU is warm, the first chunk takes up to about a minute, with status events meanwhile.

Capacity

A small number of GPUs serve the model. When all are streaming, a new session gets 503 with retry-after.

06

What you pay

You pay per second of video made: $0.019 with ltx-live, or $1.14 per minute, and at least $0.42 per session. A full 10-minute session costs $11.4, and an hour of back-to-back sessions $68.4. The director's calls are billed separately at that chat model's own price, and the first frame and any designed voice at the image and speech prices. The most a session can cost is held from your prepaid balance when it starts; the seconds made are billed as one call in your logs. A session that ends on our error pays only for the video it made. Every price is on pricing.

07

Rules for a live AI host

ltx-live is under the LTX terms, which every request accepts with consent: true. Among them: say that the video is AI-generated wherever you show it, don't impersonate anyone without their consent, and no sexually explicit content. Use only voices that are yours or that you have permission to use, and pictures you hold the rights to. The Acceptable Use Policy applies as for every model.

08

Frequently asked questions

?
Can viewers really change what the VTuber does?+

Yes. Each message you send to POST /v1/videos/live/{id}/direct is worked into the next shot the director writes, and shots not filmed yet are written again at once, so a direction shows on screen within seconds. Your bot decides which chat messages to send.

Does the voice stay the same?+

Yes. Send a voice clip of about 5 seconds of one speaker and every chunk speaks in it. Without one, the voice heard in the first chunk with speech is kept for the rest of the stream.

Does the host keep the same face?+

The first frame is the stream's reference: faces, clothes and the room are kept as they are in it for the whole session. When you start a new session, pass the last chunk's final frame as image to carry on.

Can it stream straight to my channel?+

No. The API delivers mp4 chunks over server-sent events. You play them in your own player and send that to your platform with your streaming software.

How long can one stream run?+

One session runs up to 600 seconds. Start the next one when it ends to keep going; an account can have one session open at a time.

Which chat model should direct?+

A fast, inexpensive one. The director has about 10 seconds per call before the video waits for it, and claude-haiku-5.5 takes about 6. Any chat model your key can use works.

Can an AI coding agent build this for me?+

Yes. Copy the prompt on this page into Claude Code, Cursor or Codex: it points the agent at the Markdown docs, and the agent writes the stream reader, the player and the chat bot with your key.

For recorded scenes with the same characters, see video shots; to get an API key, sign up and add credit, then open the live playground.

One prepaid key for models, data and agents

No subscription. Top up, use what you need, see every charge in your logs.