Use this file to discover all available pages before exploring further.
All span operations are available under the tracia.spans namespace. Spans are automatically created when you run prompts or use runLocal(), providing visibility into LLM usage, performance, and costs.
Terminology: A span represents a single LLM call. Multiple spans can be grouped into a trace (session) using the traceId parameter.
import { Tracia, Eval } from 'tracia';const tracia = new Tracia({ apiKey: process.env.TRACIA_API_KEY });// List spans with filtersconst { spans, nextCursor } = await tracia.spans.list({ promptSlug: 'welcome-email', status: 'SUCCESS', limit: 20});// Get a single spanconst span = await tracia.spans.get('sp_abc123def456');// Submit an evaluation for a spanawait tracia.spans.evaluate('sp_abc123def456', { evaluator: 'quality', value: Eval.POSITIVE});