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

# Artifacts & previews

> Session files, links, and preview URLs

<Note>**Labs preview.** Artifacts are not part of the stable Durable Sessions API. Large event bodies can already spill to a [`content_ref`](/agent-sessions/events).</Note>

**Artifacts** are session outputs your UI can load later: files, links, reports, and preview URLs. A **preview** points to a process running in the session machine, such as a dev server or built app.

## Artifact kinds

* **`file` / `link`**: snapshotted to storage at publish; fetchable after the machine is gone.
* **`preview`**: a durable entry for a live URL into the session machine. The served app depends on machine state, so it carries a `status` (`live` / `cold`).

## Publish from the runtime

The runtime publishes artifacts through two tools:

* `oc.preview(port)` — expose a port of the session's machine as a preview URL.
* `oc.publish(path)` — snapshot a file as a durable artifact.

Each publish appends a `user`-level event and upserts the artifact, so it reaches your UI as soon as it's produced.

## Read artifacts in your app

Use the same snapshot-plus-stream pattern as [events](/agent-sessions/events): list on load, subscribe for changes.

```
GET /v3/sessions/:id/artifacts
GET /v3/sessions/:id/artifacts/:key/content
events: artifact.published | artifact.updated | artifact.removed

Artifact = { key, kind: "preview" | "file" | "link", title?, status?, url?,
             content_type?, bytes?, created_at, updated_at }
```

A preview URL is a public capability — the browser loads it directly; a [client token](/agent-sessions/authentication#client-tokens) only gates *learning* the URL (via the user-level event), so you can stream the whole build *and* embed the running app from the same front-end.
