>
Point Trough at any HTTP API — Twilio, Stripe, SendGrid, or your own services — and get per-request cost tracking, daily spend breakdowns, and alerts when you're trending over budget. Single binary, runs on your infrastructure.
Trough sits between your application and the API. Your app calls Trough instead of the API directly. Trough proxies the request, records metadata (endpoint, latency, response size), and applies your cost rule for that route.
TROUGH_ADMIN_KEY=secret trough
# Register an upstream
curl -s -X POST http://localhost:8790/api/upstreams \
-d '{"name":"twilio","base_url":"https://api.twilio.com"}'
# Add a cost rule: $0.0079 per SMS
curl -s -X POST http://localhost:8790/api/upstreams/{id}/rules \
-d '{"path_pattern":"/2010-04-01/Accounts/*/Messages","cost_cents":79}'
# Your app now calls Trough instead:
# http://localhost:8790/proxy/{id}/2010-04-01/...
Every proxied request is logged with its cost. Check spend by day, by endpoint, or by service — in real time or via CSV export.
Total cost by day, by endpoint, and by service. See where spend is going before you get the bill.
Which endpoints are expensive? Trough tracks cost per path so you know exactly what to optimize.
Set a daily or monthly threshold. Trough fires a webhook when you're trending over budget.
Flags services or routes where today's spend is more than 2x the 7-day average. Catch runaway usage before it compounds.
| Feature | Free | Pro — $2.99/mo |
|---|---|---|
| Services monitored | 1 | Unlimited |
| Requests/month | 10,000 | Unlimited (fair use) |
| History | 7 days | 90 days |
| CSV export | Yes | Yes |
| Spend alerts | No | Yes |
| Anomaly detection | No | Yes (2x deviation) |
| Hourly trends | No | Yes |
OpenAI API cost monitoring with Trough · Guide: find expensive API routes · Trough overview
Single binary. Free for one service. $2.99/mo for teams.