Track AI Costs Per Client: Usage Attribution for Agencies and Consultancies
Track AI costs per client: per-client keys, tagged usage, and billing-grade attribution for agencies and consultancies running AI workflows.
The agency question is always the same: whose usage is this? When one team runs dozens of clients through shared models, the bill is a single number — and every client line item has to be reconstructed from memory. That breaks both billing and trust.
Per-client tracking has three layers: per-client keys, tagged usage, and a review cadence. This guide covers all three. LayerFlow's client tags implement it; the docs show the setup.
Layer 1: Per-client keys
Give each client its own API key, named after the client, with its own cap. Attribution becomes structural: the provider dashboard groups by key, and the bill maps to clients without any tagging discipline. Per-client keys are also the compliance answer — client data runs under a key that is only ever used for that client.
Layer 2: Tagged usage
- Tag prompts by client, project, and task type at creation time.
- Store tags on prompts, versions, and runs — not just the final outputs.
- Use tags for reporting AND routing: cost attribution and budget enforcement share the tag.
- Keep a fixed tag taxonomy; free-text tags decay into unusable data.
Keys give the ceiling; tags give the breakdown. Without tags, a client key tells you the total, but not which project or task inside the client burned it.
Layer 3: The review cadence
- Monthly: reconcile provider spend against client budgets.
- Quarterly: re-estimate client AI budgets from actuals, not guesses.
- Incident: alert at the cap threshold, before the client invoice, not after.
- Every review ends with the question: does the client's budget match the usage pattern?
Mistakes that ruin attribution
- One shared key across all clients — attribution is impossible, not difficult.
- Tags added after the fact from memory.
- No caps per client, so one client's workload bleeds into another's budget.
- Provider dashboards as the only report — nobody reads them monthly.
- Treating AI costs as overhead instead of pass-through.
Internal next steps
Foundations first: BYOK for Beginners and Team API Keys. Then Hard Budgets for AI Teams and AI Spend Analytics Dashboards.
Attribution from day one: sign in to LayerFlow and set up per-client keys and tags, or check pricing.
FAQ
How do I track AI costs per client?+
Three layers: per-client API keys with caps, tags on every prompt (client, project, task), and a monthly reconciliation of provider spend against client budgets.
How do agencies bill AI usage to clients?+
Define it in the SOW as pass-through, attribute by per-client keys and tags, and invoice actuals reconciled monthly. The attribution system must exist before the first invoice.
What is the best way to attribute AI usage?+
Structural attribution: per-client keys for the ceiling and fixed-taxonomy tags for the breakdown. Both are set at creation time — retroactive attribution is guesswork.
Related posts
Aug 13, 2026 · Cost control
Hard Budgets for AI Teams: Enforce Limits Before the Invoice ArrivesHard budgets for AI teams: caps that block requests, hierarchical limits, and alerts at 80% — enforcement before the surprise invoice.
Aug 13, 2026 · Cost control
AI Spend Analytics: The Dashboard Every Team Lead NeedsAI spend analytics: the five metrics every team lead should track — cost per project, per model, per team, anomalies, and quality-adjusted cost.
Aug 14, 2026 · AI gateway
Team API Keys: Sharing Credentials Without a Security NightmareTeam API keys done right: per-member keys, caps, vaults, and onboarding flows that keep AI credentials secure without slowing the team down.