Install
openclaw skills install okx-paymentsInteractive setup guide for x402 payment-gated APIs. Trigger when user mentions "402", "x402", "payment-gated", or "OKX payments". Asks buyer vs seller, then...
openclaw skills install okx-paymentsWhen triggered, follow this conversation flow exactly:
Ask the user:
"Are you looking to integrate someone else's x402 payment-gated API (Buyer), or add x402 payments to your own API (Seller)?"
Install onchainos CLI
Tip: Detect the user's operating system first, then run the appropriate install command below. Do not run all commands — only the one matching the detected OS.
# macOS / Linux
curl -sSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh | sh
# Windows PowerShell
irm https://raw.githubusercontent.com/okx/onchainos-skills/main/install.ps1 | iex
Security note: Review the install script before running pipe-to-shell commands. You can inspect the raw script at the URL above, or download and audit it first.
Install onchainos skills (pick one)
# Recommended (auto-detects Claude Code / Cursor / Codex CLI / OpenCode)
npx skills add okx/onchainos-skills
# Claude Code plugin marketplace
/plugin marketplace add okx/onchainos-skills
After installation, tell the user:
"Installation complete. Please restart the session for the skill to take effect."
Ask the user:
"Which language do you want to use? (default: TypeScript, also supports Go, Rust)"
Based on the answer, fetch the corresponding reference and build the seller service:
| Language | Reference to fetch |
|---|---|
| TypeScript (default) | https://raw.githubusercontent.com/okx/payments/main/typescript/SELLER.md |
| Go | https://raw.githubusercontent.com/okx/payments/main/go/x402/SELLER.md |
| Rust | https://raw.githubusercontent.com/okx/payments/main/rust/x402/SELLER.md |
Fetch the reference file. If the fetch fails, stop and tell the user which file could not be loaded — do not write any code from memory. Only proceed with implementation after successfully reading the reference content. The implementation must satisfy all constraints below.
eip155:196)OKXFacilitatorClient (never HTTPFacilitatorClient)0x779ded0c9e1022225f8e0630b35a9b54be713736 (6 decimals)exact (per-request, EIP-3009), aggr_deferred (batched settlement)"deferred" / DeferredEvmScheme; Go/Rust use "aggr_deferred" / AggrDeferredEvmSchemepaymentMiddlewareFromHTTPServer(app, httpServer) — app is first argObtain credentials from OKX Developer Portal. Never commit .env to git.
OKX_API_KEY=***
OKX_SECRET_KEY=***
OKX_PASSPHRASE=your-passphrase
PAY_TO_ADDRESS=0xYourWalletAddress
resourceServer.initialize() after server starts, before handling requestsOKXFacilitatorClient, never HTTPFacilitatorClient"$0.01" — SDK auto-converts to USDT0 atomic units.env or API credentials to git