Base URL
/v1/ path prefix (e.g. /v1/ingest, /v1/traces).
Authentication
Every request requires a bearer token in theAuthorization header.
API keys are tenant-scoped. They have access to every project in your organisation and are long-lived until revoked. Never embed them in client-side code — always call the TruLayer API from your server, or use a short-lived Clerk session token from an authenticated browser.
Content type
All request and response bodies are JSON unless otherwise noted:Rate limits
Rate limits are per tenant, enforced via a fixed window (1-minute buckets):
When a limit is exceeded you get HTTP 429. Check the
X-RateLimit-* headers on every response for the current window state. Enterprise plans have no hard limits.
Error format
Errors always return a JSON body of this shape:error field is a human-readable string. Machine-parseable error codes (where applicable) are returned in dedicated fields specific to each endpoint — for example, POST /v1/eval returns {"code": "eval_quota_exceeded", "error": "..."} when the monthly eval quota is exceeded.
Machine-readable error codes
Some errors include acode field alongside the human-readable error string. Use the code value for programmatic handling — the error string is subject to change without notice.
Always log the
request_id — it’s the fastest way for support to look up a failed request.
Versioning
The current API version is v1. Backwards-incompatible changes are shipped as a new version path (/v2/...); v1 is supported for at least 12 months after v2 release.
Additive changes (new fields, new optional parameters) may land on v1 without a version bump — client code should ignore unknown response fields.
SDKs
For most apps, you should not hit these endpoints directly — the SDKs handle batching, retries, and serialisation for you.Python SDK
pip install trulayerTypeScript SDK
npm install @trulayer/sdk