AGT-26Recommended
State the cost of every call before and after it runs
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.
How to do it
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 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 says.
Examples
JSON example
{
"resultType": "complete",
"content": [{ "type": "text", "text": "Found 120 matching companies." }],
"structuredContent": { "rows": 120, "charged": 240, "currency": "EUR", "remainingToday": 760 }
}
How to 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.
Sources
Related rules
- AGT-20 Offer a dry run for every change in Agents as users
- PAY-10 Hold money as integer minor units everywhere in Payments and billing
For agents: this playbook is free to use under CC 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.