TheDocumentation Index
Fetch the complete documentation index at: https://tracepilot.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
TracePilot class is the single entry point for the TracePilot SDK. You instantiate it once per process, passing your API key, and then use the returned instance to start traces and wrap LLM or tool calls throughout your agent.
Constructor
Your TracePilot API key. All keys start with
tp_live_. Retrieve yours from the TracePilot dashboard.Optional custom ingest endpoint URL. Use this when you run a self-hosted TracePilot server. Omit this parameter to send data to the default TracePilot cloud ingest endpoint.
Usage
API keys always begin with
tp_live_. If your key does not match this format, generate a new one from the dashboard. Never commit API keys to source control — see Configure the TracePilot AI SDK for the recommended environment-variable pattern.Method summary
After constructing aTracePilot instance, use these methods to instrument your agent:
| Method | Description |
|---|---|
tp.startTrace(agentName) | Starts a new trace session. Call once per agent run. |
tp.wrapOpenAI() | Wraps an OpenAI chat completion call and captures the span. |
tp.wrapToolCall() | Wraps any async tool or function call and captures the span. |
startTrace
Starts a new trace session. Call this once at the beginning of each agent run, before any wrapOpenAI or wrapToolCall calls.
A display name for this agent run. Appears as the trace root in the dashboard.