Vercel AI Instrumentor

Normalize Vercel AI SDK spans for Respan.
1import { Respan } from "@respan/respan";
2import { VercelAIInstrumentor } from "@respan/instrumentation-vercel";
3
4const respan = new Respan({
5 instrumentations: [new VercelAIInstrumentor()],
6});
7await respan.initialize();

Install

$npm install @respan/respan @respan/instrumentation-vercel ai @ai-sdk/openai

@respan/instrumentation-vercel enriches Vercel AI SDK spans with Respan and OpenInference-compatible attributes so traces render as first-class agent and LLM spans in the dashboard.

Example

1import { generateText } from "ai";
2import { openai } from "@ai-sdk/openai";
3import { VercelAIInstrumentor } from "@respan/instrumentation-vercel";
4import { Respan } from "@respan/respan";
5
6const respan = new Respan({
7 instrumentations: [new VercelAIInstrumentor()],
8});
9await respan.initialize();
10
11const result = await generateText({
12 model: openai("gpt-4.1-nano"),
13 prompt: "Tell me a joke about tracing.",
14 experimental_telemetry: {
15 isEnabled: true,
16 },
17});
18
19console.log(result.text);
20await respan.flush();