Praecise Shield/ Reference/ Budgets and kill switch
Is there room for this request? Charges the declared cost
post/budget/check
Answers allow, challenge (near the limit: ask for proof) or refuse (over it; nothing charged). Give client (any stable id; only a hash is kept) or agent (the signed agent's name).
Request bodyapplication/json, required
- sitestringrequired
- secretstringrequired
- clientstring
- agentstring
- methodstring
- pathstring
- costobject
- tokensintegerAt least 0.
- dbMsintegerDatabase milliseconds. At least 0.
- centsintegerMoney in minor units. At least 0.
- tokensinteger
Responses
- 200application/json
- decisionstringrequiredOne of: allow, challenge, refuse.
- rationumberThe largest share of any limit spent.
- spentobject
- tokensintegerAt least 0.
- dbMsintegerDatabase milliseconds. At least 0.
- centsintegerMoney in minor units. At least 0.
- tokensinteger
- limitobject
- tokensintegerAt least 0.
- dbMsintegerDatabase milliseconds. At least 0.
- centsintegerMoney in minor units. At least 0.
- tokensinteger
- windowEndsAtstring
- retryAfterSecondsinteger
- reasonstring
- decisionstringrequired
- 401Wrong site or secret.