Quickstart
Run Pulse server
Section titled “Run Pulse server”Set up Pulse in this order: install binary, choose mode, run setup, then run the server.
1) Install the binary
Section titled “1) Install the binary”curl -fsSL https://raw.githubusercontent.com/EK-LABS-LLC/trace-service/main/scripts/install.sh | bash -s -- pulse-serverThis installs both pulse-server (trace service) and pulse (CLI integrations).
2) Choose single vs scale mode and set env vars
Section titled “2) Choose single vs scale mode and set env vars”Use single for the fastest local setup. Use scale when you need Postgres-backed multi-node or higher-throughput ingest.
See Single vs Scale Modes for an in-depth comparison and operational guidance.
Single mode (default, local SQLite):
export PULSE_MODE=singleexport BETTER_AUTH_SECRET="$(openssl rand -hex 32)"export ENCRYPTION_KEY="$(openssl rand -hex 32)"export BETTER_AUTH_URL='http://localhost:3000'Scale mode (Postgres + partitioned listeners):
export PULSE_MODE=scaleexport DATABASE_URL='postgresql://pulse:pulse@localhost:5432/pulse'export BETTER_AUTH_SECRET="$(openssl rand -hex 32)"export ENCRYPTION_KEY="$(openssl rand -hex 32)"export BETTER_AUTH_URL='http://localhost:3000'3) Run pulse setup
Section titled “3) Run pulse setup”pulse setuppulse setup creates your dashboard account, project, and API key, then writes ~/.pulse/config.toml.
4) Start the server
Section titled “4) Start the server”pulse-serverUse the same env vars from step 2 when starting the server.
If pulse setup already started pulse-server, you can skip this step.
Optional: run the dashboard UI
Section titled “Optional: run the dashboard UI”If you want the hosted frontend UI, run the separate pulse-dashboard Docker image.
See Dashboard UI (Docker) for same-origin and split-origin deployment patterns.
Install SDK
Section titled “Install SDK”bun add @eklabs/pulse-sdkpip install pulse-trace-sdkWorks with Bun, Node, or any JavaScript/Python runtime.
CLI integrations (Claude Code, Opencode, OpenClaw)
Section titled “CLI integrations (Claude Code, Opencode, OpenClaw)”If you want Pulse to capture coding-agent events in addition to SDK traces:
# Bootstrap config + account + integrationspulse setup --no-start-server
# Verify config + connectivity + integration statuspulse statusSee CLI Reference for full command and config details.
Initialize
Section titled “Initialize”Call initPulse() once at application startup using the API key created during pulse setup.
import { initPulse } from "@eklabs/pulse-sdk";
initPulse({ apiKey: "pulse_sk_...",});from pulse_sdk import init_pulse
init_pulse({ "api_key": "pulse_sk_...",})This starts background trace batches and registers shutdown handlers to flush remaining traces on exit.
Wrap your client
Section titled “Wrap your client”Use observe() to wrap your LLM client. The returned client behaves identically and tracing is captured as a side effect.
import { initPulse, observe, Provider } from "@eklabs/pulse-sdk";import OpenAI from "openai";
initPulse({ apiKey: "pulse_sk_..." });
const client = observe( new OpenAI({ apiKey: "sk-..." }), Provider.OpenAI);
const res = await client.chat.completions.create({ model: "gpt-4o", messages: [{ role: "user", content: "Hello" }],});from pulse_sdk import init_pulse, observe, Providerfrom openai import OpenAI
init_pulse({ "api_key": "pulse_sk_..." })
client = observe( OpenAI(api_key="sk-..."), Provider.OPENAI)
res = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Hello"}],)What gets captured
Section titled “What gets captured”| Field | Description |
|---|---|
| Request and response bodies | Full prompt and completion |
| Token counts | Input and output tokens |
| Latency | End-to-end request duration in milliseconds |
| Cost | Provider-reported or SDK-estimated when model pricing is available |
| Model | Requested and actual model used |
| Status | success or error |
| Provider | openai, anthropic, or openrouter |
Supported providers
Section titled “Supported providers”| Provider | Client | Enum |
|---|---|---|
| OpenAI | openai | Provider.OpenAI |
| Anthropic | @anthropic-ai/sdk | Provider.Anthropic |
| OpenRouter | openai | Provider.OpenRouter |
See Providers for detailed usage.