See what your APIs actually cost, by route.
Reverse proxy that records what each API endpoint costs. Daily spend breakdowns, per-route analysis, anomaly detection, and spend alerts. Works with Twilio, Stripe, OpenAI, or any HTTP API.
Running in under 60 seconds.
curl -fsSL https://stockyard.dev/trough/install.sh | sh
TROUGH_ADMIN_KEY=secret trough
Proxy: http://localhost:8790/proxy/{upstream_id}/...
Spend: http://localhost:8790/api/spend
Export: http://localhost:8790/api/export.csv
curl -s -X POST http://localhost:8790/api/upstreams \
-H 'Authorization: Bearer secret' \
-d '{"name":"twilio","base_url":"https://api.twilio.com"}'
curl -s -X POST http://localhost:8790/api/upstreams/{id}/rules \
-d '{"path_pattern":"/2010-04-01/Accounts/*/Messages","cost_cents":79}'
# Route your app through Trough instead of calling Twilio directly
# http://localhost:8790/proxy/{id}/2010-04-01/...
Trough shows you exactly which API routes are driving cost — before the invoice arrives.
Three things developers use this for.
Teams outgrow spreadsheet-based upstreams tracking around the same time they realize SaaS alternatives want $15 to $50 per seat per month. Trough is a single binary that handles the same job without the recurring bill.
Deploy Trough as a systemd service, a Docker container, or a bare process. It reads PORT and DATA_DIR. The /api/health endpoint returns status for monitoring.
A consultant keeps Trough running on a home server. Client upstreams stay on local disk, simplifying privacy in every contract.
Free to run. Pro when you need more.
- 1 monitored service
- 10,000 requests / month
- Daily cost summary
- Provider and route breakdown
- 7-day history
- CSV export
- Simple per-endpoint cost rules
- Unlimited services
- Unlimited requests (fair use)
- 90-day history
- Anomaly detection on spend and volume
- Hourly and daily spend trends
- Per-route and per-provider drilldowns
- Alert thresholds (daily / monthly)
- Spend summary exports
- Custom pricing rules per route
- Read-only dashboard sharing
When Trough is the right tool.
Trough answers one question: which API endpoints are driving my spend? Free covers 1 service and 10,000 requests/month with 7-day history. Pro ($2.99/mo) unlocks unlimited services, 90-day history, anomaly detection, and spend alerts.
API cost monitor overview · OpenAI spend tracking · Find expensive routes
When you need the full LLM control plane.
Learn about Stockyard →How Pro gets activated.
When your payment goes through, you'll receive an email at the address you used at checkout. The email contains your license key — a string that starts with stockyard_.
Set it as an environment variable before starting Trough:
TROUGH_LICENSE_KEY=stockyard_your_key_here trough License: Pro (your-email@example.com) Dashboard: http://localhost:8790/ui
That's it. Pro features unlock immediately on startup — no restart required after the first run, no account to log into, no phone-home check. The key is verified locally.
Check your spam folder first. If it's not there after 5 minutes, email hello@stockyard.dev with your payment confirmation and we'll send the key manually.
GET /api/export.csv returns a full request log as CSV. Pro adds spend summary exports and scheduled exports.Know what your APIs cost before the invoice.
Single binary. Runs anywhere. Free to start.
Part of Stockyard Complete — all 150 tools for $29/mo