A minimal Vercel AI SDK v7 agent traced with
@arizeai/phoenix-otel. Importing instrumentation.ts
registers Phoenix telemetry; agent.ts then runs a
ToolLoopAgent with a single weather tool — the agent span, each LLM step,
and the tool call all show up as one trace in Phoenix.
| Vercel AI SDK | @arizeai/phoenix-otel |
|---|---|
| v7+ | 2.x (this example) |
| v6 and older | 1.x |
AI SDK v7 requires Node.js 22.12 or newer.
- Node.js >= 22.12
- A running Phoenix instance (defaults to
http://localhost:6006) OPENAI_API_KEYset in your environment
# From the js/ directory
pnpm install
# Build the workspace-linked @arizeai/phoenix-otel package
pnpm --filter @arizeai/phoenix-otel build
export OPENAI_API_KEY=sk-...
pnpm --filter ai-sdk-agent startOpen http://localhost:6006 to see the trace in the
ai-sdk-agent project.
| Environment variable | Description | Default |
|---|---|---|
OPENAI_API_KEY |
OpenAI API key | required |
PHOENIX_COLLECTOR_ENDPOINT |
Phoenix OTLP endpoint | http://localhost:6006 |
PHOENIX_API_KEY |
Phoenix API key (if auth is enabled) | none |