One client. Any lane.
A typed client for the SONICORE fabric, with the transport behind an interface you never name — so the same code drives a hosted deployment, a worker on your own machine, or a fabric inside your process.
Instead of choosing a model and managing prompts, teams define the outcome. subsix.ai plans the work, assembles a specialized AI workforce, selects the right models and compute, executes the mission, verifies the result and continuously learns from the organization.
@sonicore/sdk 0.1.0 · Apache-2.0 · 13 callsThe client is the protocol
Every method is a call on the protocol and nothing more. No retries, no backoff, no second copy of the server's rules to drift from the first.
Absence is a value
Cost, timing and every rate carry their presence flag. A missing measure is null and the caller decides how to say unknown — never a zero nobody measured.
A refusal is an answer
A refused call comes back as a value with its reason, so a worker learns it lost a claim instead of discovering it through an exception.
Install
npm install @sonicore/sdk
The Go SDK is the same surface over the same wire format: sonicore.ai/sonicore/sdk/go. Both clients speak to one protocol, so a service written in either can submit work to, and read the account of, the same fabric.
Nothing to install if you only want models: the gateway at /v1 speaks the OpenAI wire format and takes your existing client, with the base URL and the key swapped.
The calls
The 13 names below are read from the SDK's own method table at build time, not typed onto this page: a client that cannot call one of them does not compile.
AdoptMissionAccountRegisterHeartbeatOfferReportDrainFleetStateDeclarePublishFetchSubscribeA refusal carries one of lease_lost, fenced, not_holder, duplicate, no_capacity, no_slots, bad_registration, unknown_worker, stale_incarnation, no_evidence. None of them is an exception: they are answers.
Quickstart
A host lane reads a mission's account — and prints unknown when a measure is missing, rather than a number it would have had to invent.
import { Fabric, ConnectTransport, headline, unknownReason } from "@sonicore/sdk";
// One client, and a transport behind it. The lane is the only line that changes.
const fabric = new Fabric(new ConnectTransport({ baseUrl: "https://subsix.ai" }));
const account = await fabric.account("mission-124");
const figure = headline(account);
// Absence is a value: a rate nobody measured comes back null, and the caller says so.
console.log(
figure
? `${figure.microPerVerified} micro$ / verified unit`
: `UNKNOWN: ${unknownReason(account)}`,
);The same client on a local lane:
import { Fabric, StdioTransport } from "@sonicore/sdk";
// A worker on this host talks to the same fabric over stdio. Nothing else changes —
// that is the property the transport seam exists to give.
const fabric = new Fabric(new StdioTransport({ input: process.stdin, output: process.stdout }));
console.log(fabric.explain()); // "stdio"Writing a worker
A worker registers with the locality of its own machine, then beats. The beat answers with refused when the fabric has already given the claim to somebody else, so a fenced worker stops rather than finishing work nobody will accept.
import { Fabric, StdioTransport, Locality } from "@sonicore/sdk";
const fabric = new Fabric(new StdioTransport({ input: process.stdin, output: process.stdout }));
// The locality is required and has no default: it is a property of the machine, not a request.
await fabric.register({ workerId, locality: Locality.Local, capabilities: ["build"] });
// Heartbeat returns the answer whole — the interesting half is `refused`, so a worker
// never keeps running work under a claim the fabric has already given away.
const beat = await fabric.heartbeat({ workerId, fenceToken });
if (beat.refused) process.exit(0);Or without the SDK
Chat, completions and streaming need no SDK: the gateway is OpenAI-compatible, what your account is charged for is metered per call, and the spend cap you set is enforced before the next one.
# Anything that already speaks the OpenAI wire format needs no SDK at all.
curl https://subsix.ai/v1/chat/completions \
-H "Authorization: Bearer $SUBSIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o","messages":[{"role":"user","content":"Say hello."}],"max_tokens":16}'Where it runs
In your process
Everything runs on your machine against your own provider keys. No account, no server, nothing metered.
The extensionOn our hosts
The hosted lane: projects, one credit balance across every provider, every call metered to the token.
PricingYour own fleet
A fabric you run, with workers that declare their locality and are fenced by the server rather than by the client.
The protocol