API key
apiKey always wins. If omitted, the SDK reads EIGENPAL_API_KEY from the environment. If neither is set, the constructor throws.
Issue keys from the dashboard under Settings → API Keys. Keep them in env vars or a secret manager; never check them into git.
Self-hosted
Point at your own deployment viabaseUrl:
baseUrl overrides EIGENPAL_BASE_URL. Defaults to https://studio.eigenpal.com.
Timeouts
timeoutMs applies per-request. The per-call signal (an AbortSignal) wins if you pass one.
For runs longer than timeoutMs, start asynchronously with client.run(...) and poll client.runs.get(id). Use client.run(..., { waitForCompletion }) only when you want the server to hold the request briefly.
Custom headers
defaultHeaders is merged into every outgoing request. Useful for tracing, custom user-agent suffixes, or anything else your infrastructure needs:
Custom fetch
Inject a mock or alternative HTTP client for testing:TypeScript runtime
The package ships TypeScript source (./src/index.ts is the entry point). You will need a TypeScript-aware runtime: Bun, Deno, Node + ts-node / tsx, Next.js, Vite, Webpack with ts-loader, or any modern bundler. Plain node ./script.js will not load it. The package ships TS-first so the source stays debuggable end-to-end.