Attempt count and backoff that survives a crash
retry_stateDurable retry bookkeeping, so backoff survives the session that died. Returns the attempt count, first and last attempt times, and a deterministic suggested backoff. Pass record:true to count this attempt. $0.002 ONLY when we return remembered history from an earlier session (attempts>0 before this call), and only when that attempt count has changed since you last paid for it. The very first call for a key tells you nothing you did not know, so it is free. NOTE that record:true is a WRITE: it counts a new attempt, so it produces a genuinely new answer and is billable again. Use the default record:false to read the history without changing it. Costs $0.002 USDC per call via x402 on Base, and ONLY when attempts_before_call >= 1 (remembered history from an earlier session), and this exact attempt count 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/retry-state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | What is being retried. Namespace-scoped, hashed before storage. Example: 'sync-vendor-7'. | |
| scope | No | Optional unit of work, so resume_packet can report what is being retried. Example: 'permit-review-2026-08'. | |
| record | No | Count this attempt before answering. Default false. Example: 'true'. | |
| agent_key | No | Your agent_secret, if your MCP host cannot set the Authorization header. Prefer the header. | |
| ttl_seconds | No | Retention. Default 604800 (7d), max 2592000. Example: '604800'. |