Skip to main content
Build an AI livestream around a world, character, or story. APOB generates scenes and streams them in a channel, with optional audience scene proposals and voting. Start with a text prompt, an accessible image or video, or an existing channel.

Build with the API

Create channels, read playback and scenes, control audience participation, stop, and reopen through GraphQL.

Create with your agent

Use MCP tools to create a channel, propose scenes, and vote from an authorized client.

Choose your integration

Channels stream generated video scenes over HLS. Generation and playback start asynchronously. Plan your interface around a preparing state followed by actual player readiness; there is no fixed startup-time guarantee.

Before you start

  • Sign in to the APOB account that will own the channel and review its eligible credits and automatic reload settings in credits and billing.
  • For the API, obtain an APOB API key and the integration’s GraphQL URL. Examples use APOB_GRAPHQL_URL and APOB_API_KEY.
  • For MCP, connect the integration’s APOB_MCP_URL using OAuth, initialize, and discover the current tools.
  • Choose the prompt, initial generated duration, resolution, visibility, and audience policy explicitly. 15000 milliseconds means 15 seconds.
For production, use these endpoint variables:
An MCP OAuth token and a GraphQL API key are separate credentials. An agent that only has MCP access must hand channel observation or owner controls to the user or an independently authorized API integration.

1. Create the channel once

This example requests a private channel, 15 seconds of initial generation, and no audience scene creation. Channel creation prepays generation with credits.
Save this request as create-channel.json:
Send it from a trusted server or local environment:
Check both data and errors, even on HTTP 200. Save the returned data.createLiveRoom.id before doing anything else. Keep your API key out of public browser code and logs.
Do not retry creation automatically after a timeout or an unclear response. Every successful creation makes another channel and can spend credits again. Inspect the same account’s channel history before considering a new submission.

2. Observe startup and play the stream

Read the saved channel ID through GraphQL, using an API key for the channel owner when the channel is private. Replace the synthetic ID with the real receipt:
Use spaced reads with a bounded wait and a visible preparing state. Retry a failed read against the same channel ID. status: LIVE means the channel is active; even a non-null playback URL does not prove media is ready. Give the returned cloudflareHlsPlaybackUrl unchanged to an HLS-capable player and handle its loading, playback, and error events. Confirm playback through the player. generatedTime describes successful scene generation. streamStartedTime records a runtime scene-start callback and can still be null for current. scenes.isStreamEnded describes an exhausted queue with repeated playback; it is separate from status: ENDED. MCP currently has no channel-status tool. Do not pass a channel ID to get_generation_result; that tool follows generation tasks, not Live channels.

3. Add the next scene or invite participation

Create a scene with createLiveScene or create_live_scene, passing the channel ID, prompt, and creditAmount. Then use voteLiveScene or vote_live_scene with the returned scene ID.
  • Creating a scene with creditAmount: 0 makes a candidate with no initial vote.
  • Voting with creditAmount: 0 uses the account’s one free vote per scene and adds 100 vote weight.
  • Positive values charge eligible credits. Vote weight is not a receipt of total credits spent. A candidate or a vote does not guarantee generation or airtime.
Use isPublic: true when creating a channel intended for public discovery. Set audienceSceneCreationEnabled: true to permit eligible viewers to propose scenes; it defaults to true when omitted. The owner can change this policy through GraphQL. Public visibility does not grant owner controls. Private channels are readable only by their owner through the channel API.

4. End, replay, or continue

The owner can call stopLiveRoom(id: ...) to end the channel. Read the same channel later for cloudflareReplayHlsPlaybackUrl or replayVideoUrl. The assembled MP4 replayVideoUrl is nullable while postprocessing completes and is signed; read the channel again when a fresh URL is needed. To continue an owned ended channel, use reopenLiveRoom. Reopening creates a new channel ID and prepays new generation. Save the new receipt. See the lifecycle examples.

Give an agent a complete brief

The connected client must support APOB’s MCP transport and OAuth flow. Available credits, moderation, source access, and channel lifecycle rules still apply. For failures, follow Live troubleshooting.