> ## Documentation Index
> Fetch the complete documentation index at: https://browseruse-0aece648-cursor-proxy-indicator-and-text-6cda.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Costs

> Track token usage and API costs for your browser automation tasks

## Cost Tracking

To track token usage and costs, enable cost calculation:

```python theme={null}
from browser_use import Agent, ChatBrowserUse

agent = Agent(
    task="Search for latest news about AI",
    llm=ChatBrowserUse(),
    calculate_cost=True  # Enable cost tracking
)

history = await agent.run()

# Get usage from history
print(f"Token usage: {history.usage}")

# Or get from usage summary
usage_summary = await agent.token_cost_service.get_usage_summary()
print(f"Usage summary: {usage_summary}")
```
