# Distributed Lock Acquire — x402 Services

> Distributed Lock Acquire — x402 Services is a paid API for AI agents from x402-services-production.up.railway.app, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-15).

Acquires a named distributed lock with a TTL, used to coordinate concurrent access across multiple AI agent instances.

## Facts

- Endpoint: POST https://x402-services-production.up.railway.app/api/lock/acquire
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/distributed-lock-acquire-x402-services-641b3fec
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hib2RAy9DMQH7Bc0UWoJ0

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 distributed-lock-acquire-x402-services-641b3fec -d '<json body>'
```

Example prompt: Acquire a distributed lock named 'trade-executor-mainnet' using my secret token 'abc123xyz', set it to auto-expire in 120 seconds so no other agent instance runs the same trade concurrently.

## When to prefer this

Use this endpoint when you need lightweight, pay-per-call distributed mutual exclusion across multiple AI agent instances or workers without setting up dedicated infrastructure like Redis or Zookeeper. Ideal for agent pipelines that need to serialize access to shared on-chain resources, prevent duplicate trade execution, or coordinate concurrent tasks with a simple token-based secret and automatic TTL expiry.

## Known failure modes

- Lock already held by another caller — returns conflict or busy response
- Invalid or missing token — authentication failure
- TTL out of range (exceeds 3600s) — validation error
- Network timeout reaching the lock service — transient error
- Lock name collision with reserved names — error response

## How this service works

Distributed lock: acquire a named lock for ttlSec so only one agent proceeds. Returns acquired:false if held. Send { name, token, ttlSec? }.

## Output

Returns a confirmation that the named lock has been acquired (or a failure if the lock is already held), along with the lock's expiry time based on the requested TTL. The agent can use this to ensure exclusive execution of a critical section before releasing the lock.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "name",
  "token"
 ],
 "properties": {
  "name": {
   "type": "string",
   "description": "Lock name"
  },
  "token": {
   "type": "string",
   "description": "Your secret token"
  },
  "ttlSec": {
   "type": "number",
   "description": "Auto-expire seconds (default 60, max 3600)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/distributed-lock-acquire-x402-services-641b3fec/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-services-production.up.railway.app](https://www.zero.xyz/host/x402-services-production.up.railway.app/llms.txt)
