Skip to main content

Core Client - TypeScript SDK

Overview​

Available Operations​

MethodDescription
client.me()Read the current authenticated identity.
client.request(method, path, options?)Send an advanced authenticated JSON request.
client.requestRaw(method, path, options?)Send an advanced authenticated text or file request.
client.getToken()Ensure authentication and return the current bearer token.
client.close()Release client-owned resources.

client.me​

Read the current authenticated identity.

Request​

This method has no parameters and sends no request body.

Response​

Identity object from /api/v1/auth/me.

client.request​

Send an advanced authenticated JSON request.

Request​

method, path; optional json, params, timeout.

Response​

Complete {code, message, errorCode, details, data} envelope.

client.requestRaw​

Send an advanced authenticated text or file request.

Request​

method, path; optional json, params, timeout.

Response​

Fetch Response; caller chooses text, bytes, or streaming access.

client.getToken​

Ensure authentication and return the current bearer token.

Request​

This method has no parameters and sends no request body.

Response​

Promise<string>. Treat as a secret.

client.close​

Release client-owned resources.

Request​

This method has no parameters and sends no request body.

Response​

void.

Field Reference and Examples​

const me = await client.me();
const envelope = await client.request("GET", "/api/v1/models", {
params: { page: 1 },
});
const raw = await client.requestRaw("GET", "/api/v1/services/42/yaml");
const yaml = await raw.text();
const token = await client.getToken();
client.close();

Use resource methods for normal integrations. The generic request methods are for forward-compatible access to an endpoint that is not yet part of the curated public SDK surface.

All methods use the shared authentication and typed error behavior described in Response Conventions and Retry and Security.