How does Lava help me track costs and set margins?

Cost Tracking & Margin Management

One of Lava's core capabilities is giving you complete visibility into your AI costs and the tools to price your product profitably.

Automatic cost tracking

When API requests flow through Lava's gateway, we automatically capture:

  • Token usage — input and output tokens for each LLM call
  • Provider cost — the actual amount charged by the AI provider (OpenAI, Anthropic, etc.)
  • Per-request breakdown — every call is logged with model, tokens, cost, and latency
  • Aggregated analytics — daily, weekly, and monthly cost summaries by model, customer, and product

Setting your margins

Lava Monetize lets you configure pricing that automatically includes your desired margin:

  • Percentage markup — e.g., charge customers 50% above your provider cost
  • Fixed fee per unit — e.g., $0.01 per 1,000 tokens regardless of provider cost
  • Tiered pricing — different rates at different volume levels
  • Volume discounts — reward high-usage customers with lower per-unit rates

Real-time margin visibility

The Lava dashboard shows your margins in real time — you can see exactly how much you are earning on every dollar of AI cost. If provider prices change, you will know immediately and can adjust your pricing accordingly.

Per-customer margin tracking

Track margins at the customer level to identify your most and least profitable accounts. This helps you make informed decisions about pricing tiers, volume discounts, and customer success investments.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.