@mortemlabs/sdk uses to deliver traces from your agent to Mortem’s storage and analysis pipeline. You can call it directly if you need lower-level control, want to send traces from a language the SDK doesn’t support, or are building your own instrumentation layer. For most TypeScript agents, the SDK handles everything described on this page automatically.
Base URL
All Ingest API requests go to:http://localhost:4001).
Authentication
Pass your agent API key in theAuthorization header on every request:
x-mortem-api-key header if your HTTP client does not support the Authorization header.
Endpoints
Rate limiting
The API rate-limits requests per agent using a per-minute sliding bucket. When you exceed the limit, the API returns429 Too Many Requests. The SDK backs off and retries automatically; if you’re calling the API directly, wait until the current minute window resets before retrying.
The rate limit is scoped to your agentId, not your IP address. Running multiple processes with the same agent key shares the same bucket.
Error responses
The API returns standard HTTP error codes with a JSON body that contains anerror field describing the problem.
The SDK swallows ingest errors and routes them to your configured logger rather than throwing into agent code. If you are calling the API directly, implement your own retry logic for
429 and transient 5xx responses.