# Capless documentation

Capless is analytics infrastructure for software that is written, run and queried by AI agents. It has two halves that share one data model:

* **Web analytics + session replay**: one script tag. 2.0 KB (brotli) for analytics; session replay is a separate 1.7 KB chunk loaded only for sampled sessions. No cookies.
* **A headless data backend**: three primitives behind one HTTP API at `https://api.capless.sh/v1`.
  1. **Streams**: durable, ordered, append-only collections of JSON records.
  2. **Functions**: deterministic, bounded [CEL](https://cel.dev) expressions for validation, filtering, mapping and erasure.
  3. **Materializations**: independently maintained copies of streams in ClickHouse, configured with real SQL.

Web analytics events land in a stream called `web.events` and replays in `web.replay`, so everything below applies to your web data too.

## Start here

* [Quickstart](https://capless.sh/docs/quickstart.md): account, snippet, first query. Five minutes.
* [For agents](https://capless.sh/docs/agents.md): the signup API, MCP and a curl-only flow an agent can run end to end.
* [MCP server](https://capless.sh/docs/mcp.md): connect Claude Code, Cursor or any MCP client.

## Reference

* [Web SDK](https://capless.sh/docs/web-sdk.md): snippet, JavaScript API, collected fields, replay privacy.
* [Streams & cursors](https://capless.sh/docs/streams.md): batches, positions, durability, idempotency.
* [Reading & change feed](https://capless.sh/docs/reading.md): `/read`, `/changes`, pagination and limits.
* [Time seeking](https://capless.sh/docs/time-seeking.md): jump to a commit time with `/locate`.
* [CEL functions](https://capless.sh/docs/cel.md): variables, number and regex rules, examples.
* [Erasures & GDPR](https://capless.sh/docs/erasures.md): delete by predicate, everywhere.
* [ClickHouse materializations](https://capless.sh/docs/materializations.md): tables, sources, lineage, status.
* [API reference](https://capless.sh/docs/api.md): every endpoint group; full [OpenAPI spec](https://capless.sh/openapi.yaml).
* [Limits & quotas](https://capless.sh/docs/limits.md) · [Security & privacy](https://capless.sh/docs/security.md)

## Conventions

* Base URL `https://api.capless.sh`. All endpoints are under `/v1`.
* Authenticate with your project API key: `authorization: Bearer cpl_…`.
* Bodies are JSON. Timestamps are UTC ISO 8601 with millisecond precision.
* IDs (`str_`, `ent_`, `era_`, `mat_`, `src_`) and cursors (`cur_`) are opaque strings.
* Errors are `{"error": {"code", "message", "details"?, "requestId"}}` with a stable `code`.
* Lists are paginated with `limit` + `pageToken` → `{data, nextPageToken}`.

Every page of these docs is also available as Markdown: append `.md` to its URL (this page: [/docs/index.md](https://capless.sh/docs/index.md)). [/llms.txt](https://capless.sh/llms.txt) indexes them, and [/llms-full.txt](https://capless.sh/llms-full.txt) is everything in one file.
