# Lettertrace

> Open-source, bring-your-own-key tool that monitors how often Claude, ChatGPT, and Gemini mention your brand, tracking visibility, share of voice, sentiment, and competitor benchmarks over time.

Lettertrace is an open-source AEO (Answer Engine Optimization) / GEO (Generative Engine Optimization) monitoring tool built by The Letter Company. It measures how often AI assistants like Claude, ChatGPT, and Gemini mention your brand in their answers, turning raw model responses into actionable visibility metrics. The project is MIT-licensed, self-hostable, and built on a bring-your-own-key (BYOK) model — your API keys are encrypted at rest and never leave your infrastructure.

## What It Is

Lettertrace sits in the emerging category of AI visibility monitoring tools, sometimes called AEO telemetry. You describe your brand and the topics your buyers ask about, and Lettertrace auto-generates realistic prompt variations, runs them against the AI models you configure, detects brand and competitor mentions in the answers, and charts how visibility, share of voice, prominence, and sentiment move over time. It is designed for AEO/GEO teams who need a repeatable, data-rich signal on how their brand appears in AI-generated answers — not just whether it appears, but how prominently and with what sentiment.

## Core Metrics and Detection

Every run produces four key signals:

- **Brand visibility** — the rate at which your brand is mentioned across all prompts in a run
- **Share of voice** — how often you win the answer versus each tracked competitor
- **Prominence** — where in the answer your brand first appears
- **Sentiment** — whether the model speaks positively, neutrally, or negatively about you, and whether it recommends you

Detection is two-stage: deterministic word-boundary matching for occurrence count and first position, followed by an LLM-enrichment call that classifies sentiment and recommendation status for any entity that was mentioned.

## Multi-Model and BYOK Architecture

Lettertrace supports Claude (Anthropic), ChatGPT (OpenAI), Gemini, Google AI Overviews, and Perplexity Sonar. Keys are encrypted with AES-256-GCM and only a masked hint is ever returned to any client surface. The tool also supports LLM router keys — a single credential from a gateway like Concentrate or OpenRouter can serve multiple providers — though Gemini, Google AI Overviews, and Perplexity still require their own keys due to provider-specific grounding mechanics. Web search grounding is verified at key-save time, not assumed, because an ungrounded answer is a different measurement from a grounded one.

## Self-Hosting and Deployment

The stack is Next.js 14 (App Router, TypeScript), Tailwind CSS, Recharts, and Supabase (Postgres, Auth, Row Level Security). Self-hosting requires a Supabase project, a 32-byte `ENCRYPTION_KEY`, and optionally a `CRON_SECRET` for scheduled runs. The project ships a pre-built multi-arch Docker image (`ghcr.io/letterstory/lettertrace`) for amd64 and arm64, so deployment is a single `docker run` after applying the Supabase schema. Vercel deployment is also supported with a built-in daily cron via `vercel.json`.

## Programmatic Access: REST API, CLI, and MCP

Beyond the web dashboard, Lettertrace exposes a REST v1 API (bearer-token authenticated), a full CLI in `cli/`, and a Model Context Protocol (MCP) server endpoint. The CLI handles OAuth 2.1 Authorization Code + PKCE login, key management, project setup, competitor tracking, and run triggering — all scriptable with `--json` flags and non-zero exit codes on error. The MCP server exposes tools (`list_projects`, `list_runs`, `get_share_of_voice_report`, `trigger_run`) so Claude and other MCP clients can query share-of-voice data conversationally. API keys are stored as SHA-256 hashes and shown only once at creation.

## Current Status

The GitHub repository under `letterstory/lettertrace` was created in July 2026 and last pushed in August 2026, with 39 stars and 7 forks at time of indexing. The project is actively developed, with recent additions including LLM router support, OAuth 2.1 delegated access, per-URL source attribution (target_url on prompts), and multi-organization support. The README documents a schema migration path for upgrading existing deployments, indicating ongoing iteration. The hosted version at lettertrace.com is available for free with the same BYOK model as the self-hosted version.

## Features
- Brand visibility monitoring across Claude, ChatGPT, Gemini, and Perplexity
- Bring-your-own-key (BYOK) with AES-256-GCM encryption at rest
- Auto-generate prompt variations from topics
- Share of voice benchmarking against competitors
- Sentiment and recommendation detection via LLM enrichment
- Scheduled daily/weekly monitoring runs
- Multi-model side-by-side comparison
- Web search grounding with source attribution
- Multi-organization support
- REST v1 API with bearer token auth
- CLI with OAuth 2.1 PKCE login
- MCP server for conversational share-of-voice queries
- LLM router support (Concentrate, OpenRouter)
- Self-hostable via Docker or Vercel
- Trend lines over time for visibility, prominence, and sentiment
- Per-URL cited-hit rate tracking
- Competitor discovery from existing run answers

## Integrations
Anthropic Claude, OpenAI ChatGPT, Google Gemini, Google AI Overviews, Perplexity Sonar, Supabase, Concentrate (LLM router), OpenRouter, Resend (operator alerts), Vercel (cron scheduling), Docker, GitHub OAuth, Google OAuth

## Platforms
WEB, CLI, API

## Pricing
Open Source

## Links
- Website: https://lettertrace.com
- Documentation: https://github.com/letterstory/lettertrace
- Repository: https://github.com/letterstory/lettertrace
- EveryDev.ai: https://www.everydev.ai/tools/lettertrace
