Observability SDKs for AI agents — runs, events, costs, latency. Powers jenz.dev.
@jenz-ai/sdk— core HTTP client (JenzClient,Run,Event)@jenz-ai/vercel-ai— zero-config wrapper for the Vercel AI SDK- (more adapters coming: OpenAI Agents SDK, Claude Agent SDK)
import { openai } from '@ai-sdk/openai';
import { generateText } from 'ai';
import { wrapModel } from '@jenz-ai/vercel-ai';
const model = wrapModel(openai('gpt-4o'), {
agentName: 'seo-agent',
agentType: 'scheduled',
});
await generateText({ model, prompt: 'Write a tagline' });That's it — runs, LLM calls, tokens, cost, and TTFT show up in real time on jenz.dev. Set JENZ_API_KEY in .env (get one at jenz.dev/api-keys).
Use withRun to group multiple LLM calls and tool calls under one run:
import { withRun, wrapModel, wrapTools } from '@jenz-ai/vercel-ai';
const model = wrapModel(openai('gpt-4o'), { agentName: 'research', agentType: 'scheduled' });
const tools = wrapTools({
search: { execute: async ({ q }) => fetch(`/api/search?q=${q}`).then(r => r.json()) },
});
await withRun({ agentName: 'research', agentType: 'scheduled' }, async () => {
const plan = await generateText({ model, prompt: 'Plan the research', tools });
const results = await generateText({ model, prompt: plan.text, tools });
return results.text;
});For agent loops not built on Vercel AI (raw openai/anthropic clients), use @jenz-ai/sdk directly:
import { JenzClient } from '@jenz-ai/sdk';
const jenz = new JenzClient();
const run = await jenz.startRun({ agentName: 'support-bot', agentType: 'triggered' });
if (!run) throw new Error('No run');
const evt = run.startEvent({ type: 'llm_call', model: 'claude-sonnet-4-6', provider: 'anthropic' });
const res = await callClaude(prompt);
await evt.finish({
inputTokens: res.usage.input_tokens,
outputTokens: res.usage.output_tokens,
cacheReadTokens: res.usage.cache_read_input_tokens,
cacheWriteTokens: res.usage.cache_creation_input_tokens,
});
await run.finish({ status: 'completed', output: res.text });pnpm install
pnpm typecheck
pnpm test
pnpm buildEach PR with user-visible changes should include a Changeset:
pnpm changesetPushing to main runs the Release workflow, which publishes to npm.
MIT