Step 1 — Install
A · Coding agent (Claude Code, Cursor)
A wizard writes the right hooks and env into your IDE’s config. No code changes.B · Autonomous agent (ElizaOS, Solana Agent Kit, custom)
Install the SDK as a library and callvoight.log() from your agent code.
C · Production LLM app (OpenAI / Anthropic in user-facing flows)
If your app already usesopenai or @anthropic-ai/sdk (or both), wrap your clients once and every model call is captured — prompts, tokens, cache reads, tool calls, latency, errors. Per-user spend attribution with one extra line of code.
Two ways to install:
C1 · Wizard (recommended — 30 seconds)
openai and @anthropic-ai/sdk in your package.json, asks for your Voight API key, validates it against api.voight.xyz, and writes src/lib/voight.ts with the wrapped clients ready to import. Tailors the usage snippet to your framework (Next.js or vanilla) and prints the right install command for your package manager (pnpm / yarn / bun / npm).
Provider keys (OPENAI_API_KEY / ANTHROPIC_API_KEY) stay in your app’s env — Voight never sees them. Full deep-dive in Wizard.
C2 · Manual (you prefer to wire it yourself)
Skip the wizard and install the wrappers directly:
VOIGHT_KEY in your runtime environment (or in .env.local). The tags map drives per-user spend tracking — the dashboard’s Users sub-tab populates with per-customer cost as soon as your first request lands. Full reference: OpenAI SDK · Anthropic SDK.
D · Any language over HTTP
For Python, Go, Rust, or anything that speaks JSON — POST events directly, no SDK required.Step 2 — Pick your privacy level
For path A the wizard prompts you. For path B pass it onvoight.init({ privacy: 'standard' }). For path C set it on wrapOpenAI(..., { privacy: 'standard' }). For path D include metadata.privacyLevel on each request — scrubbing is your responsibility on the raw HTTP path.
- Minimal — metadata only. No prompts, responses, file paths, cwd, or git context leave your machine.
- Standard ★ — full content with local PII scrubbing. Credentials and personal info redacted before transmission.
- Full — everything captured as-is.
Step 3 — Generate your API key
When the wizard asks for a key — or before you initialize the library / send your first request — open voight.xyz/dashboard/settings and click + Generate key. Copy thevk_... secret. You’ll only see it once, so save it to a password manager.
Paste it into the wizard, or set it as VOIGHT_KEY in your runtime environment.
Step 4 — You’re connected
Open voight.xyz/dashboard. Within seconds you should see:- A new agent in the Agents list (auto-named from your install path, renameable)
- Events streaming in Overview and Audit log
- Token counts, cost USD, and model tags on each event
- A per-event privacy chip (
MIN/STD/FULL) confirming which level captured it
tags.userId inside withTrace. See AI Apps overview for the full surface.
Non-TTY install for path A
Ifstdin isn’t an interactive TTY (running the wizard from inside a chat agent, CI, or any non-interactive shell), setup runs in 3-step progressive mode instead of an interactive prompt:
Troubleshooting
Events aren't showing up
Events aren't showing up
- Confirm the SDK version:
npx -y @voightxyz/sdk@latest --version(should be 0.4.2 or higher). - For path A — check your IDE’s settings file (
~/.claude/settings.jsonfor Claude Code):env.VOIGHT_KEYshould be set andhooksshould contain entries callingnpx -y @voightxyz/sdk hook. Restart your IDE afterwards — hooks are read on startup. - For path B / C — confirm your code is actually calling
voight.log()or POSTing, and thatVOIGHT_KEYis set in the runtime environment. - Check the dashboard’s Audit log for the most recent events — they should appear within ~2 seconds of being sent.
npx serves an old SDK version
npx serves an old SDK version
Force the latest with an explicit version:Or clear the npx cache:
The SDK isn't capturing my prompts
The SDK isn't capturing my prompts
You’re probably on Minimal mode, which strips content fields by design. Re-run setup with Standard or Full:Or for path B / C, pass the level on
voight.init({ privacy: 'standard' }).My IDE shows a warning about the package
My IDE shows a warning about the package
Some coding agents flag unfamiliar packages installed with
-y for safety. The two-line copy block in your dashboard onboarding includes a framing line (“Set up Voight observability here:”) that gives the agent the intent it needs to skip the warning.Next
- Concepts → Events — the data model
- Privacy overview — pick the right level for your workflow
- Library mode — deep dive on path B
- OpenAI SDK · Anthropic SDK — deep dive on path C
- Per-user spend — one line of code to attribute cost per end-user
- HTTP API — deep dive on path D