@x12i/tools-hub-llm-api-pricing-margin-calculator
v1.0.0
Published
Multi-Model LLM API Pricing & Margin Calculator: engine, dataset, presets, router rules and page view.
Readme
@x12i/tools-hub-llm-api-pricing-margin-calculator
Multi-Model LLM API Pricing & Margin Calculator: engine, dataset, presets, router rules and page view.
Part of the x12i Tools Hub. The engine has no React dependency; only the /view entry (the result area of the web page) needs react and @x12i/tools-hub-ui-kit.
Install
npm install @x12i/tools-hub-llm-api-pricing-margin-calculator @x12i/tools-hub-calc-kitUse
import { executeTool } from "@x12i/tools-hub-calc-kit";
import { tool } from "@x12i/tools-hub-llm-api-pricing-margin-calculator";
// An empty input uses every field's default; `tool.fields` lists the inputs, ranges and defaults.
const out = executeTool(tool, { input: {} }, { dataset: tool.dataset.latest });
if (out.ok) console.log(out.core.result, out.core.warnings);
else console.error(out.code, out.field, out.message);Page view: import { view } from "@x12i/tools-hub-llm-api-pricing-margin-calculator/view"; (render it with ToolPage from @x12i/tools-hub-ui-kit).
