Skip to main content
The Lemma SDK sends trace JSON directly to the Lemma API.

1. Install

2. Set environment variables

Find your API key and project ID in Lemma project settings.
The SDK sends to https://api.uselemma.ai by default. Pass baseUrl to new Lemma({ baseUrl }) only when you need a custom endpoint.

3. Create a client

4. Send your first trace

Open the Lemma dashboard -> Traces. Your trace appears within seconds.

Optional: stamp a release

A release is the stable identifier your deployment process assigns to the running app, such as an app version, commit SHA, or container tag. Change it with each deployment.
Most CI systems expose the current commit SHA as an environment variable. Set LEMMA_RELEASE to that value during deployment to give each deployed code version a unique, stable identifier.

Option 2: Pass it when creating the client

Choose one option. If you set both, the release option overrides LEMMA_RELEASE. Framework adapters accept the same release option.

Next steps

Traces

Define one agent execution.

Generations

Capture LLM calls with model, prompt, completion, and timing.

Tool calls

Record tool arguments and results.

Trace contract

The exact shape Lemma reads.