API Reference
Client
ZeroLeaks client construction, authentication, transport options, health, and capabilities.
new ZeroLeaks(options?)
interface ZeroLeaksOptions {
apiKey?: string;
baseUrl?: string;
timeoutMs?: number;
fetch?: typeof globalThis.fetch;
}Defaults:
apiKey:process.env.ZEROLEAKS_API_KEYbaseUrl:https://zeroleaks.aitimeoutMs: 30 seconds per HTTP requestfetch: the runtime's globalfetch
const zeroleaks = new ZeroLeaks({
apiKey: process.env.ZEROLEAKS_API_KEY,
timeoutMs: 60_000,
});createZeroLeaks(options?) is an equivalent factory.
The constructor throws a ZeroLeaksError with code MISSING_API_KEY when no key is available and INVALID_API_KEY when the key does not start with zl_live_. Every request sends an X-ZeroLeaks-SDK: typescript/<version> header.
Discovery
await zeroleaks.health.check();
await zeroleaks.capabilities.get();These methods do not require authentication. capabilities.get() returns supported scan modes, target models, reasoning efforts, knowledge profiles, attack surfaces, adapters, and API limits.