Model & provider clients

The wired SDK clients for model providers and blob storage — the building blocks capture, replay, and attribution will consume.

Walkthrough — Model & provider clients

What it is

  • src/lib/anthropic.ts — the Anthropic SDK client plus countTokens from @anthropic-ai/tokenizer.
  • src/lib/openrouter.ts — OpenRouter via the OpenAI-compatible SDK, with referer/title headers.
  • src/lib/blob.ts — Vercel Blob put / del / head / list re-exports.

One module per provider. New providers each get their own src/lib/<provider>.ts — there is never a second client for the same provider.

What's next — BYOK-aware resolution

The customer's keys stay the customer's

Per the pure-BYOK pricing model, calls must use the customer's key, never a platform key. Today the clients read platform env vars; this must become per-tenant key resolution before any customer-facing use. The BYOK rework is also a forensic property — BYOK signing keys are what make per-tenant tamper-evidence possible.

Why it matters

These are the substrate for the capabilities users will actually run — replay, attribution, model-version diffing — and for evidence-bundle storage. Pillar work imports these clients rather than instantiating its own.

Last updated