>
Focused Tool · Apache 2.0 · Self-hosted

Self-hosted API cost monitor for any HTTP API.

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.

Install Trough Free Docs

Reverse proxy that records what each request costs.

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.

What you get

Cost visibility before the invoice arrives.

Daily spend summary

Total cost by day, by endpoint, and by service. See where spend is going before you get the bill.

Per-route breakdown

Which endpoints are expensive? Trough tracks cost per path so you know exactly what to optimize.

Spend alerts (Pro)

Set a daily or monthly threshold. Trough fires a webhook when you're trending over budget.

Anomaly detection (Pro)

Flags services or routes where today's spend is more than 2x the 7-day average. Catch runaway usage before it compounds.

Free for one service. Pro for teams running many.

FeatureFreePro — $2.99/mo
Services monitored1Unlimited
Requests/month10,000Unlimited (fair use)
History7 days90 days
CSV exportYesYes
Spend alertsNoYes
Anomaly detectionNoYes (2x deviation)
Hourly trendsNoYes
Related

OpenAI API cost monitoring with Trough  ·  Guide: find expensive API routes  ·  Trough overview

Know what your APIs cost before the invoice.

Single binary. Free for one service. $2.99/mo for teams.

Install Trough Need LLM cost tracking? Try Stockyard →