Skip to main content
Muxx automatically calculates and tracks the cost of every LLM request, giving you complete visibility into your AI spending.

How Costs Are Calculated

Costs are calculated based on:
  1. Model - Each model has different pricing
  2. Input tokens - Tokens in your prompt/messages
  3. Output tokens - Tokens in the response
  4. Provider pricing - Current rates from each provider
Cost = (Input Tokens × Input Price) + (Output Tokens × Output Price)

Pricing Data

Muxx maintains up-to-date pricing for all supported models:
ModelInput (per 1M tokens)Output (per 1M tokens)
gpt-4o$2.50$10.00
gpt-4o-mini$0.15$0.60
claude-3-5-sonnet$3.00$15.00
claude-3-5-haiku$0.80$4.00
gemini-1.5-pro$1.25$5.00
gemini-1.5-flash$0.075$0.30
Pricing is updated regularly to reflect provider changes.

Viewing Costs

Per-Request

Every request in the logs shows its cost:
  • Input tokens and cost
  • Output tokens and cost
  • Total cost

Dashboard Analytics

The dashboard provides cost analytics:
  • Daily/weekly/monthly spend - Track spending over time
  • Cost by model - See which models cost the most
  • Cost by user - If using user metadata
  • Cost by feature - If using feature metadata

Spend Alerts

Set up alerts to avoid surprise bills:
  1. Go to SettingsAlerts
  2. Click Add Alert
  3. Choose Spend Alert
  4. Set threshold (e.g., $100/day)
  5. Select notification channel

Spend Caps

Automatically stop requests when spending exceeds a limit:
  1. Go to SettingsSpend Caps
  2. Set a daily or monthly cap
  3. Choose action: Block or Alert Only
When the cap is reached with Block enabled:
{
  "error": {
    "message": "Spend cap exceeded. Daily limit: $100.00, Current: $100.23",
    "type": "spend_cap_error"
  }
}

Cost Optimization Tips

GPT-4o-mini is 20x cheaper than GPT-4o for many tasks.
Cached responses are free. Enable caching for repeated queries.
Shorter prompts = fewer input tokens = lower costs.
Limit output length to control output token costs.

Exporting Cost Data

Export cost data for accounting:
  1. Go to AnalyticsCosts
  2. Select date range
  3. Click Export CSV
The export includes per-request costs, model breakdown, and totals.