Idempotency claim
claimExactly-once guard for work that costs money or has side effects. The first call for a key returns granted:true and is FREE. Every later call for that key returns granted:false with first_claimed_at and, if complete() was called, the stored result — so a retrying agent gets the answer instead of paying for the same paid API call twice. $0.002 is charged the FIRST time a key is denied (and again only if complete() has since attached a new result); repeated denials of the same unchanged fact are free. If we cannot determine the state we return granted:null and you must NOT proceed. Costs $0.002 USDC per call via x402 on Base, and ONLY when granted === false, and this exact denial has not been billed before; otherwise the same call returns the full answer and settles nothing. Authenticate with Authorization: Bearer , or pass agent_key as an argument if your host cannot set headers. Equivalent HTTP route: POST /v1/claim.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Your idempotency key. Scoped to your namespace; hashed before storage. <=256 chars. Example: 'charge-order-8814'. | |
| scope | No | Optional unit of work this belongs to. Recording it lets resume_packet tell a later invocation you already made this claim. Example: 'permit-review-2026-08'. | |
| agent_key | No | Your agent_secret, if your MCP host cannot set the Authorization header. Prefer the header. | |
| ttl_seconds | No | How long the claim is remembered. Default 86400, max 2592000. Example: '86400'. |