{"uid":"cap_hib2RAy9DMQH7Bc0UWoJ0","slug":"distributed-lock-acquire-x402-services-641b3fec","name":"Distributed Lock Acquire — x402 Services","description":"Distributed lock: acquire a named lock for ttlSec so only one agent proceeds. Returns acquired:false if held. Send { name, token, ttlSec? }.","url":"https://x402-services-production.up.railway.app/api/lock/acquire","method":"POST","headers":{},"bodySchema":{"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)"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_10Uzxwnl9ZugxgZm66dob","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Acquires a named distributed lock with a TTL, used to coordinate concurrent access across multiple AI agent instances.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Preventing duplicate trade execution","prompt":"Acquire a lock called 'solana-snipe-pump' with token 'mySecret42' and a 90-second TTL so my two trading bots don't both try to snipe the same pump.fun launch at the same time."},{"title":"Coordinating DeFi rebalance jobs","prompt":"I need to grab a distributed lock named 'portfolio-rebalance-eth' using token 'rebalancerToken99' for 300 seconds — only one of my agent workers should run the rebalance job at a time."},{"title":"Serializing oracle update writes","prompt":"Lock 'oracle-price-writer' with token 'oracleSecret7' and a 60-second TTL before I push a new price update on-chain, so no other agent instance writes a conflicting update simultaneously."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:46:38.474Z","isFirstParty":false}