Build AI workflows that are cost-aware, policy-aware and auditable.
ModelSpend gives developers a drop-in AI gateway for routing prompts to the right model, controlling spend, enforcing policy and keeping a clear record of what happened.
Use the OpenAI-compatible proxy to send requests through ModelSpend and let the routing layer choose the best capable model.
Apply budgets, policy checks and provider rules before expensive or unsuitable requests reach an upstream model.
Log model choice, provider, estimated cost, outcome, latency and failure conditions for reporting and governance.
How ModelSpend sits in your stack
Start with the quickstart
The fastest path is to create an API key, point your existing OpenAI-compatible SDK at ModelSpend, and make one routed request.
export MODELSPEND_API_KEY=msp_live_your_key_here
export MODELSPEND_BASE_URL=https://api.modelspend.best/proxy/v1
npm install @modelspend/sdk
Core documentation
Use the TypeScript SDK for typed chat completions, routing telemetry, timeouts, aborts and FinOps attribution.
API referenceBase URLs, proxy endpoints, request examples and response behaviour.
Routing conceptsHow prompts are classified, evaluated and routed by cost and capability.
PoliciesBudget limits, provider controls and guardrails for production AI usage.
SecurityRecommended key storage, tenant boundaries and safe integration patterns.
Framework guidesIntegrate ModelSpend with the Vercel AI SDK, LangChain, and LlamaIndex using copy-paste examples.