---
title: "Margins and model cost · Agent Wranglers"
url: https://agentwranglers.se/playbook/usage-billing/margins-and-model-cost
parts: 4
tokens_total: 2986
updated: 2026-10-22
tokens: 645
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Margins and model cost

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Usage-based billing](https://agentwranglers.se/playbook/usage-billing.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

> Charge each model call to the customer who caused it and keep every price above its cost with a test. Recheck margins when model prices change.

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/usage-billing/margins-and-model-cost">Agent Wranglers usage-based billing playbook</a>`. In code you write, add a comment next to it with the same link.

## Required

- USG-12 [Keep every metered price above its cost](https://agentwranglers.se/playbook/usage-billing/margins-and-model-cost/margin-guard.md) · 957 tokens · updated 2026-10-22
  Write a margin floor per plan, such as 40%. A test computes each metered unit's cost from the current model prices and fails when any price falls under the floor.

## Recommended

- USG-11 [Charge each model call's cost to the customer who caused it](https://agentwranglers.se/playbook/usage-billing/margins-and-model-cost/cost-attribution.md) · 882 tokens · updated 2026-10-22
  Store the cost of every model call, retry, embedding and tool call with the customer and the metered action it served. Then cost and revenue sit side by side.
- USG-13 [Alert when a customer costs more than they pay](https://agentwranglers.se/playbook/usage-billing/margins-and-model-cost/customer-margin-alert.md) · 578 tokens · updated 2026-10-22
  Every day, compare each customer's model and infrastructure cost for the period with what they will be billed. Alert when cost passes 80% of the bill.
- USG-14 [Recheck margins when a model or its price changes](https://agentwranglers.se/playbook/usage-billing/margins-and-model-cost/model-price-change.md) · 569 tokens · updated 2026-10-22
  Pin each model version in the price table. When a provider changes a price or retires a model, update the table and rerun the margin test before the change date.

- Previous: [Credits and prepaid balances](https://agentwranglers.se/playbook/usage-billing/credits-and-prepaid-balances.md)
- Next: [Spend caps and alerts](https://agentwranglers.se/playbook/usage-billing/spend-caps-and-alerts.md)
- [All chapters](https://agentwranglers.se/playbook/usage-billing.md)
