The Vercel AI SDK provides a consistent API for interacting with various AI providers.Gentrace integrates seamlessly to provide automatic tracing and error analysis for your AI application.
The AI SDK natively exports to OpenTelemetry, and Gentrace can consume this telemetry automatically.To enable telemetry, set the experimental_telemetry flag to true in your AI SDK calls.For example:
The AI SDK call must be inside the callstack of an interaction for Gentrace to capture the trace.
Copy
Ask AI
const { text } = await generateText({ // Enable telemetry experimental_telemetry: { isEnabled: true, }, model: openai("gpt-4.1-nano"), prompt: `Write a haiku about ${topic}`,});