Overview — What TrailAI Is
TrailAI is a centralized AI gateway, observability, and guardrail platform. It gives teams building LLM and agent applications one place to answer four questions:
- What is my AI actually doing? — every LLM call, agent step, and tool invocation, traced.
- What is it costing me? — token and dollar cost per request, model, application, and environment.
- Is it safe? — guardrails that inspect inputs and outputs before they reach a user.
- What is it running on? — the prompts, models, and secrets your app depends on, versioned and managed.
You install a small SDK in your application, point it at TrailAI with an API key pair, and the platform does the rest.
The modules
| Module | What it does | Where you use it |
|---|---|---|
| LLM Observability | Ingests OpenTelemetry traces and metrics from instrumented apps. Span-level visibility into LLM calls, latency, token usage, and cost. | Tracing, LLM Analytics |
| Agent Analytics | Aggregates agent runs, per-agent behaviour, and tool-call statistics from gen_ai.* semantic-convention spans. |
Agent Analytics |
| Guardrails / Protections | Configurable detection for prompt injection, sensitive topics, and topic restriction. LLM-based or regex-based, with tunable thresholds. | Guardrails, SDK guardrails |
| Prompt Management | Store, version, label, and compile prompt templates; fetch them at runtime instead of hard-coding strings. | Prompts, SDK prompts |
| OpenGround | A playground that sends the same prompt to multiple providers side by side and compares responses, latency, and cost. | OpenGround |
| Secret Vault | Encrypted storage for API keys and secrets, scoped to an organization and project, retrievable from the SDK. | Vault, SDK vault |
| Organizations & Projects | Multi-tenant structure with members, roles, and per-project isolation of all data. | Organizations |
| Billing & Subscriptions | Tiered plans (Hobby, Pro, Enterprise) with usage metering. | Dashboard → Billing |

How the pieces connect
┌──────────────────────────┐
│ Your application │
│ (Python / TypeScript) │
│ │
│ trail.init(...) │
│ ├─ auto-instrumentation │ OpenAI, Anthropic, LangChain, CrewAI, …
│ ├─ @trace decorators │ your own agents, tools, functions
│ └─ trail.guard / prompts│
└───────────┬──────────────┘
│ OTLP/HTTP (protobuf) + REST
│ headers: X-Public-Key, X-Secret-Key
▼
┌──────────────────────────┐
│ TrailAI Server │ Express + TypeScript
│ /api/sdk/v1/* ← SDK │
│ /api/client/v1/* ← UI │
│ /api/admin/v1/* ← ops │
└───────────┬──────────────┘
│
▼
┌────────────┐
│ PostgreSQL │ traces, spans, metrics, prompts, vault, orgs
└────────────┘
▲
│ REST (session-authenticated)
┌───────────┴──────────────┐
│ Web Client (Next.js) │ the dashboard your team uses
└──────────────────────────┘
Full detail in Architecture.
The typical journey
- Sign up and confirm your email → Getting Started
- Create an organization, invite teammates, and create a project → onboarding wizard
- Generate an API key pair for that project → API Keys
- Install the SDK and call
trail.init()in your app → SDK Quickstart - Run your app. Traces appear in the dashboard within seconds
- Add guardrails, prompts, and vault secrets as your usage matures
Ready? → Platform Quickstart
What TrailAI is not
Being clear about the boundaries saves time:
- Not a model host. TrailAI does not run inference. Your app still calls OpenAI, Anthropic, a local vLLM server, etc. TrailAI observes and guards those calls.
- Not a proxy (by default). The SDK instruments your process in-band; traffic to your model provider does not route through TrailAI. OpenGround is the one place TrailAI calls providers directly, on your behalf, using keys you supply.
- Not a general APM. TrailAI is purpose-built for GenAI telemetry. It ingests OpenTelemetry, so it sits alongside your existing APM rather than replacing it.