Skip to main content
API Reference

ModelSpend API

The ModelSpend API is OpenAI-compatible for the proxy endpoint and uses a standard REST format for management APIs. All requests require a bearer token.

Base URL: https://api.modelspend.best
Auth: Authorization: Bearer msp_live_...

Proxy (OpenAI-compatible)

Core
POST /proxy/v1/chat/completions

Route and execute a chat completion. Accepts any OpenAI-compatible body. Returns OpenAI-compatible response with routing metadata in headers.

POST /proxy/v1/embeddings

Route embedding requests to the cheapest capable provider.

Routing

v1
POST /v1/route

Classify a prompt and return the routing decision + projected cost without executing.

POST /v1/execute

Route and execute with the selected provider. Returns response + actual cost metadata.

Analytics

v1
GET /v1/analytics/summary

Aggregate routing spend and savings for the tenant.

POST /v1/analytics/export

Trigger a CSV export of routing data for a given date range.

Experiments

v1
GET /v1/experiments

List all configured A/B routing experiments.

POST /v1/experiments

Create a new routing experiment.

GET /v1/experiments/:id

Get experiment results and statistical significance.

Policy

v1
GET /v1/policy

Get the active policy configuration for the tenant.

PUT /v1/policy

Update the policy configuration (YAML body).

POST /v1/policy/simulate

Simulate a policy against historical request samples without applying it.

Full API docs in the dashboard

The interactive API reference with request/response schemas, authentication, and rate limit details is available in your ModelSpend dashboard.

Open dashboard →
Founding Beta: Limited Access
Help shape the future of AI spend control.
ends 29 August 2026
Spots are limited.
Secure your early access.
Request Access →