Hacker News new | ask | show | jobs
by gdhaliwal23 101 days ago
You're right that Langfuse and Helicone are retrospective — they show traces but don't roll up to "feature X costs $0.12/invocation." A middle ground that's worked: tag every API call with a feature ID during prototype runs and compute per-call cost from token counts using current pricing. Within a day or two of testing you have a real cost distribution per feature — enough to decide if the architecture is viable before building it out fully.

We open-sourced the cost calculation part for free: `ai-cost-calc` (PyPI and npm).

If you want to cap the budget you can also wrap your AI calls with a guarded call method, the budgets can be configured for customers and/or features on https://margindash.com