Vercel AI SDK
Vercel AI SDK is a TypeScript toolkit for building AI applications. SideSeat captures traces from generateText, streamText, and other AI SDK calls via OpenTelemetry.
Prerequisites
Section titled “Prerequisites”- SideSeat running locally (
sideseat) - Node.js 18+
- AWS credentials configured for Amazon Bedrock, or another supported provider
Quick Start
Section titled “Quick Start”-
Start SideSeat
Terminal window npx sideseat -
Install dependencies
Terminal window npm install @sideseat/sdk ai @ai-sdk/otel @ai-sdk/amazon-bedrock -
Add telemetry
import { init, Frameworks } from '@sideseat/sdk';import { generateText, registerTelemetry } from 'ai';import { LegacyOpenTelemetry } from '@ai-sdk/otel';import { bedrock } from '@ai-sdk/amazon-bedrock';init({ framework: Frameworks.VercelAI });// AI SDK 7 delivers telemetry only to registered integrations - it no longer// creates OpenTelemetry spans itself. Register after init(): the integration// captures a tracer in its constructor.registerTelemetry(new LegacyOpenTelemetry());const { text } = await generateText({model: bedrock('us.anthropic.claude-sonnet-4-5-20250929-v1:0'),prompt: 'What is the capital of France?',experimental_telemetry: { isEnabled: true },});console.log(text); -
View runs
Open http://localhost:5388 to see your runs.
Without SideSeat SDK
Section titled “Without SideSeat SDK”-
Start SideSeat
Terminal window npx sideseat -
Set the endpoint
Terminal window export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:5388/otel/default -
Install dependencies
Terminal window npm install @opentelemetry/sdk-node @opentelemetry/exporter-trace-otlp-http ai @ai-sdk/otel @ai-sdk/amazon-bedrock -
Add telemetry
import { NodeSDK } from '@opentelemetry/sdk-node';import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';import { generateText, registerTelemetry } from 'ai';import { LegacyOpenTelemetry } from '@ai-sdk/otel';import { bedrock } from '@ai-sdk/amazon-bedrock';const sdk = new NodeSDK({ traceExporter: new OTLPTraceExporter() });sdk.start();// Required on AI SDK 7: the ai package emits no spans itself. Must come after// sdk.start(), since the integration captures a tracer in its constructor.registerTelemetry(new LegacyOpenTelemetry());const { text } = await generateText({model: bedrock('us.anthropic.claude-sonnet-4-5-20250929-v1:0'),prompt: 'What is the capital of France?',experimental_telemetry: { isEnabled: true },});console.log(text); -
View runs
Open http://localhost:5388 to see your runs.
What You’ll See
Section titled “What You’ll See”SideSeat shows each generateText/streamText call with the model name, token counts, prompt messages, and the full response. Tool calls appear as child spans.
Streaming
Section titled “Streaming”These snippets assume registerTelemetry(new LegacyOpenTelemetry()) has already run
once at startup, as in the Quick Start above. Without it isEnabled: true emits nothing.
import { init, Frameworks } from '@sideseat/sdk';import { streamText } from 'ai';import { bedrock } from '@ai-sdk/amazon-bedrock';
init({ framework: Frameworks.VercelAI });
const result = streamText({ model: bedrock('us.anthropic.claude-sonnet-4-5-20250929-v1:0'), prompt: 'Tell me a story', experimental_telemetry: { isEnabled: true },});
for await (const chunk of result.textStream) { process.stdout.write(chunk);}Tool Calls
Section titled “Tool Calls”These snippets assume registerTelemetry(new LegacyOpenTelemetry()) has already run
once at startup, as in the Quick Start above. Without it isEnabled: true emits nothing.
import { init, Frameworks } from '@sideseat/sdk';import { generateText, tool } from 'ai';import { bedrock } from '@ai-sdk/amazon-bedrock';import { z } from 'zod';
init({ framework: Frameworks.VercelAI });
const { text } = await generateText({ model: bedrock('us.anthropic.claude-sonnet-4-5-20250929-v1:0'), prompt: 'What is the weather in Paris?', tools: { getWeather: tool({ description: 'Get weather for a location', inputSchema: z.object({ location: z.string() }), execute: async ({ location }) => `Sunny in ${location}`, }), }, experimental_telemetry: { isEnabled: true },});Next Steps
Section titled “Next Steps”- TypeScript SDK — SDK reference
- Core Concepts — understanding runs, steps, and messages