Looking for Python? See the Python guide.
@typesafe-ai/sdk). Each TypeSafeClient.systemOne call is captured as an OpenInference DECISION span with JSON input.value / output.value, and with the model and token usage recorded under decision.*.
Requires Node.js 20+ and @arizeai/openinference-instrumentation-typesafe >= 0.4.1. client.models.list() is not instrumented.
Install
Setup
Use theregister function from @arizeai/phoenix-otel to connect to Phoenix, then register the TypeSafe instrumentation.
Create the instrumentation.ts file:
Registering the instrumentation this way patches
@typesafe-ai/sdk at load time, which requires instrumentation.ts to run before the SDK is imported (CommonJS only). For ESM, bundlers, or when the SDK is imported first, call manuallyInstrument instead:Usage
Spans are exported in batches. In short-lived scripts, call
await provider.forceFlush() before the process exits so all spans are delivered to Phoenix.Observe
With instrumentation enabled, eachsystemOne call shows up in Phoenix as a DECISION span containing:
- The full
stateandquestionssent to TypeSafe asinput.value(JSON) - The typed
answersreturned asoutput.value(JSON) decision.systemanddecision.provider: bothtypesafedecision.request.model_name,decision.response.model_name(the resolved model), anddecision.model_namedecision.token_count.inputanddecision.token_count.output, when reported by the SDK
decision.* rather than llm.*, so decision-model calls stay out of Phoenix’s LLM token and cost reporting. Earlier releases recorded them under llm.*, and releases before 0.3.0 recorded them as LLM spans.

Configuration
PasstraceConfig to mask sensitive request/response payloads before they leave your process:
traceConfig masking options and the SDK compatibility table.

