TypeScript SDK
Official Claix TypeScript client
Endpoint
npm install claix-aiThe npm package claix-ai exposes ClaixClient with the same call map as the Python SDK. The primary calls are client.retrieve.ask (live, allowlisted reads) and client.guard.check (allow or deny for INSERT, UPDATE, and DELETE). Ingest stays on the same client. The client is async (Node.js 18+).
TypeScript CrewAI tools use @crewai-ts/core (claix-ai/crewai). The official Python CrewAI runtime stays on pip install 'claix-ai[crewai]'.
1. Install
npm install claix-ai npm install claix-ai @langchain/core zod npm install claix-ai @crewai-ts/core npm install claix-ai llamaindex
The API key comes from CLAIX_API_KEY or the constructor (apiKey). The client sends x-api-key.
2. Quickstart
import { ClaixClient } from "claix-ai";
const client = new ClaixClient();
const answers = await client.retrieve.ask("orders-agent", [
{ question: "How many orders are confirmed?", format: "int" },
]);
const decision = await client.guard.check(
"UPDATE orders SET discount = $1 WHERE id = $2",
{ params: [0.35, 90421] },
);
console.log(answers.ia_response, decision.allowed, decision.reason);3. Method map
| Method | HTTP |
|---|---|
| client.retrieve.ask(agentName, questions) | POST /retrieve/{agent_name} |
| client.guard.check(sql, { params, connectionId }) | POST /check-sql |
| client.extract.pdf / excel / document / image / audio / text | POST /api/*-json o POST /agent/*-json |
| client.extract.jsonToExcel({ schemaId, data }) | POST /api/json-excel |
| client.context.get / ask / delete | GET /get-document, POST /document-context, DELETE /delete-document |
| client.context.replace(documentId, newContentDocumentId) | POST /replace-document |
| client.spaces.create / add / ask / removeDocument / delete | create-space, add-space, space-context, remove-document-from-space, delete-space |
| client.schemas.list / get / create / update / delete | GET /api/schemas, GET /api/get-schema, POST /api/create-schema, PUT /api/update-schema, POST /api/delete-schema |
Retrieve accepts string, int, boolean, timestamp, timestamptz, timestampz, date, json, array, array:string, and array:int. Document and space questions stay string, int, boolean, timestamp, or array. A Guard denial is still HTTP 200. Pass connectionId only when the account has more than one active connection.