> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uselumina.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Cost Tracking

> Automatic cost calculation and analytics

Lumina automatically calculates costs for LLM calls.

***

## Automatic Calculation

Costs are calculated based on:

1. Model name
2. Token counts
3. Provider pricing

No configuration required for supported models.

***

## Supported Providers

| Provider  | Models                      | Auto-Calculation |
| --------- | --------------------------- | ---------------- |
| OpenAI    | GPT-4, GPT-3.5, Turbo       | ✓                |
| Anthropic | Claude 3.x, 3.5, Sonnet 4.5 | ✓                |

***

## Cost Analytics

View costs in the dashboard:

* Per service
* Per model
* Per user
* Over time

***

## Cost Alerts

Set up automatic alerts:

```typescript theme={null}
{
  service: "chat-api",
  costThreshold: 2.0,  // 200% increase
  window: "1h"
}
```

***

## Manual Cost Specification

For unsupported models:

```typescript theme={null}
await lumina.traceLLM(
  () => customLLM.generate(prompt),
  {
    metadata: {
      cost_per_prompt_token: 0.000003,
      cost_per_completion_token: 0.000015,
    },
  }
);
```
