# WritersLogic Idempotency Registry

> WritersLogic Idempotency Registry is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-18).

Provides distributed idempotency coordination for multi-agent workflows via begin/complete/abandon/get operations on named keys with claim-based locking and result storage.

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/idempotency-registry?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-idempotency-registry-ba2174d1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zTPuGSeatNMZyQPDXZQPl

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability writerslogic-idempotency-registry-ba2174d1 -d '<json body>'
```

Example prompt: Before processing this refund for charge ch_123, check the idempotency registry with key 'refund:ch_123:2026-11-04' using worker ID 'worker-7' and a 5-minute claim — if another agent is already handling it or it's already done, tell me the status and any stored result pointer.

## When to prefer this

Use this endpoint when coordinating side-effecting operations (payments, emails, external API writes) across multiple parallel agent instances or retries where exactly-once execution is required. Prefer this over application-level deduplication when agents may crash mid-flight, when claims need automatic expiry to avoid permanent locks, or when you need a distributed shared record of completion that any worker in a fleet can check. Not needed for pure read operations or idempotent-by-nature GET requests.

## Known failure modes

- fingerprint_mismatch: same key submitted with a different fingerprint hash — operation rejected
- wait: another worker currently holds the claim — caller must poll or back off
- claim expiry: claim lapses after claimSeconds if complete/abandon not called — another worker may then proceed
- invalid key pattern: key contains disallowed characters or exceeds 200 chars — validation error
- missing required fields: owner not provided for begin/complete/abandon — rejected
- requestId conflict: same requestId reused with different input within 24h — rejected
- tenant not authorized: tenantId missing or mismatched for API-key callers

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

Returns a JSON object with a status field indicating one of: 'proceed' (claim granted, caller may execute), 'wait' (another owner holds the claim), 'already_completed' (includes stored result pointer, digest, and summary), or 'fingerprint_mismatch' (key exists with a different fingerprint). For 'get' operations, returns the current state of the key including owner, expiry, and result if completed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "op": {
   "enum": [
    "begin",
    "complete",
    "abandon",
    "get"
   ],
   "type": "string"
  },
  "key": {
   "type": "string",
   "pattern": "^[A-Za-z0-9_.:/@+-]{1,200}$",
   "description": "Idempotency key, e.g. refund:ch_123:2026-11-04."
  },
  "owner": {
   "type": "string",
   "maxLength": 128,
   "minLength": 1,
   "description": "Worker id; required for begin, complete and abandon."
  },
  "result": {
   "type": "object",
   "properties": {
    "digest": {
     "type": "string",
     "maxLength": 128
    },
    "pointer": {
     "type": "string",
     "maxLength": 500
    },
    "summary": {
     "type": "string",
     "maxLength": 500
    }
   },
   "description": "complete: where the outcome lives (do not store payloads here).",
   "additionalProperties": false
  },
  "tenantId": {
   "type": "string",
   "pattern": "^[A-Za-z0-9_.-]{1,64}$",
   "description": "Required for API-key callers (namespaced as key:<tenantId>; keep it unguessable). Ignored when a wallet paid: the payer address is the tenant."
  },
  "requestId": {
   "type": "string",
   "pattern": "^[A-Za-z0-9_.:-]{1,128}$",
   "description": "Caller-chosen id for this mutation. A retry with the same id and same input returns the stored response (24 h) instead of applying twice; the same id with different input is rejected. Send one on every mutation you may retry: without it a retry is applied again (fleet-memory record appends a duplicate; a repeated spend-ledger commit or release answers NO_HOLD because the first call already took effect)."
  },
  "fingerprint": {
   "type": "string",
   "maxLength": 128,
   "minLength": 1,
   "description": "Hash of the operation's identity fields; a later begin with a different fingerprint is refused."
  },
  "claimSeconds": {
   "type": "integer",
   "maximum": 3600,
   "minimum": 1,
   "description": "How long a begin claim lasts; default 300."
  },
  "retentionHours": {
   "type": "integer",
   "maximum": 168,
   "minimum": 1,
   "description": "How long a completed key is remembered; default 24."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-idempotency-registry-ba2174d1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
