PersonaClientOptions (re-exported as HttpClientOptions — they’re the same type). There is no
runtime reconfiguration: once a client is built, its base URL, credential, and identity are fixed
for its lifetime.
Options reference
Both
baseUrl and credential are validated synchronously at construction: passing an empty
or missing value throws a plain Error (HttpClient: "baseUrl" is required /
HttpClient: "credential" is required) before any network call is made. If no fetch
implementation is available (a runtime without global fetch and without the fetch option), the
constructor throws too.
Environment variables
The SDK does not read environment variables itself — configuration is explicit. The convention (used throughout the docs, the Integration Guide, and the SDK’s own tests) is:
You are free to use any names you like; the point is that the credential must come from an
environment variable or secret manager, never from source code or a client bundle.
Configuration scenarios
1. Control-plane client (Project-level)
Acts as the Project itself. Use for provisioning and administration: Providers, Agent/Skill/ Knowledge/MCP/Store configuration CRUD, audit logs,whoami().
2. Runtime-plane client (per end user)
Constructed per request, scoped to whoever is actually using your product right now — after your own auth has confirmed who that is. Required for Threads, Files, Memory, and Chat; makes Agent/Skill/Knowledge/MCP create/list calls act on that user’s behalf (scope: 'mine').
3. Bumping 429 retries
4. Custom fetch (tests, unusual runtimes)
Cost of construction
Constructing a client is cheap and stateless beyond these options — there’s no connection pool or warm-up step. It’s fine (and recommended) to construct a fresh, per-request runtime-plane client rather than trying to share one instance across users, which would mix identities. A single control-plane client per process is fine to share.How each option flows into a request
Every request the SDK makes is assembled from these options:maxRetries times (see
Behavior & edge cases); everything else throws
immediately. There is no other header customization surface — if you need to send custom headers
for an endpoint the SDK doesn’t wrap yet, use the HttpClient escape
hatch directly.