> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://platform.bctrl.ai/llms.txt.
> For full documentation content, see https://platform.bctrl.ai/llms-full.txt.

# Run Artifacts

> List screenshots, downloads, recordings, and files produced by a run.

Artifacts are durable outputs attached to a run. Browser downloads, screenshots, reports, recordings, and collected runtime files appear here when BCTRL can observe or capture them.

Use `runtime.currentRun()` to reach the active run, then list artifacts from the run.

```ts
const run = await runtime.currentRun();

const { artifacts, nextCursor } = await run.artifacts.list({
  kind: ["download", "screenshot"],
  limit: 100,
});

for (const artifact of artifacts) {
  console.log(artifact.kind, artifact.name, artifact.path, artifact.sizeBytes);
}
```

Artifacts are returned newest first. Use `nextCursor` to page through older artifacts.

## Download an artifact

```ts
const artifact = artifacts[0];

if (!artifact?.downloadUrl) {
  throw new Error("No downloadable artifact found");
}

const response = await fetch(artifact.downloadUrl, {
  headers: {
    Authorization: `Bearer ${process.env.BCTRL_API_KEY}`,
  },
});

const bytes = Buffer.from(await response.arrayBuffer());
```

`downloadUrl` is authenticated by your BCTRL API key. Treat it as opaque.

## Artifact shape

```ts
type RunArtifact = {
  id: string;
  runId: string;
  runtimeId: string;
  runtimeKind: "browser" | "desktop" | "spreadsheet";
  kind: string;
  name: string;
  fileId: string;
  path: string;
  contentType: string;
  sizeBytes: number;
  createdAt: string;
  downloadUrl?: string;
};
```

`fileId` points at the durable storage file behind the artifact. `path` is the artifact path presented for this run.

## HTTP equivalent

```http
GET /v1/runs/{runId}/artifacts?kind=download&limit=100
```

## Related

* [Artifacts](/sdk/core-concepts/artifacts)
* [File Downloads](/sdk/observability/file-downloads)
* [Runs](/sdk/core-concepts/runs)