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.
Auth: Authorization: Bearer msp_live_...
Proxy (OpenAI-compatible)
/proxy/v1/chat/completions Route and execute a chat completion. Accepts any OpenAI-compatible body. Returns OpenAI-compatible response with routing metadata in headers.
/proxy/v1/embeddings Route embedding requests to the cheapest capable provider.
Routing
/v1/route Classify a prompt and return the routing decision + projected cost without executing.
/v1/execute Route and execute with the selected provider. Returns response + actual cost metadata.
Analytics
/v1/analytics/summary Aggregate routing spend and savings for the tenant.
/v1/analytics/export Trigger a CSV export of routing data for a given date range.
Experiments
/v1/experiments List all configured A/B routing experiments.
/v1/experiments Create a new routing experiment.
/v1/experiments/:id Get experiment results and statistical significance.
Policy
/v1/policy Get the active policy configuration for the tenant.
/v1/policy Update the policy configuration (YAML body).
/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 →