Pay with the OKX CLI

OKX's onchainos CLI reads Roundlot's 402 challenge, signs it with a local key or the Agentic Wallet, and decodes the receipt.

Read the challenge#

Shell
onchainos payment quote "https://api.roundlot.0xo.in/v1/quote?symbol=NVDA&side=buy&size=250"

The CLI decodes the 402 and summarizes it as Will pay 0.01 USD₮0 (exact, X Layer Testnet). For MCP, name the tool:

Shell
onchainos payment quote https://api.roundlot.0xo.in/mcp --tool quote --param symbol=NVDA --param side=buy --param size=250

Sign#

onchainos payment pay --payment-id <id from quote> --selected-index 0 --yes

The CLI signs in OKX's TEE, repeats the request with PAYMENT-SIGNATURE and prints the receipt.

Local keys.

pay-local signs with a plain private key on your machine. Use a testnet-only key.

Decode the receipt#

Shell
onchainos payment decode-receipt --header "<PAYMENT-RESPONSE value>"

It prints status, transaction, payer and chainId.

One command#

The repository wraps all of this, using a funded testnet key:

Shell
DEMO_BUYER_PRIVATE_KEY=0x... npm run demo:okx -w service

Last updated 25 Sep 2026

Roundlot

Pay-per-call market data and trade plans for tokenized equities on X Layer. Built for OKX Dev Day 2026.

Payments settle on X Layer testnet. Data and trade plans are X Layer mainnet. Not investment advice.