# Quickstart

> Build the SDK, record a model call, verify it, and seal a Notarized one later.

Part of the Exalto Capture docs. Page: https://capture.exalto.ai/docs/getting-started. Every page is listed in https://capture.exalto.ai/llms.txt; the whole site in one file is https://capture.exalto.ai/llms-full.txt.

You'll build the Python SDK, send one model request through it, store the Trace it hands back, and verify it. Then you'll record a Notarized call, whose plaintext the notary never receives, and seal it later. No packages are published yet, so the SDK builds from the [public source](https://github.com/exalto-ai/capture-oss). Node.js works the same way, shown in the second tab.

You need Rust 1.95.0 and a C toolchain, Python 3.10 or later (or Node.js 20 or later), and an OpenAI API key in `OPENAI_API_KEY`. The SDK also captures Anthropic, OpenRouter and DeepSeek calls; see [What can be captured](https://capture.exalto.ai/docs/sdk#what-can-be-captured). An Exalto API key is optional: without one, Exalto's notary draws on a small monthly allowance for your network address.

1. **Build the SDK.** Clone the source and build the package for your language.
   
   ### Python
   
   ```sh title="Terminal"
   git clone https://github.com/exalto-ai/capture-oss.git
   cd capture-oss/sdk/python
   python3 -m venv .venv && .venv/bin/pip install maturin httpx2 openai
   VIRTUAL_ENV="$PWD/.venv" .venv/bin/maturin develop --release
   ```
   
   This builds the SDK into `.venv`. To build it into your own project's virtual environment, set `VIRTUAL_ENV` to that one instead.
   
   ### Node.js
   
   ```sh title="Terminal"
   git clone https://github.com/exalto-ai/capture-oss.git
   cd capture-oss/sdk/js
   npm ci && npm run build
   ```
   
   Then add it to your project with `npm install openai path/to/capture-oss/sdk/js`.
2. **Record a call.** Give the OpenAI client the SDK's transport. The client is configured as before, and the SDK hands the evidence to `keep` once the response has been read. This first call is **Witnessed**: Exalto's notary receives the request, your OpenAI key included, relays it, and signs a receipt. To keep your key and plaintext from the notary, use Notarized mode, [below](#record-a-notarized-call-and-seal-it-later).
   
   ### Python
   
   ```python title="record.py"
   import os
   from pathlib import Path
   
   import httpx2
   from openai import OpenAI
   from exalto_capture import Client, Notary
   from exalto_capture.transport import CaptureTransport
   
   client = Client(Notary.exalto(api_key=os.environ.get("EXALTO_API_KEY")))
   
   def keep(artifact):
       Path(f"{artifact.trace_id}.{artifact.extension}").write_bytes(artifact.data)
       print("kept", artifact.trace_id, artifact.kind)
   
   openai = OpenAI(http_client=httpx2.Client(
       transport=CaptureTransport(client, mode="witnessed", on_artifact=keep),
   ))
   print(openai.responses.create(model="YOUR_MODEL", input="Reply with exactly: hello").output_text)
   ```
   
   ```sh title="Terminal"
   .venv/bin/python record.py
   ```
   
   ### Node.js
   
   ```js title="record.mjs"
   import { writeFileSync } from "node:fs";
   import OpenAI from "openai";
   import { Client, createFetch, exaltoNotary } from "@exalto/capture";
   
   const client = new Client(await exaltoNotary(process.env.EXALTO_API_KEY));
   
   function keep(artifact) {
     writeFileSync(`${artifact.traceId}.${artifact.extension}`, artifact.data);
     console.log("kept", artifact.traceId, artifact.kind);
   }
   
   const openai = new OpenAI({ fetch: createFetch(client, { mode: "witnessed", onArtifact: keep }) });
   const response = await openai.responses.create({ model: "YOUR_MODEL", input: "Reply with exactly: hello" });
   console.log(response.output_text);
   ```
   
   ```sh title="Terminal"
   node record.mjs
   ```
   
   The file you kept is a `.llmtrace`, **Sealed · Witnessed** already. Its evidence is the notary operator's word, not a proof.
3. **Verify it.** Pass the `.llmtrace` you kept to a verify script.
   
   ### Python
   
   ```python title="verify.py"
   import sys
   from pathlib import Path
   
   from exalto_capture import Notary
   
   result = Notary.exalto().verify(Path(sys.argv[1]).read_bytes())
   print(result.evidence_kind, result.provider_host, result.created_at_unix_ms)
   ```
   
   ### Node.js
   
   ```js title="verify.mjs"
   import { readFileSync } from "node:fs";
   import { exaltoNotary } from "@exalto/capture";
   
   const notary = await exaltoNotary();
   const result = await notary.verify(readFileSync(process.argv[2]));
   console.log(result.evidenceKind, result.providerHost, result.createdAtUnixMs);
   ```
   
   Verification checks the package against the notary keys in Exalto's Registry, which `Notary.exalto()` downloaded when you created it. It never contacts OpenAI or the notary, and fails with an error if anything doesn't check out. It prints `witnessed`: always report the evidence kind with the result. You can also drop the file on [capture.exalto.ai/verify](https://capture.exalto.ai/verify).

## Record a Notarized call, and seal it later

In Notarized mode the notary never receives your plaintext or your credentials: it relays the encrypted TLS records and witnesses the session without reading it. Your process still holds both, and the SDK hands you a `.llmcapture`, the private checkpoint of the exchange, encrypted under a capture key you keep. Nothing slow happens during the call; you seal the captures you need to prove later.

1. **Make a capture key.** Generate a random 32-byte key once.
   
   ### Python
   
   ```sh title="Terminal"
   .venv/bin/python -c 'import base64; from exalto_capture import CaptureKey; print(base64.b64encode(CaptureKey.generate().to_bytes()).decode())'
   ```
   
   ### Node.js
   
   ```sh title="Terminal"
   node -e 'console.log(require("@exalto/capture").CaptureKey.generate().toBytes().toString("base64"))'
   ```
   
   Keep the output in your secret manager, and give it to your code as `CAPTURE_KEY`. A `.llmcapture` can rebuild the original request, credential included, so whoever holds one and its key can read that request. Without the key, a capture can never be sealed.
2. **Record in Notarized mode.** In the record script, read the key and change the mode:
   
   ### Python
   
   ```python title="record.py"
   import base64
   from exalto_capture import CaptureKey
   
   key = CaptureKey.from_bytes(base64.b64decode(os.environ["CAPTURE_KEY"]))
   openai = OpenAI(http_client=httpx2.Client(
       transport=CaptureTransport(client, mode="notarized", key=key, on_artifact=keep),
   ))
   ```
   
   ### Node.js
   
   ```js title="record.mjs"
   import { CaptureKey } from "@exalto/capture";
   
   const key = CaptureKey.fromBytes(Buffer.from(process.env.CAPTURE_KEY, "base64"));
   const openai = new OpenAI({ fetch: createFetch(client, { mode: "notarized", key, onArtifact: keep }) });
   ```
   
   Run it again. This time `keep` stores a `.llmcapture`: the Trace is **Captured**, and nobody can check it yet.
3. **Seal it when you need to.** Pass the `.llmcapture` and its key to `notarize`.
   
   ### Python
   
   ```python title="seal.py"
   import base64, os, sys
   from pathlib import Path
   
   from exalto_capture import CaptureKey, Client, Notary
   
   key = CaptureKey.from_bytes(base64.b64decode(os.environ["CAPTURE_KEY"]))
   client = Client(Notary.exalto(api_key=os.environ.get("EXALTO_API_KEY")))
   capture = Path(sys.argv[1])
   capture.with_suffix(".llmtrace").write_bytes(client.notarize(capture.read_bytes(), key))
   ```
   
   ### Node.js
   
   ```js title="seal.mjs"
   import { readFileSync, writeFileSync } from "node:fs";
   import { CaptureKey, Client, exaltoNotary } from "@exalto/capture";
   
   const key = CaptureKey.fromBytes(Buffer.from(process.env.CAPTURE_KEY, "base64"));
   const client = new Client(await exaltoNotary(process.env.EXALTO_API_KEY));
   const source = process.argv[2];
   writeFileSync(source.replace(/\.llmcapture$/, ".llmtrace"), await client.notarize(readFileSync(source), key));
   ```
   
   Sealing runs the TLSNotary proof with the notary, so it takes far longer than the call did and uses much more CPU and memory. The `.llmtrace` it writes is **Sealed · Notarized**, and the verify script now prints `notarized`.

Capture and sealing through Exalto's notary draw on separate monthly allowances; [Plans and billing](https://capture.exalto.ai/docs/billing) explains what's metered.

## Agents you can't change

The SDK captures the clients in your own code. To record Claude Code, Codex, or an agent in CI or the cloud, send its requests through [hosted capture](https://capture.exalto.ai/docs/hosted-capture) instead. Exalto then handles the plaintext and the provider credential, in every mode.

## Next steps

- **[SDK](https://capture.exalto.ai/docs/sdk)**: Anthropic, async clients, Rust, your own notary, and what the notary sees.

- **[How Capture works](https://capture.exalto.ai/docs/how-it-works)**: The capture modes, and who sees your requests in each.

- **[Trust model](https://capture.exalto.ai/docs/trust-model)**: Exactly what a sealed Trace proves, and what it doesn't.

- **[Share a Trace](https://capture.exalto.ai/docs/share)**: Publish one sealed Trace at a link anyone can check.
