Skip to content

Interface: RequestOptions

@kortexya/reasoninglayer


@kortexya/reasoninglayer / RequestOptions

Defined in: src/types/common.ts:82

Per-call options that override client-level defaults.

Every resource method takes one as its last parameter, named requestOptions — options was taken, on nineteen methods that already had a domain options bag. The three overloaded ingestion methods are the exception: their per-call options ride in the sync bag they already take, because a third parameter appended to a signature overloaded on the second makes the one-argument overload incompatible with its implementation.

X-Tenant-Id is NOT overridable per-call. Changing tenants requires a separate client instance — a per-call tenant override is how data ends up in the wrong tenant.

timeoutMs and retries reach the transport through an SDK-internal sentinel header that the bridge strips (src/request-params.ts): the generated route classes take a RequestParams, which is Omit<RequestInit, …> and has no field for either.

// A forward chain over a large tenant, with a budget of its own.
await client.inference.forwardChain(request, { timeoutMs: 600_000, retries: 0 });
// One call as another user, without a second client.
await client.terms.listTerms(undefined, { userId: adminId });

optional authenticatedUser?: string

Defined in: src/types/common.ts:102

Override the attested user for this request (X-Authenticated-User header), as user:<uuid>. Defaults to ClientConfig.authenticatedUser.

The engine reads this header as the gateway-authenticated principal. An OSFQL AWAIT needs it (reasoninglayer#1256): the demon is registered as this user and fires with that user’s grants; a request without one is refused with refusal.code program_registrant_not_actor. Set it only where the deployment’s gateway does not set it for you, for example a trusted server that acts for several users.


optional cacheControl?: "no-cache" | "no-store"

Defined in: src/types/common.ts:84

Forward Cache-Control to ReasoningLayer. Both values bypass conversation answer-cache lookup and population.


optional causal?: AuditCausalHeaders

Defined in: src/types/common.ts:116

Causal assertions for the audit ledger, sent as the x-reasoninglayer-* request headers. See AuditCausalHeaders.


optional namespaceId?: string

Defined in: src/types/common.ts:86

Override the namespace for this request (X-Namespace-Id header).


optional retries?: number

Defined in: src/types/common.ts:111

Number of retry attempts for this request. Set to 0 to disable retries.


optional signal?: AbortSignal

Defined in: src/types/common.ts:104

AbortSignal for request cancellation.


optional timeoutMs?: number

Defined in: src/types/common.ts:109

Per-call timeout in milliseconds. Overrides the client-level timeoutMs default. 0 disables the client deadline for this call; a negative or non-finite value is refused.


optional userId?: string

Defined in: src/types/common.ts:88

Override the user ID for this request (X-User-Id header). Used for admin impersonation.