Skip to main content
Use the runtime trace builder when you want visibility beyond what the proxy can infer from provider traffic alone.

Quickstart

Start with installation, agent initialization, and your first proxied OpenAI or Anthropic call.

Proxy Helpers

Review the proxy key flow before adding runtime events on top of proxied traffic.

Advanced Patterns

Move there after this page for hybrid flows, self-hosting, and common mistakes.

Minimal trace

Use the exact same traceId here that you pass in X-Trace-ID on proxied OpenAI or Anthropic calls when you want tool events and model events to stay on the same thread.

Linking events to users

Use externalUserId to associate events with your application’s user IDs:
The externalUserId is stored on every event and trace, allowing you to filter and analyze traces by your own user identifiers.

Tool spans

toolCallRequest() returns a spanId. Reuse that same value in toolCallResponse() so the UI can treat the execution as a single tool span.

Prompt caching usage

Use cacheReadTokens for tokens served from cache and cacheCreationTokens for tokens written into cache when your runtime exposes those values.

Event map

All methods accept externalUserId as an optional parameter to link the event to your application user.

Hybrid pattern

Use this when the proxy already captures the LLM exchange, but you still want application-side latency and outcomes for tools, queue jobs, or downstream APIs.