# Mortem ## Docs - [POST /v1/traces/batch — send a trace event batch](https://docs.mortemlabs.com/api/batch.md): Send a gzip-compressed batch of trace and event objects to Mortem. This is the primary write path used by the SDK on every flush cycle. - [POST /v1/traces/:id/complete — finalize a trace](https://docs.mortemlabs.com/api/complete.md): Set a trace's terminal status and output summary, then queue it for analysis. Called automatically by session.complete() and session.fail() in the SDK. - [GET /v1/agents/:id/live — stream live trace events](https://docs.mortemlabs.com/api/live.md): Subscribe to a Server-Sent Events stream that delivers real-time trace updates for an agent. The dashboard uses this endpoint to power its live trace view. - [Mortem Ingest API: base URL, auth, and endpoints](https://docs.mortemlabs.com/api/overview.md): The Mortem Ingest API accepts trace batches, finalizes traces, and streams live events over SSE. Most teams use the SDK rather than calling it directly. - [Changelog](https://docs.mortemlabs.com/changelog.md): Latest updates and improvements to Mortem. - [Core concepts: agents, sessions, traces, and events](https://docs.mortemlabs.com/concepts.md): Understand the key building blocks of Mortem — agents, sessions, events, autopsies, and shared traces — before you instrument your first bot. - [Manage agents: create, connect, and rotate API keys](https://docs.mortemlabs.com/dashboard/agents.md): An agent is the unit of organization in Mortem — one agent maps to one bot or strategy. Learn how to create agents, connect the SDK, and manage API keys. - [Analysis — LLM-powered autopsy for every trace](https://docs.mortemlabs.com/dashboard/analysis.md): After a trace completes, Mortem queues it for LLM-powered analysis. Learn what the autopsy tells you, when it appears, and how to request a fresh diagnosis. - [Sharing — generate public autopsy links for traces](https://docs.mortemlabs.com/dashboard/sharing.md): Generate a shareable autopsy link for any trace. Public links expose the full event chronology and analysis to anyone with the URL — no login required. - [Traces: inspect and replay every agent run end to end](https://docs.mortemlabs.com/dashboard/traces.md): A trace records every LLM call, tool call, and Solana transaction from one agent run in order. Learn to find, inspect, and replay traces in Mortem. - [Instrument Anthropic Messages API calls with Mortem](https://docs.mortemlabs.com/guides/anthropic.md): Wrap your Anthropic client with Mortem to capture every Messages API call — prompts, completions, tool use blocks, token usage, and stop reason. - [Add Mortem observability tracing to LangChain agents](https://docs.mortemlabs.com/guides/langchain.md): Attach a Mortem callback handler to any LangChain chain or agent to capture LLM calls and tool invocations as structured trace events. - [Instrument OpenAI client calls with Mortem tracing](https://docs.mortemlabs.com/guides/openai.md): Wrap your OpenAI client with Mortem to capture every chat completion — prompts, responses, model, token usage, and cost — without changing call sites. - [Trace Solana transactions from your bot with Mortem](https://docs.mortemlabs.com/guides/solana.md): Wrap your Solana web3.js Connection with Mortem to record transaction signatures, confirmation status, and on-chain market context at decision time. - [Instrument Vercel AI SDK models and tools with Mortem](https://docs.mortemlabs.com/guides/vercel-ai-sdk.md): Wrap your Vercel AI SDK language model and tools with Mortem to capture every LLM call, tool invocation, token count, and cost estimate per trace. - [What is Mortem? Post-trade debugging for Solana bots](https://docs.mortemlabs.com/introduction.md): Mortem captures full agent traces for Solana trading bots, replays decision chronologies, and generates autopsies that tell you exactly what to fix. - [Quickstart: Send your first trace to Mortem](https://docs.mortemlabs.com/quickstart.md): Create an agent in the Mortem dashboard, install the SDK, wrap your agent code in a session, and view the resulting trace — all in under five minutes. - [Mortem SDK configuration reference for MortemConfig](https://docs.mortemlabs.com/reference/configuration.md): Complete reference for MortemConfig and SessionOptions — every option the SDK accepts, its type, default value, and when to use it. - [Event types reference: llm_call, tool_call, solana_tx](https://docs.mortemlabs.com/reference/event-types.md): Reference for all event types Mortem records in a trace — auto-captured events from wrappers and manual custom events you define yourself. - [Troubleshoot common Mortem SDK and dashboard issues](https://docs.mortemlabs.com/reference/troubleshooting.md): Step-by-step fixes for the most common Mortem SDK and dashboard problems — from missing traces to failed verification and silent event drops. - [Encrypt agent event payloads in Mortem with AES-256-GCM](https://docs.mortemlabs.com/sdk/encryption.md): Enable optional AES-256-GCM payload encryption in Mortem by setting MORTEM_MASTER_KEY. Payloads are encrypted before leaving your process. - [Record custom and manual events within a Mortem session](https://docs.mortemlabs.com/sdk/events.md): Use session.beginEvent() to record LLM calls, tool calls, Solana transactions, and custom steps as timestamped events inside a trace. - [Install and configure @mortemlabs/sdk in your agent](https://docs.mortemlabs.com/sdk/installation.md): Install @mortemlabs/sdk in your TypeScript agent, configure your API key and agent ID, and create a Mortem client to start capturing traces. - [Sessions: start, run, and close each agent trace](https://docs.mortemlabs.com/sdk/sessions.md): Create a session to open a trace, wrap your agent's work inside session.run(), and close it with complete or fail when the run finishes. - [Instrument LLM and Solana clients with Mortem wrappers](https://docs.mortemlabs.com/sdk/wrappers.md): Use mortem.wrapOpenAI(), wrapAnthropic(), wrapTools(), wrapLanguageModel(), langchainHandler(), and wrapConnection() to capture events automatically.