Compute
Use the TypeScript client
What the released TypeScript client gives you: typed request objects, bounded responses, per-operation errors, result verification, and a safe way to await a terminal job state.
Before you install
This page prints no package name. The released package, its version and the runtimes it is tested against move with each release, so they are published on the compatibility matrix instead.
Your base URL and current API version appear in the portal under developer settings, and in the API description you download.
Install the client release that matches the contract release you intend to call. A newer client speaks an older release only where the matrix says so.
Call through the released namespaces
The client mirrors the API namespaces, so the call site tells you which authority it needs.
lithi.work.quote / run / batch / status / result
lithi.data.sources / destinations
lithi.workflows.profiles / rubrics
lithi.identities / api_keys / approvals / spend
lithi.finance.statements / invoices / payments / reconciliation
Work submission lives under lithi.work. Everything administrative lives elsewhere, and a work key cannot reach it.
Narrow the type before you read a field
Every response is an envelope. Branch on its typed state before you touch a payload field, and let the compiler prove you did.
const status = await lithi.work.status({ job_id });
switch (status.state) {
case "SUCCEEDED":
case "PARTIAL":
return readResult(job_id);
case "FAILED":
case "CANCELLED":
return report(status.next_action);
default:
return pollAgain(status.valid_until);
}
Never widen the response to any to reach a field early. A field you cannot type is a field the state does not carry yet.
Handle errors by class, not by status code
There is no single global error table. Every operation carries its own generated error_schema, so generate error types per operation.
Four refusal classes must stay distinct in your code.
EDGE_ABUSE_LIMITED— the perimeter is shedding load.CANONICAL_ADMISSION_LIMITED— the key or account is not authorized for that request.CANONICAL_BUDGET_EXHAUSTED— spend or reservation authority is exhausted.CELL_CAPACITY_UNAVAILABLE— current capacity is unavailable.
Collapsing all four into one retry branch will retry the two that no retry can fix. Each refusal carries a safe reason and a non-empty next action; branch on that.
Verify the result before you use it
Read result-manifest.json first. It is written last, and it is the only complete-bundle marker.
Compare the digests in provenance.json against the input you submitted. Namespaced columns arrive on tabular output as lithi_status, lithi_result, lithi_error_code, lithi_confidence, lithi_evidence, lithi_verification and lithi_usage.
Await a terminal state safely
Terminal states are SUCCEEDED, PARTIAL, FAILED and CANCELLED. Anything else means keep waiting.
Poll on valid_until rather than a fixed interval you chose. A read past its valid_until is stale, whatever your timer says.
Confirm what your version supports on the client compatibility matrix, and read how job status and events behave before you write a polling loop.