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_URLandAPOB_API_KEY. - For MCP, connect the integration’s
APOB_MCP_URLusing OAuth, initialize, and discover the current tools. - Choose the prompt, initial generated duration, resolution, visibility, and
audience policy explicitly.
15000milliseconds means 15 seconds.
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.- GraphQL API
- MCP agent
Save this request as Send it from a trusted server or local environment:Check both
create-channel.json: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.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: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 withcreateLiveScene 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: 0makes a candidate with no initial vote. - Voting with
creditAmount: 0uses 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.
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 callstopLiveRoom(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.