Official TypeScript/Node SDK for MUXI — infrastructure for AI agents.
Highlights
- Fetch-based HTTP transport (Node 18+), automatic idempotency, SDK/client headers
- Formation client/admin key auth; server HMAC auth
- SSE helpers for chat/audio streams and deploy/log tails
- Retries on 429/5xx/connection errors with exponential backoff
npm install @muxi-ai/muxi-typescriptimport { ServerClient } from "@muxi-ai/muxi-typescript";
const server = new ServerClient({
url: "https://server.example.com",
keyId: process.env.MUXI_KEY_ID!,
secretKey: process.env.MUXI_SECRET_KEY!,
});
console.log(await server.status());import { FormationClient } from "@muxi-ai/muxi-typescript";
const formation = new FormationClient({
serverUrl: "https://server.example.com",
formationId: "your-formation",
clientKey: process.env.MUXI_CLIENT_KEY!,
adminKey: process.env.MUXI_ADMIN_KEY!,
});
console.log(await formation.health());
// Streaming chat (SSE)
for await (const evt of formation.chatStream({ message: "hello" })) {
console.log(evt);
break;
}- Default:
serverUrl + /api/{formationId}/v1 - Override: set
baseUrl(e.g.,http://localhost:9012/v1for direct formation)
- Server: HMAC with
keyId/secretKeyon/rpc/*calls. - Formation:
X-MUXI-CLIENT-KEYorX-MUXI-ADMIN-KEY; optionalX-Muxi-User-IDviauserIdparam. - Idempotency:
X-Muxi-Idempotency-Keyauto-generated on every request. - SDK/Client headers set automatically (
X-Muxi-SDK,X-Muxi-Client).
- Chat/audio:
chatStream/audioChatStreamreturn async generators of SSE events. - Deploy/log streams:
deployFormationStream,updateFormationStream,streamFormationLogs, etc.