---
title: "State the cost of every call before and · Agent Wranglers"
url: https://agentwranglers.se/playbook/agents-as-users/quotas-and-pricing/cost-in-every-result
id: AGT-26
level: Recommended
updated: 2026-10-22
tokens: 793
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# State the cost of every call before and after it runs

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Quotas and pricing](https://agentwranglers.se/playbook/agents-as-users/quotas-and-pricing.md).

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

- ID: AGT-26
- Level: Recommended
- Chapter: [Quotas and pricing](https://agentwranglers.se/playbook/agents-as-users/quotas-and-pricing.md)
- Rule: Publish the price of each paid tool or endpoint in a machine-readable form. Return the amount charged and the remaining budget in every paid result.
- Check: A test calls each paid tool once. Every result has `charged`, `currency` and `remainingToday`, and `charged` equals the published price. A call that fails with a server error charges 0.
- How: An agent can only stay inside a budget it can see. Put the price in the tool description and in a pricing file. Use units the agent can count, such as per call or per 1,000 rows. Return `charged`, `currency` and `remainingToday` in each result. A dry run, as [Offer a dry run for every change](https://agentwranglers.se/playbook/agents-as-users/safe-actions/dry-run.md) says, returns the price it would charge. Charge nothing for calls that fail because of your server. Keep amounts in minor units, as [Hold money as integer minor units everywhere](https://agentwranglers.se/playbook/payments/amounts-and-orders/money-in-minor-units.md) says.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JSON example

```json
{
  "resultType": "complete",
  "content": [{ "type": "text", "text": "Found 120 matching companies." }],
  "structuredContent": { "rows": 120, "charged": 240, "currency": "EUR", "remainingToday": 760 }
}
```

## Sources

- [x402, HTTP 402 payment requirements](https://docs.x402.org/core-concepts/http-402)

## Related rules

- AGT-20 [Offer a dry run for every change](https://agentwranglers.se/playbook/agents-as-users/safe-actions/dry-run.md) in Agents as users
- PAY-10 [Hold money as integer minor units everywhere](https://agentwranglers.se/playbook/payments/amounts-and-orders/money-in-minor-units.md) in Payments and billing

**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/agents-as-users/quotas-and-pricing/cost-in-every-result">Agent Wranglers agents as users playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Cap what each agent grant may spend](https://agentwranglers.se/playbook/agents-as-users/quotas-and-pricing/spend-cap-per-grant.md)
- Next: [Warn the person before an agent's budget runs out](https://agentwranglers.se/playbook/agents-as-users/quotas-and-pricing/budget-warnings.md)
- [Quotas and pricing](https://agentwranglers.se/playbook/agents-as-users/quotas-and-pricing.md)
