Security
Integrate ModelSpend with production-safe defaults.
ModelSpend sits in a sensitive part of the AI stack. Treat it like an infrastructure gateway: protect keys, minimise data exposure and keep audit trails useful.
Security principles
Protect API keys
Use environment variables, deployment secrets or a secrets manager. Never ship keys to frontend code.
Minimise prompt data
Send only the content needed for the task and avoid unnecessary sensitive data in prompts.
Use tenant policy
Restrict provider access, model tiers and budget exposure by environment or workflow.
Monitor usage
Review audit logs, anomalies, failures and unexpected provider routes.
Safe browser pattern
Browser Your backend ModelSpend AI provider
The browser should authenticate to your application. Your backend should authenticate to ModelSpend.
Public developer docs intentionally avoid private infrastructure details, deployment paths, environment names, tenant IDs and production secrets.