fetch and Web Crypto.
new Splox(apiKey?, { baseURL, fetch, maxRetries, timeoutMs }). baseURL is the
server API root and paths are appended already versioned (/v1/..., /v2/...),
so nothing is rewritten. Resources are client.runs, client.interactions,
client.harnesses, client.harnessVersions, client.llmEndpoints,
client.toolServers and client.mcp.
The first call
.raw, so a field the SDK does not map yet is still
reachable.
Reading a run
messageText joins a message’s text parts — the two empty lines are the tool call
and its result, which live in content as json parts. RunUsage maps
inputTokens, outputTokens, toolCalls, durationMs, amount, currency,
final and updatedAt; the token totals and the cache counters are on
usage.raw.
A Run is a handle: run.wait(), run.cancel(), run.reload(),
run.events(), run.messages(), run.outputs(), run.tree(), run.usage(),
run.pendingInteractions().
Creating a run
Streaming
Last-Event-ID, deduplicates by event id, and
finishes after the terminal run.status_changed. Pass stream: false to walk the
durable journal instead — same events, page by page, ending when you are caught
up.
Paging
A page is async-iterable and pages itself:page.data is the first page if you would rather hold the cursor yourself.
Errors
Every API error carries
statusCode, code, detail, traceId, problem and
responseBody. GETs retry up to three times (network, 408, 429, 5xx); POSTs
retry only when they carry an Idempotency-Key, always the same one.
Ids
harnessId parameters accept a raw UUID directly.
Harnesses
{ id, name, versions } and nothing else — the prose lives in the
files and the age is the commit. See Harnesses.
