# Namespaces

> The full set of operation groups on the Client SDK.

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

## User

`client.user` — the signed-in user's account surface.

| Sub-namespace | Methods | Purpose |
|---------------|---------|---------|
| `user.balance` | `get()` | Current wallet balance. |
| `user.payment` | `listMethods()`, `deposit(body)`, `getTransactions(range?)` | Payment methods and history. |
| `user.preferences.audio` | `get()`, `update(prefs)` | Audio tool preferences. |
| `user.savedReleases` | `get()`, `add(releaseId)`, `remove(releaseId)` | Bookmarked Releases. |

```typescript
const balance = await client.user.balance.get();
await client.user.savedReleases.add("rel_abc123");
```

## API keys

`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)`.

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

## BYOK (bring your own 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)`.

## Audio

`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.

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

## Arena

`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](/server/arena) for the full conceptual model.

## Fine-tune

`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`).

## Style patterns

`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.

## Notifications

`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.

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

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

## Analytics & Metrics

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

## Public / gated chat

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](/embed/overview) and Divinci's own landing pages.
