A minimal Next.js example for the public Reactor-hosted Visko Orbis Stable API. It demonstrates server-side token minting, WebRTC video and audio, text-to-video, optional image-to-video, live prompt steering, delivery resolution, pause, resume, and a foldable Nano Banana-to-Orbis livestreaming example.
- Node.js 20.9 or newer
- A Reactor API key with access to Visko Orbis Stable
- A Google Gemini API key with access to Nano Banana
cp .env.example .env.local
# Add your Reactor API key to .env.local.
npm install
npm run devOpen http://localhost:3000.
Set both keys in .env.local:
REACTOR_API_KEY=your_reactor_api_key
GEMINI_API_KEY=your_gemini_api_keyKeep both keys server-side. The browser receives only the short-lived Reactor JWT and the image returned by the Nano Banana route.
Connect to Orbis, expand Livestreaming example, and click
Edit and start stream. The bundled dog.png is displayed as the source
image. The server sends it with the displayed image-editing prompt to
gemini-2.5-flash-image. Gemini then analyzes the edited image with the user
prompt and returns a plain-text, image-grounded prompt. The
edited output is previewed, uploaded as the Orbis start image, and used with
that grounded prompt to begin the stream.
The two starting prompts are exported from lib/nano-banana.ts.
NANO_BANANA_PROMPT controls the image edit, while ORBIS_KICKOFF_PROMPT
describes the requested motion. The final Gemini-grounded prompt is displayed
before it is sent to Orbis.
POST /api/tokenrequests a scoped session JWT fromhttps://api.reactor.inc/tokens.ReactorProviderconnects toreactor/visko-orbis-stablewith the recv-onlymain_videoandmain_audiotracks.- The model sends a
statesnapshot. Itsstate.available_resolutionslist replaces the starter's initial documented resolution choices. - If supplied, the reference image is uploaded and passed to
set_imagebeforestart. - If selected,
set_resolutionstages a delivery tier for the nextstart. Omitting it keeps the model's current setting; the documented default is2k. set_promptsupplies the required prompt, thenstartbegins generation.- Sending another
set_promptwhile running steers the video at the next chunk boundary.
- A prompt is required before
start; the reference image is optional. - A 16:9 reference image works best. Other aspect ratios are resized without cropping and may appear distorted.
- The starter initially shows the currently documented
1080p,2k, and4ktiers. After connection, treatstate.available_resolutionsas authoritative and send the selected value exactly as given. set_resolutionapplies from the nextstart, not during the active run.- Orbis emits chunks about every 1.8 seconds. The first chunk emits no frames while the upscaler primes; this is expected.
- Commands are asynchronous. Use model events such as
state,prompt_accepted,resolution_accepted,generation_started,chunk_complete, andcommand_erroras the source of truth. pausetakes effect after the current chunk.resumecontinues the same generation, andresetclears the current prompt and image.
app/api/token/route.tsperforms the server-side token exchange.app/api/nano-banana/route.tsperforms the server-side image edit.app/api/orbis-prompt/route.tscreates the image-grounded video prompt.components/orbis-demo.tsxcomposes the provider, player, controls, and demo.components/orbis-player.tsxrenders the streamed video and audio.components/orbis-controls.tsxrenders the session controls.components/nano-banana-example.tsxowns the kickoff example and source image.hooks/use-orbis-session.tscontains the reusable Orbis command sequence and session state.dog.pngis the Nano Banana source image.lib/orbis.tscontains the public model configuration and message helpers.lib/orbis-prompt.tscontains the plain-text Gemini grounding instruction.lib/nano-banana.tscontains the model and kickoff prompt..env.exampledocuments the required environment variables.
For the complete command parameters, message schemas, tracks, and current model behavior, use the public Reactor documentation: