TypeScript SDK
The official TypeScript client for the inference API, installed with npm and generated from the OpenAPI spec.
For authentication, resources, errors and the other shared concepts, see all SDKs.
Install
TypeScript, via npm (Node 18+):
npm install @akumi/sdk
Quickstart
import { Akumi } from "@akumi/sdk";
const akumi = Akumi.fromApiKey(process.env.AKUMI_API_KEY!);
const response = await akumi.chat.create({
model: "mistral/mistral-small-2603",
messages: [{ role: "user", content: "Summarize this contract." }],
});
Streaming
Call akumi.chat.createStreamed({...}) for a streamed variant of the chat call that returns an AsyncGenerator; iterate it with for await. Pass "stream": true in the request alongside it.
Source
The TypeScript SDK lives in its own repository and is generated, not hand-written. When the API changes, it is regenerated from the spec.
- TypeScript: https://github.com/akumi-cloud/ts-sdk