> ## Documentation Index
> Fetch the complete documentation index at: https://docs.beta.b3os.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Render

Styled screenshots and scripted product videos rendered on the node, with narration, word-timed captions and restyling, served from signed URLs.

Render turns a web page into a finished image or a product video. A screenshot is captured from a warm browser, composed with a background and a window frame, and encoded once, in one call. A video follows a script of beats: lines of narration and the browser steps performed while each line is said.

## What to call

| You want | Call | Bills |
|---|---|---|
| A styled image of a page or one element | [`POST /v1/render/screenshots`](/render/screenshots) | One `render.screenshot`, plus one per extra variant |
| A narrated product demo as MP4, GIF, poster and captions | [`POST /v1/render/videos`](/render/videos) | `render.video_s`, seconds of output |
| The same video with a different look | [`POST /v1/render/videos/{video_id}/restyle`](/render/videos#restyle-a-video) | `render.video_s` |
| The style presets you can name | `GET /v1/render/presets` | Nothing |

## How a video is made

Videos are narration first. B3OS synthesizes each beat's line with the node's speech model before it records anything, then places the browser steps on the words that describe them, so a click lands on "click". The recorder drives a browser on a virtual clock, records segments of the script in parallel, and composes every frame with the background, window frame, cursor and captions in Rust before encoding. The same `seed` and `start_time` give the same video again.

Restyling skips the browser: it re-composes the archived raw capture with a new style, captions or output size, and reuses the narration.

## Artifacts

Every file render produces is an artifact (`art_`): the image, the MP4, the GIF, the poster frame, the WebVTT or SRT captions. Each has a signed URL on `usercontent.b3os.org`:

```text
https://usercontent.b3os.org/a/art-01m5t41x77fg4pdnm2ryq73wgs/screenshot.webp?node=n1&exp=1793040000&sig=...
```

- The URL needs no credentials and is safe to embed. It works for anyone who has it until `url_expires_at`; `GET /v1/render/artifacts/{artifact_id}` returns a fresh one, valid for 24 hours.
- The bytes are always served with `Content-Security-Policy: sandbox`, so an image or page never runs scripts or reads the origin, and `usercontent.b3os.org` never uses cookies.
- A URL works as soon as the artifact is reported, while its upload to storage is still finishing.
- Artifacts are kept for 7 days unless you delete them first.

## Scopes

| Scope | For |
|---|---|
| `render:run` | Take screenshots; record, restyle and cancel videos |
| `render:read` | List and read screenshots, videos, artifacts, timelines and presets |
| `render:write` | Delete screenshots and videos |

Style values you send are escaped before they reach any HTML or CSS. The browsers that compose your output never load a profile or touch the network.

## Guides

**[Screenshots](/render/screenshots)**

A page or one element, styled and encoded in one call.
  **[Videos](/render/videos)**

Scripted, narrated demos with captions, and restyling.

[Limits and FAQ](/render/limits) lists the caps and the common questions.