supascale-ai
v0.1.0
Published
Official TypeScript/JavaScript client for Supascale deployment inference (POST /api/v1/{deployment_id}/chat)
Readme
supascale-ai (TypeScript / JavaScript)
Minimal client for deployment chat — the same HTTP call as the dashboard Try it live button. Uses the global fetch (Node 18+, browsers, workers).
Install
From this monorepo:
npm install ./supascale-sdk/typescriptWhen published: npm install supascale-ai
Usage
import { Supascale } from "supascale-ai";
// Defaults on Node: SUPASCALE_API_KEY, SUPASCALE_DEPLOYMENT_ID, optional SUPASCALE_API_BASE
const client = new Supascale();
console.log(await client.chat("What are some fun things to do in New York?"));Or pass credentials explicitly:
const client = new Supascale({
apiKey: "YOUR_DEPLOYMENT_API_KEY",
deploymentId: "YOUR_DEPLOYMENT_ID",
baseUrl: "https://api.supascale.com",
});Environment variables (Node)
| Variable | Purpose |
|----------|---------|
| SUPASCALE_API_KEY | Deployment API key (Bearer token) |
| SUPASCALE_DEPLOYMENT_ID | Deployment UUID |
| SUPASCALE_API_BASE | API origin (default https://api.supascale.com) |
API
new Supascale(options?)— optional defaults from env on Node.client.chat(message, { deploymentId?, messages?, signal? })→Promise<string>
Sendsmessageplusmessages(defaults to one user turn) toPOST /api/v1/{id}/chatand returns theresponsefield.- Default timeout: 120s via
AbortSignal.timeoutwhensignalis not passed (environments that support it).
