Interface: ApiResponse
@kortexya/reasoninglayer / ApiResponse
Interface: ApiResponse<T>
Section titled “Interface: ApiResponse<T>”Defined in: src/types/common.ts:30
Generic API response wrapper providing access to response metadata.
Remarks
Section titled “Remarks”⚠️ No resource method returns this. Every resource method resolves to the
parsed body alone. This shape is what HttpClient.requestWithMetadata
answers, and nothing in the SDK calls that either — a planned
.withMetadata() accessor was documented here and never built.
To read a successful response’s status, headers or rate-limit budget, use a
Interceptor: it wraps every request the client makes. On a FAILURE,
ApiError already carries status and headers directly.
Example
Section titled “Example”const client = new ReasoningLayerClient({ baseUrl, tenantId, auth: { mode: 'cookie' }, interceptors: [ async (request, next) => { const response = await next(request); console.log(response.status, response.headers.get('x-ratelimit-remaining')); return response; }, ],});Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”data:
T
Defined in: src/types/common.ts:32
The parsed response body.
headers
Section titled “headers”headers:
Headers
Defined in: src/types/common.ts:36
Raw response headers.
rateLimit
Section titled “rateLimit”rateLimit:
RateLimitInfo|null
Defined in: src/types/common.ts:38
Rate limit information parsed from response headers, or null if not present.
status
Section titled “status”status:
number
Defined in: src/types/common.ts:34
HTTP status code.