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
SetTYPESAFE_API_KEY in your environment using a key from the TypeSafe console. The SDK reads this variable automatically. Use the register function from @arizeai/phoenix-otel to connect to Phoenix, then manually instrument the TypeSafe SDK for ESM.
Create the instrumentation.ts file:
Because this SDK is ESM, call
manuallyInstrument() after importing it. This patches the client method while leaving the module’s exports intact.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.

