Phoenix’s TypeScript SDK is modular by design, allowing you to install only what you need. Each package serves a specific purpose and can be used independently or together.
API for the Phoenix platform
OpenTelemetry tracing for Node.js
LLM evaluation and metrics toolkit
Instrumentation helpers
Model Context Protocol server
Command-line interface for traces
Installation#
Install all packages together or individually based on your needs:
Each Phoenix SDK package now ships curated docs and source code directly in node_modules, following the same local-install pattern used by the AI SDK.
node_modules/@arizeai/phoenix-client/docs/andsrc/node_modules/@arizeai/phoenix-evals/docs/andsrc/node_modules/@arizeai/phoenix-otel/docs/andsrc/
These bundled docs are version-matched to the package you installed, require no network access, and mirror the package-doc sections in this navigation tree.
Environment Variables#
All packages respect common Phoenix environment variables for seamless configuration:
| Variable | Description | Used By |
|---|---|---|
PHOENIX_ENDPOINT | Phoenix base URL — canonical for everything except trace export | Client, MCP, CLI |
PHOENIX_COLLECTOR_ENDPOINT | Base URL traces are exported to | OTEL (Client, MCP and CLI infer from it when PHOENIX_ENDPOINT is unset) |
PHOENIX_API_KEY | API key for authentication | Client, OTEL, MCP, CLI |
PHOENIX_CLIENT_HEADERS | Custom HTTP headers (JSON) | Client, CLI |
PHOENIX_PROJECT | Project name or ID | CLI |
@arizeai/phoenix-client#
TypeScript client for the Phoenix REST API. Manage prompts, datasets, experiments, and access all Phoenix endpoints with full TypeScript auto-completion.
- Prompts — Create, version, and retrieve prompt templates with SDK helpers for OpenAI, Anthropic, and Vercel AI
- Datasets — Create and manage datasets for experiments and evaluation
- Experiments — Run evaluations and track experiment results with automatic tracing
- Eval tests — Run dataset-backed evaluations as Vitest or Jest tests via
@arizeai/phoenix-client/vitestand/jest - REST API — Full access to all Phoenix endpoints with strongly-typed requests
@arizeai/phoenix-otel#
OpenTelemetry wrapper for sending traces to Phoenix. Simplifies setup with automatic configuration and support for instrumenting Node.js applications.
- Simple setup — Single
register()call to configure tracing - Phoenix-aware defaults — Reads
PHOENIX_COLLECTOR_ENDPOINT,PHOENIX_API_KEY, and other environment variables - OpenInference helper surface — Re-exports
withSpan,traceChain,traceAgent,traceTool,observe, context setters, attribute builders, andOITracer - Provider-swap safe wrappers — The re-exported helpers resolve the default tracer when the wrapped function executes
- Production ready — Built-in batch processing and authentication support
- Auto-instrumentation — Support for HTTP, Express, and other OpenTelemetry instrumentations
- Manual tracing — Create custom spans using the OpenTelemetry API
@arizeai/phoenix-evals#
TypeScript evaluation library for LLM applications. Create custom evaluators or use pre-built ones for faithfulness detection, relevance scoring, and other evaluation tasks.
- Vendor agnostic — Works with any AI SDK provider (OpenAI, Anthropic, etc.)
- Pre-built evaluators — Faithfulness detection, relevance scoring, and more
- Custom classifiers — Create your own evaluators with custom prompts
- Experiment integration — Works seamlessly with
@arizeai/phoenix-clientfor experiments
@arizeai/openinference-core#
OpenInference provides instrumentation utilities for tracing LLM applications. The core package (@arizeai/openinference-core) offers tracing helpers, decorators, and context attribute propagation.
If you are already using Phoenix, @arizeai/phoenix-otel re-exports these helpers from the same package path. Install @arizeai/openinference-core directly when you want the framework-agnostic helpers without Phoenix’s tracing registration layer.
Tracing Helpers#
Convenient wrappers to instrument your functions with OpenInference spans:
withSpan— Wrap any function (sync or async) with OpenTelemetry tracingtraceChain— Trace workflow sequences and pipelinestraceAgent— Trace autonomous agentstraceTool— Trace external tool calls
Decorators#
@observe— Decorator for automatically tracing class methods with configurable span kinds
Attribute Helpers#
Generate properly formatted attributes for common LLM operations:
getLLMAttributes— Attributes for LLM inference (model, messages, tokens)getEmbeddingAttributes— Attributes for embedding operationsgetRetrieverAttributes— Attributes for document retrievalgetToolAttributes— Attributes for tool definitions
Context Propagation#
Track metadata across your traces with context setters:
setSession— Group multi-turn conversations with a session IDsetUser— Track conversations by user IDsetMetadata— Add custom metadata for operational needssetTags— Add tags for filtering spanssetPromptTemplate— Track prompt templates, versions, and variables
Framework Instrumentors#
Install additional packages to auto-instrument popular AI frameworks:
@arizeai/phoenix-mcp#
Model Context Protocol (MCP) server for Phoenix. Provides access to prompts, datasets, and experiments through the MCP standard for integration with Claude Desktop, Cursor, and other MCP-compatible tools.
- Prompts management — Create, list, update, and iterate on prompts
- Datasets — Explore datasets and synthesize new examples
- Experiments — Pull experiment results and visualize them
- MCP compatible — Works with Claude Desktop, Cursor, and other MCP clients
@arizeai/phoenix-cli#
Command-line interface for retrieving trace data from Phoenix projects. Fetch, debug, and analyze traces directly from your terminal or integrate with AI coding assistants.
- Immediate debugging — Fetch recent traces with a single command
- Bulk export — Export traces to JSON files for analysis or datasets
- Pipeline friendly — Pipe output to
jqor other Unix utilities - AI assistant integration — Feed traces to coding agents for automated analysis

