@mapleflow/sdk
v0.18.1
Published
Official TypeScript SDK for the MapleFlow API platform — auto-generated from OpenAPI spec
Maintainers
Readme
@mapleflow/sdk
Official TypeScript SDK for the MapleFlow API platform. Auto-generated from OpenAPI spec using Hey API.
Install
npm install @mapleflow/sdkQuick Start
import { createClient } from "@mapleflow/sdk";
import { postAiChat, getWeather, postTranslate, getAccount } from "@mapleflow/sdk";
const client = createClient({
baseUrl: "https://mapleflow.io",
headers: { "X-API-Key": "sk_live_..." },
});
// AI Chat (2 credits)
const chat = await postAiChat({
client,
body: {
messages: [{ role: "user", content: "What is the capital of France?" }],
model: "fast",
},
});
// Translate (1 credit)
const translation = await postTranslate({
client,
body: { text: "Hello!", to: "es" },
});
// Weather (1 credit)
const weather = await getWeather({
client,
query: { location: "Toronto" },
});
// Check balance
const account = await getAccount({ client });Regenerate SDK
npm run generateThis reads ../../src/openapi.json and regenerates all types + SDK functions.
License
MIT
