Instrument Vercel AI SDK
Recipe — instrument a Vercel AI SDK call to emit traces (via REST).
Last updated
Was this helpful?
Recipe — instrument a Vercel AI SDK call to emit traces (via REST).
When to use: Next.js or other Vercel AI SDK users.
Post traces via the REST API from your server route:
await fetch("https://stratix.layerlens.ai/api/v1/traces", {
method: "POST",
headers: { "X-API-Key": process.env.LAYERLENS_STRATIX_API_KEY!, "Content-Type": "application/json" },
body: JSON.stringify({ id, name: "ai-sdk-call", inputs, outputs, spans })
});Last updated
Was this helpful?
Was this helpful?