Integrate SDKs, export usage data, use model routing, and enable cache proxy endpoints.
Python
pip install costpilot import costpilot costpilot.init(api_key="cp_xxx")
Node.js
npm install costpilot
import { init } from 'costpilot';
init({ apiKey: 'cp_xxx' });/api/v1/eventsTrack Events
curl -X POST "$BASE/api/v1/events" \
-H "Authorization: Bearer cp_xxx" \
-H "Content-Type: application/json" \
-d '{"provider":"openai","model":"gpt-4o","prompt_tokens":1200,"completion_tokens":400}'/api/v1/export?format=csv&from=2026-03-01T00:00:00ZExport Logs (CSV)
curl -H "Authorization: Bearer cp_xxx" \ "$BASE/api/v1/export?format=csv&include_content=true" -o events.csv
/api/v1/route-modelRoute Model
curl -X POST "$BASE/api/v1/route-model" \
-H "Authorization: Bearer cp_xxx" \
-H "Content-Type: application/json" \
-d '{"objective":"balanced","estimatedPromptTokens":1200,"estimatedCompletionTokens":400}'/api/v1/proxyProxy (Cache + Routing)
curl -X POST "$BASE/api/v1/proxy" \
-H "Authorization: Bearer cp_xxx" \
-H "Content-Type: application/json" \
-d '{"provider":"openai","model":"gpt-4o","prompt":"Summarize this...","objective":"cost"}'/api/v1/forecast?lookback_days=30&horizon_days=7Forecast
curl -H "Authorization: Bearer cp_xxx" \ "$BASE/api/v1/forecast?lookback_days=30&horizon_days=7"
Open /dashboard/settings to manage team members and prompt versions.
Use prompt versions to roll back templates safely without editing live content directly.
Team members can view dashboards immediately after being added to a project.