Skip to content

Namespaces

Copy page

Beyond chat, streaming, realtime, and RAG, the client exposes several more namespaces. Each is lazily initialized — accessing client.user, for example, constructs that namespace on first use.

client.user — the signed-in user’s account surface.

Sub-namespaceMethodsPurpose
user.balanceget()Current wallet balance.
user.paymentlistMethods(), deposit(body), getTransactions(range?)Payment methods and history.
user.preferences.audioget(), update(prefs)Audio tool preferences.
user.savedReleasesget(), add(releaseId), remove(releaseId)Bookmarked Releases.
const balance = await client.user.balance.get();
await client.user.savedReleases.add("rel_abc123");

client.apiKeys — manage workspace-scoped API keys from the client.

create(params, body), list(params?), get(params), update(params, body), delete(params), rotate(params), listUsers(params).

const created = await client.apiKeys.create({ workspaceId: "ws_123" }, { name: "CI key" });

client.byok — register and rotate your own model-provider credentials.

create(params, body), list(params?), get(params), updateMeta(params, body), rotate(params, body), delete(params).

client.audio — upload and manage audio transcripts, and turn them into RAG or fine-tune material.

Top-level: upload, uploadFromUrl, list, get, update, generateRagFile, generateFineTuneFile, delete. Plus audio.voiceprints and audio.bulk sub-namespaces.

const transcript = await client.audio.uploadFromUrl(
{ workspaceId: "ws_123" },
{ url: "https://example.com/call.mp3" },
);

client.arena — model A/B comparison. Enable/disable, fetch results, select chat/transcript variants, regenerate a variant, run tests, and estimate cost. Presets live under client.arena.presets. See the server Arena page for the full conceptual model.

client.fineTune — create and manage fine-tunes and their training files from the client. create, list, get, update, fork, delete, plus fineTune.files (upload, list, get, getContents, delete).

client.stylePattern — manage tone/style rewrite rules: list active and proposed rules, test a rewrite, approve/reject proposals, toggle rules, and read the audit log.

client.notifications — per-workspace notification feed.

list, get, markAsRead, setTags, getCounts, getTags, plus sub-namespaces: notes(...) for annotation, channels(...) for email/webhook delivery, triggers(...) for tag-routing rules, and flaggers(...) for custom LLM-driven notifications.

const counts = await client.notifications.getCounts({ workspaceId: "ws_123" });

See Notifications, Analytics & Metrics for the full custom-notification pipeline (flagger → trigger → channel), product analytics, and pipeline-metrics alerting.

client.analytics — product analytics (metrics, trends, experiments, funnel, trackEvents ingestion). client.metrics — pipeline telemetry + custom alert configs. Both documented on the observability page.

Two namespaces power unauthenticated, gated chat experiences:

  • client.homepageChat — Turnstile-gated email verification then send: verifyEmail(email, turnstileToken), confirmEmail(email, code), send(prompt).
  • client.freeChatGate — the configurable free-chat gate (captcha / OTP / magic-link) with language support: start(args), verifyOtp(args), state(), send(prompt), submitFeedback(...), plus token and transcript helpers.

These back the Embed script and Divinci’s own landing pages.