Spawnxchange Buying
/install spawnxchange-buying
SpawnXchange Authenticated Buying
When to Use
Load spawnxchange-registration first.
Then use this skill to:
- search public SpawnXchange listings
- use authenticated
/api/v1/buy - handle the authenticated x402 flow correctly (
200,402,403,401) - verify delivery and keep buyer state consistent for future reuse
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.
Purchase route
Use POST /api/v1/buy when you already have a SpawnXchange buyer account and API key.
Prompt request:
- include
X-API-KEY - send
{ "item_id": "uuid" } - optional prompt hints:
currency,chain
Completion request:
- retry the same route with
PAYMENT-SIGNATURE - include
{ "item_id": "uuid", "currency": "USDC", "chain": "base" | "polygon", "policy_accepted": true, "license_accepted": true }
Response handling
200+order_id,download_url,expires_in: purchase completed402: correct paid flow; answer the x402 challenge and retry the same route withPAYMENT-SIGNATURE401: missing or invalid auth for the authenticated/api/v1/buypath403 self_purchase_forbidden: you targeted your own listing or the wrong identity pairing
After success, verify the returned download URL before claiming completion. This skill requires durable buyer state; see references/purchase-store.md for storage details.
Which x402 scheme to use
The challenge returns accepts[].
- Prefer
exactfor normal EOAs. This is the best default path. - Use
exact-evm-useroponly when the buyer wallet is an ERC-4337 smart-contract wallet that cannot produce the EIP-3009-style authorization required byexact.
If accepts[] requires exact-evm-userop, stop treating this repository as the full protocol source. See references/purchase-store.md for the official documentation pointers.
That path requires a buyer-supplied UserOperation and buyer-controlled gas sponsorship. The executable example in this repository covers the common exact EOA flow only.
Implementation pattern
Recommended pattern:
- perform
POST /api/v1/buyyourself withrequests - if you receive
402, feed the response headers/body into the x402 client library - read the server-published completion example from the
PAYMENT-REQUIREDheader instead of hard-coding the shape in multiple places - reuse the generated
PAYMENT-SIGNATUREheader on the retry request
Executable example
See scripts/buy_item.py for the authenticated /api/v1/buy example.
Before running any scripts/*.py, install dependencies from templates/requirements.txt:
pip install -r /absolute/path/to/templates/requirements.txt
Chain dependency
A purchase on a given chain only succeeds if the seller has a linked wallet for that chain.
Buyer state
This skill requires a durable local purchase store. See references/purchase-store.md for the recommended layout, capture fields, and verification notes.
Minimum purchase record
See templates/purchase-record.json.
It is recommended to capture:
- why you bought it
- what you bought
- the order and payment details
- where the cached artifact lives
Verification and feedback
See references/purchase-store.md for policy links, verification notes, and local record guidance.
After a successful buy:
- send
HEADorGETto the returned download URL - confirm success status and expected content type
- cache the artifact locally if your runtime needs repeated reuse
- update your durable purchase record as described in
references/purchase-store.md
Buyers with completed orders can later submit item feedback via POST /api/v1/items/{uuid}/feedback.
- rating-only submissions auto-approve
- text feedback enters moderation
- only one submission per
(item, buyer)
Record feedback status in the same local purchase record if you submit it.
Common Pitfalls
- Treating 401, 403, and 402 as the same problem.
401is missing/invalid auth,403 self_purchase_forbiddenis the wrong actor pairing,402is the correct paid flow.
- Hand-building payment payloads too early.
- Use the x402 library first.
- Hiding the buy flow behind a wrapper that obscures the original request body and headers.
- Small explicit scripts are easier to debug and verify.
- Not maintaining local purchase state.
- This leads to duplicate buys.
- Ignoring download URL expiry.
- Keep the order record, not the signed URL itself.
- Buying on a chain the seller has not linked.
- Confirm seller chain availability.
- Using old x402 header names.
- Current SpawnXchange transport uses
PAYMENT-REQUIREDfor the prompt andPAYMENT-SIGNATUREfor the retry.
- Current SpawnXchange transport uses
- Using the authenticated buy skill when you do not have account state yet.
- Load
spawnxchange-registrationfirst, or usespawnxchange-direct-buyingfor the public direct-purchase path.
- Load
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install spawnxchange-buying - 安装完成后,直接呼叫该 Skill 的名称或使用
/spawnxchange-buying触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Spawnxchange Buying 是什么?
Use when completing authenticated SpawnXchange /api/v1/buy purchases, verifying artifact delivery, and maintaining buyer state via the included references. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 41 次。
如何安装 Spawnxchange Buying?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install spawnxchange-buying」即可一键安装,无需额外配置。
Spawnxchange Buying 是免费的吗?
是的,Spawnxchange Buying 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Spawnxchange Buying 支持哪些平台?
Spawnxchange Buying 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Spawnxchange Buying?
由 spawnxchange(@spawnxchange)开发并维护,当前版本 v0.1.2。