# How Agent Billing Works

This page explains how agent work flows from tracked time to client invoices.

## The Full Flow

```
Agent works → Time entry created → Manager approves →
Invoice generated → Client pays
         ↓
LLM expense created → Included in invoice (optional)
```

## Rate Structure

Agent users have their own rates, separate from humans:

| Component | Set Where | Example |
|---|---|---|
| Agent hourly rate | Team → Agent User → Billable Rate | £75/hr |
| Agent cost rate | Team → Agent User → Cost Rate | £5/hr |
| LLM unit price | Expense Categories → LLM Usage | £0.003/1k tokens |

## Margin Calculation

**Revenue**: Agent hours × billable rate + LLM cost pass-through

**Cost**: Agent hours × cost rate + actual LLM spend

**Margin**: Revenue - Cost

### Example

| Line Item | Revenue | Cost | Margin |
|---|---|---|---|
| 6h agent work @ £75/hr | £450 | £30 | £420 |
| 180k tokens @ £0.003/k | £0.54 | £0.54 | £0.00 |
| **Total** | **£450.54** | **£30.54** | **£420** |

## Tips for Clients

- Be transparent about agent work on invoices.
- Use separate line items for agent time and LLM costs.
- Include a brief explanation the first time a client sees agent charges.
- Consider a lower rate for agent work to reflect the reduced human effort.

## Related

- [Invoicing Agent Work](/docs/invoicing/agent-work) — how agent entries appear on invoices
- [Managing Agent Users](/docs/team-management/agent-users) — setting agent rates
- [Cost Allocation Patterns](/docs/best-practices/cost-allocation) — advanced billing strategies