# TracePilot AI ## Docs - [API key setup and authentication for TracePilot AI](https://docs.tracepilotai.com/authentication.md): Learn how to get your TracePilot API key, pass it to the SDK, understand the key format, and configure a custom endpoint for self-hosted deployments. - [Token and cost tracking for every LLM call you make](https://docs.tracepilotai.com/concepts/cost-tracking.md): TracePilot AI captures per-span token usage and estimated API cost automatically for every wrapOpenAI call, with no extra configuration needed. - [Time-travel debugging: fork and fix any failing span](https://docs.tracepilotai.com/concepts/time-travel-debugging.md): Fork any failing span in the TracePilot AI dashboard, edit its input, and rerun from that exact point — no redeployment required. - [Traces and spans: how TracePilot AI models your agents](https://docs.tracepilotai.com/concepts/traces-and-spans.md): TracePilot AI organizes every agent run into traces and spans. Learn how parent-child span links build a full, inspectable execution tree. - [Navigate and debug with the TracePilot AI dashboard](https://docs.tracepilotai.com/guides/dashboard.md): Browse execution trees, inspect span inputs and outputs, monitor token costs and latency, and fork any failing step to fix it without redeploying. - [How to Debug OpenAI Agent Infinite Loops](https://docs.tracepilotai.com/guides/debug-openai-agent-infinite-loops.md): Stop runaway OpenAI agent loops before they drain your API budget. Use tracepilot-openai to detect recursive tool calls, retry loops, and broken memory chains — then replay them. - [Debugging Vercel AI SDK Step-by-Step](https://docs.tracepilotai.com/guides/debugging-vercel-ai-sdk.md): Learn how to debug Vercel AI SDK workflows in production. Add full observability to generateText, streamText, and tool calls with tracepilot-vercel. - [Build span execution trees for multi-step AI agents](https://docs.tracepilotai.com/guides/multi-step-agents.md): Build a parent-child span tree for complex agents so the dashboard shows every decision, tool call, and LLM response in the correct order. - [Trace tool calls, functions, and external API calls](https://docs.tracepilotai.com/guides/tracing-tool-calls.md): Use wrapToolCall to instrument any async function your agent invokes — web searches, database queries, emails, or any other external API call. - [How to wrap OpenAI calls and capture full agent traces](https://docs.tracepilotai.com/guides/wrapping-openai.md): Learn how to initialize TracePilot AI, start a trace, and wrap OpenAI chat completions to capture inputs, outputs, tokens, and latency automatically. - [Add TracePilot AI span tracing to your CrewAI agents](https://docs.tracepilotai.com/integrations/crewai.md): Trace CrewAI agent tool calls with TracePilot by wrapping each tool's execute method — and flag destructive operations before they cause problems. - [TracePilot AI with AutoGen and custom orchestrators](https://docs.tracepilotai.com/integrations/custom-orchestration.md): Trace any async orchestration system — AutoGen, custom loops, or your own framework — using wrapOpenAI for LLM calls and wrapToolCall for everything else. - [Add TracePilot AI tracing to your LangChain agents](https://docs.tracepilotai.com/integrations/langchain.md): Add TracePilot tracing to LangChain agents by wrapping the underlying OpenAI completion calls — without changing how your chains or agents work. - [What is TracePilot AI? Debugging layer for AI agents](https://docs.tracepilotai.com/introduction.md): TracePilot AI captures every LLM call, tool invocation, token spent, and error in your agents as a structured trace you can inspect and replay. - [Quickstart: send your first trace with TracePilot AI](https://docs.tracepilotai.com/quickstart.md): Install the TracePilot SDK, get your API key, wrap your first agent, and see a live trace in the dashboard — all in under five minutes. - [Quickstart: tracepilot-openai](https://docs.tracepilotai.com/quickstart-openai.md): Add full observability to your OpenAI agents in under 5 minutes. Trace every completion call, tool invocation, and token spent — then replay failures from the dashboard. - [Quickstart: tracepilot-vercel](https://docs.tracepilotai.com/quickstart-vercel.md): Instrument Vercel AI SDK with full observability in under 5 minutes. Trace generateText, streamText, and tool calls — then replay failures from the dashboard. - [Configure the TracePilot AI SDK for your TypeScript project](https://docs.tracepilotai.com/reference/configuration.md): Set up your API key safely with environment variables, configure a custom ingest endpoint for self-hosted deployments, and enable TypeScript strict mode. - [TracePilot class: constructor and methods reference](https://docs.tracepilotai.com/reference/tracepilot.md): Constructor reference for the TracePilot class. Pass your API key and an optional custom ingest endpoint to initialize the SDK for your agent. - [tp.wrapOpenAI() method — TracePilot SDK reference](https://docs.tracepilotai.com/reference/wrap-openai.md): Wrap any OpenAI chat completion call to capture a span. Returns the original ChatCompletion result unchanged, plus a spanId for linking child spans. - [tp.wrapToolCall() method — TracePilot SDK reference](https://docs.tracepilotai.com/reference/wrap-tool-call.md): Wrap any async tool or function call to capture a span. Optionally mark it as destructive to flag operations that modify external state in the dashboard.