# LiteLLM cost tracking

LiteLLM routes one API to many providers. Veqen prices each call at the provider it actually went to, so a request that falls back from one provider to another is priced where it ran.

## In your code

```python
import litellm
from veqen.integrations.litellm import callback

litellm.success_callback = [callback]

litellm.completion(model="anthropic/claude-sonnet-4-5", messages=messages,
                   metadata={"veqen": {"customer": "acme", "feature": "chat"}})
```

Tags come from `metadata.veqen` or from an enclosing `veqen.tags(...)` block. Embedding, image and audio calls are priced too. For calls that report no usage, LiteLLM's own `response_cost` is kept.

## In the proxy

Add Veqen's logger to the proxy's `config.yaml`, or point the proxy's generic logging at Veqen's hosted endpoint so nothing extra runs in the proxy. Tags come from each request's `metadata.veqen`, as above. Both setups are in [Track LiteLLM costs](/docs/litellm).

## Next

- [Track LiteLLM costs](/docs/litellm): the proxy logger and the hosted endpoint, step by step.
- [Reconciliation](/docs/reconciliation): compare what the proxy sent with each provider's bill.
