TypeScript SDK
Official Claix TypeScript client
Endpoint
NPM
npm install claix-aiThe npm package claix-ai exposes ClaixClient with the same call map as the Python SDK: extraction, schemas, context window, and knowledge spaces. 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 result = await client.extract.pdf("invoice.pdf", "3c7a9f21-4b8e-4d1a-9c6f-2e0d8a5b7c4f");
const answers = await client.context.ask(String(result.document_id), [
{ question: "What is the total?", format: "int" },
]);3. Method map
| Method | HTTP |
|---|---|
| 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 |
A string question is sent as format "string". You can also pass { question, format } with string, int, boolean, timestamp, or array.