Bitcoin API Economy: Versioned Per-Request Pricing
Bitcoin API Economy: Versioned Per-Request Pricing
Bind a service quote to an immutable tariff version and count only accepted requests.
Design and trust boundary
A quote is not proof of consumption. Freeze the tariff version before work begins and retain the accepted request identifiers. A changed tariff must produce a new quote, not retroactively alter an existing obligation. The integer total is a service price, not an engine SEND amount or a guaranteed recipient amount.
Independent reference implementation
1def quote(version, units, rate_sat):
2 if not isinstance(version, str) or not version or len(version)>64:
3 raise ValueError("tariff version")
4 if any(type(x) is not int or not 0 < x <= 1000000 for x in (units, rate_sat)):
5 raise ValueError("invalid quantity or rate")
6 return {"tariff": version, "units": units, "total_sat": units * rate_sat}
7
8assert quote("v1", 12, 3)["total_sat"] == 36
9try:
10 quote("v1", True, 3)
11except ValueError:
12 pass
13else:
14 raise AssertionError("boolean accepted")Operational boundaries
Run with Python 3. The assertions use synthetic data only. No SEND, wallet credentials or live API calls are included. Use a separate authorized execution service for actual settlement. Preserve the WAB Engine API and immutable signed fee law. These are proposed application patterns, not interoperability standards or production financial systems.
Related research
https://thamer.org/learn/bitcoin-for-ai-agents-open-integration-guide
https://thamer.org/api
