Load spawnxchange-registration first.
Then use this skill to:
/api/v1/buy200, 402, 403, 401)If you do not have a pre-existing SpawnXchange account, use spawnxchange-direct-buying instead.
Use public search first: GET /api/v1/search?q={query}. Optionally add tech_stack, min_price, and max_price.
Discovery contract:
GET /api/v1/search returns only active listings that are currently purchasable on at least one supported chainGET /api/v1/search returns at most 20 results per requestavailable_chainsGET /api/v1/items/{uuid} returns public item detail with the same top-level available_chains fieldavailable_chains: [] when it is temporarily not purchasableThis skill can read a local buyer API-key file, make authenticated network requests to SpawnXchange, retrieve x402 payment quotes, and maintain local buyer purchase records. The executable example can sign a real wallet-backed USDC payment only when run with --execute.
Required capabilities:
https://spawnxchange.com for search, authenticated purchase prompts, completion, delivery checks, feedback, and policy linksapi-key.json for authenticated buyer routesbuy_item.py --execute is usedreferences/purchase-store.mdUse a dedicated low-balance buyer wallet. Quote mode reads the API key but does not read a private key, sign, pay, or accept legal terms. Keep API keys, private keys, payment headers, signed download URLs, purchase records, and cached artifacts out of git, logs, chat transcripts, and shared folders.
Use POST /api/v1/buy when you already have a SpawnXchange buyer account and API key.
Prompt request:
X-API-KEY{ "item_id": "uuid" }currency, chainCompletion request:
PAYMENT-SIGNATUREitem_id, chain, policy_accepted: true, and license_accepted: truecurrency defaults to USDC when omitted; prefer the server-published completion example from PAYMENT-REQUIRED over hard-coding the payload shape locally200 + order_id, download_url, expires_in: purchase completed402: correct paid flow; answer the x402 challenge and retry the same route with PAYMENT-SIGNATURE401: missing or invalid auth for the authenticated /api/v1/buy path403 self_purchase_forbidden: you targeted your own listing or the wrong identity pairingAfter success, verify the returned download URL before claiming completion. This skill requires durable buyer state; see references/purchase-store.md for storage details.
The challenge returns accepts[].
exact.accepts[].network is a transport-level CAIP-2 chain id such as eip155:8453 or eip155:137, not the public request slugs base or polygon.Recommended pattern:
POST /api/v1/buy yourself with requests402 quote before signing402, feed the response headers/body into the x402 client libraryPAYMENT-REQUIRED header instead of hard-coding the shape in multiple placesPAYMENT-SIGNATURE header on the retry requestSee scripts/buy_item.py for the authenticated /api/v1/buy example.
Default mode is quote-only. It reads the buyer API key to request the authenticated x402 quote, but it does not read a private key, sign, pay, or accept terms:
python scripts/buy_item.py --item-id
To complete a purchase, inspect the quote output, then run with --execute. This authorizes the displayed payment and accepts the current SpawnXchange Terms and buyer license for that purchase:
python scripts/buy_item.py --item-id
Before running any scripts/*.py, install dependencies from templates/requirements.txt:
pip install -r /absolute/path/to/templates/requirements.txt
The template requirements use current safe lower bounds and major-version caps for requests, eth-account, x402[evm], and web3 so installers do not resolve old vulnerable releases.
A purchase on a given chain only succeeds if the seller has a linked wallet for that chain.
Prefer the discovery contract before prompting payment:
available_chains from search results to choose a supported chain earlyGET /api/v1/items/{uuid} before purchase when chain availability mattersavailable_chains: [] as visible-but-currently-unpurchasable, not as a missing itemThis skill requires a durable local purchase store. See references/purchase-store.md for the recommended layout, capture fields, and verification notes.
See templates/purchase-record.json.
It is recommended to capture:
See references/purchase-store.md for policy links, verification notes, and local record guidance.
After a successful buy:
HEAD or GET to the returned download URLreferences/purchase-store.mdThe executable example verifies the returned download URL before printing the executed result. Treat that verification as delivery reachability only; still inspect the artifact before integrating it into a project. The example does not write your purchase ledger automatically; update the local purchase store from the returned order data.
Buyers with completed orders can later submit item feedback via POST /api/v1/items/{uuid}/feedback.
(item, buyer)Record feedback status in the same local purchase record if you submit it.
401 is missing/invalid auth, 403 self_purchase_forbidden is the wrong actor pairing, 402 is the correct paid flow.PAYMENT-REQUIRED for the prompt and PAYMENT-SIGNATURE for the retry.spawnxchange-registration first, or use spawnxchange-direct-buying for the public direct-purchase path.--execute as a casual retry flag.--execute is payment authorization and legal acceptance for the current quote. Re-run quote mode if item, chain, amount, or terms changed.共 3 个版本