Vercel AI SDK Integration
VoltAgent now works framework-agnostic and provides direct integration with Vercel AI SDK. This allows you to add observability to your existing Vercel AI applications with minimal changes.

Installation
First, install the required packages:
- npm
- pnpm
- yarn
npm install @voltagent/vercel-ai-exporter @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node
pnpm add @voltagent/vercel-ai-exporter @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node
yarn add @voltagent/vercel-ai-exporter @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node
Configuration
Get Your API Keys
You'll need to get your API keys from VoltOps LLM Observability Platform:
- Sign up at console.voltagent.dev
- Create an organization for your team/company
- Create a project within your organization
- Get your keys from the project settings:
VOLTAGENT_PUBLIC_KEY- For client identificationVOLTAGENT_SECRET_KEY- For secure server communication
Setup VoltAgent Exporter
Set up VoltAgent exporter in your application (typically in your main file):
import { VoltAgentExporter } from "@voltagent/vercel-ai-exporter";
import { NodeSDK } from "@opentelemetry/sdk-node";
import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node";
// Create VoltAgent exporter
const voltAgentExporter = new VoltAgentExporter({
publicKey: process.env.VOLTAGENT_PUBLIC_KEY,
secretKey: process.env.VOLTAGENT_SECRET_KEY,
baseUrl: "https://api.voltagent.dev", // default
debug: true, // set to true for development
});
// Initialize OpenTelemetry SDK
const sdk = new NodeSDK({
traceExporter: voltAgentExporter,
instrumentations: [getNodeAutoInstrumentations()],
});
sdk.start();
Basic Telemetry
Start with the minimal setup - just enable telemetry in your existing Vercel AI calls:
import { generateText } from "ai";
const result = await generateText({
model: "openai/gpt-4o-mini",
prompt: "Hello, how are you?",
experimental_telemetry: {
isEnabled: true,
// That's it! VoltAgent will track this with a default agent
},
});
console.log("Assistant:", result.text);

✅ What you get:
- AI calls tracked in VoltOps LLM Observability Platform
- Basic execution flow visibility
- All activities grouped under "ai-assistant" (default)
You'll see this helpful message
📋 VoltAgent: Using default agent for tracking.
💡 For better tracking, add agentId to your metadata:
experimental_telemetry: {
isEnabled: true,
metadata: { agentId: 'my-agent' }
}
This is completely normal! VoltAgent automatically uses a default agent when no agentId is provided. We'll show you how to customize this in the next sections.