Wire your agent to the Finance Copilot.
Nine paid market tools on X Layer. Hit an HTTPS endpoint, pay USDT0 when asked, get JSON back. Four tools hit OKX Web3 market and wallet APIs with our seller credentials. Five coverage tools fill price, Solana risk, and FX so an agent can stay inside one ASP.
Product: /okxasp · Marketplace: okx.ai · ASP tutorial: okx.ai/tutorial/asp
1. Discover tools
Free catalog. No payment. Use it to pick an endpoint and see prices before the agent spends.
curl https://keryxhq.xyz/api/okxasp/catalogResponse includes tool id, name, price, summary, and the HTTPS path under /api/okxasp/tools/….
2. Call without payment
First request returns 402. The PAYMENT-REQUIRED header carries amount, asset, network, and pay-to. In a browser (Mozilla UA + Accept: text/html) you get a clear paywall with the real USDT0 price — not a blank 402.
curl -i "https://keryxhq.xyz/api/okxasp/tools/okx-token-price?address=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2&chain=ethereum"
# HTTP/2 402
# payment-required: <base64 x402 payload>
# amount is USDT0 on X Layer3. Pay and retry
Use OKX Agentic Wallet or Onchain OS to settle the 402, then retry with PAYMENT-SIGNATURE. A successful call returns JSON from the tool.
# Extract PAYMENT-REQUIRED from the 402, then:
onchainos payment pay --payload "$PAYMENT_REQUIRED" --chain xlayer
# Retry with the signed header:
curl -H "PAYMENT-SIGNATURE: $SIG" \
"https://keryxhq.xyz/api/okxasp/tools/okx-token-price?address=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2&chain=ethereum"
# → { "toolId": "okx.token-price", "result": { "priceUsd": ..., "source": "okx-web3" } }If the facilitator returns timeout after a successful authorize (tx already present), we still return the tool JSON and mark payment.provisional: true. Reconcile by payment.transaction before treating the spend as final. Do not assume timeout means no USDT0 moved.
4. Buyer wallet ≠ seller payTo
The ASP payTo address cannot pay its own services. The marketplace returns payer_blocked when buyer == seller. Use a separate Agentic Wallet account as the buyer (funded with USDT0 on X Layer). Seller Account stays as payTo only.
Catalog field buyerNoterepeats this for agents. Sold / reviews on the listing are the marketplace source of truth — not this site's health endpoint.
5. OKX-native tools (use these first)
These hit OKX Web3 market and wallet APIs with our seller credentials (native: true in the catalog). That is the edge versus wrapping CoinGecko alone.
6. Coverage tools
Public feeds so the agent does not leave the pack for multi-coin price, Solana risk, or FX. Catalog marks them native: false with an honest sourceHint (CoinGecko-class / DexScreener / rugcheck / FX APIs).
7. Health check
Confirms seller credentials and network config without spending.
curl https://keryxhq.xyz/api/okxasp/health8. Agent loop (browser)
Prefer a visual walkthrough? The product page has a live agent loop that probes 402, shows the price, and walks the settle path.
Why pay-per-call
Agents should not hold shared API keys or burn monthly plans for a single answer. x402 prices the call in the open. You spend when the answer is worth it. Product thesis: read the note.
