Skip to content

Interface: ApiResponse

@kortexya/reasoninglayer


@kortexya/reasoninglayer / ApiResponse

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

Generic API response wrapper providing access to response metadata.

⚠️ 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.

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;
},
],
});

T

data: T

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

The parsed response body.


headers: Headers

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

Raw response headers.


rateLimit: RateLimitInfo | null

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

Rate limit information parsed from response headers, or null if not present.


status: number

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

HTTP status code.