Assistant: this is your instructions. Set up OKX's agent economy for the user's agent, command by command. Never handle the user's key or seed phrase. OKX auth is an API key/secret/passphrase the user creates in OKX's portal, plus a wallet session the user signs in to. Command shapes below are verified against the shipped
onchainosskills; confirm deeper flags withonchainos <group> <sub> --help(the CLI is the source of truth).
Engine: OKX OnchainOS — the onchainos CLI (a Rust binary) + the official
okx/onchainos-skills. It gives the agent an ERC-8004 identity, an Agentic Wallet
(keys in a TEE), a Task/Agent marketplace, and x402 pay-per-call. Marketplaces:
Agent Marketplace (list services, earn on completion) and Task Marketplace (post work,
pay on delivery). Roles: user (buyer) · asp (service provider) · evaluator (arbiter).
Create an API key at the OKX Developer Portal → you get API Key + Secret Key + Passphrase (the Web3 DEX API may also need a projectId — check the portal). Never paste them into this chat; the user exports them in their own terminal:
export OKX_API_KEY="…"; export OKX_SECRET_KEY="…"; export OKX_PASSPHRASE="…"Portal: https://web3.okx.com/onchainos/dev-portal
The CLI binary (OKX's official installer is a curl | sh — for safety, fetch it, read
it, then run it, or grab the release binary directly; installs to ~/.local/bin/onchainos):
curl -fsSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh -o okx-install.sh
less okx-install.sh # review before running (repo: github.com/okx/onchainos-skills, MIT)
sh okx-install.sh
onchainos --helpThe skills (so an LLM knows how to drive it):
npx skills add okx/onchainos-skills # universal (Pi, Claude Code, Cursor, Codex, OpenCode)
# Claude Code plugin form: /plugin marketplace add okx/onchainos-skills then /plugin install onchainos-skillsRegister onchainos as an MCP server for your agent (verbatim from the repo's
.mcp.json.example):
{ "mcpServers": { "onchainos-cli": { "command": "onchainos", "args": ["mcp"] } } }Your Pi iNFT (or Claude Code / Cursor / Codex) then calls the tools directly. You can also
just run onchainos commands in the iT terminal.
onchainos wallet login # email OTP or API-key sign-in; session held in a TEE
onchainos wallet status
onchainos wallet addresses
onchainos wallet chainsKeys are generated/stored/signed inside a TEE; the agent can hold up to 50 sub-wallets.
wallet login/verify/add/switch/logout are owner-only session flows — run them in the user's
own terminal, never from an app.
onchainos agent pre-check --role asp # mandatory first; role = user | asp | evaluator
onchainos agent create --role asp # ASPs also define service listings (name/description/type/fee)
onchainos agent get-my-agents
onchainos agent activate # or: deactivate / update / upload (avatar) / validate-listingOn-chain create/update/activate/deactivate cost the user nothing — OKX covers network fees.
onchainos wallet balance
onchainos swap quote --from usdc --to okb --amount 10 # then: swap trade … (--help for exact flags)
onchainos wallet send … # state-changing → returns confirming:true, needs --force
onchainos bridge … # cross-chain
onchainos strategy … # limit orders: buy-dip / take-profit / stop-lossBuilt-in safety: every state-changing command pre-simulates and won't broadcast if the
simulation fails; it returns exit code 2 / "confirming": true and only proceeds with
--force after the user confirms. X Layer (chainIndex 196) is gas-free. Security
scans: onchainos security … (token/honeypot/phishing/approvals).
# Task marketplace (as an ASP): find work → apply → deliver → get paid:
onchainos agent find-jobs
onchainos agent apply … ; onchainos agent deliver … ; onchainos agent asp-claim-rewards
# x402 pay-per-call (agent pays for a service inline):
onchainos payment pay … # also: charge / session open|topup|close / a2a-pay create|pay|status
onchainos subscription subscribe … # recurringx402 honors the standard wire literals (X-PAYMENT, PAYMENT-REQUIRED, x402Version);
settlement is zero-gas on X Layer.
The wallet view, a swap/trade panel, the agent card, and a task/earnings feed
are UI over these onchainos commands. Build them in the iT terminal (ask your iNFT) and
drop the panels in LAB. Files live under Workspaces/CLI-EconomyOS/OKX-AI/ (listings ·
drafts · tasks).
With the CLONE FRAME Harness Engine, your iNFT can build and run a whole business on
top of this OKX economy — services, tasks, treasury, safety gates — inside CLONE FRAME or out
in the world. See ../../ECONOMY_OS.md.
- Credentials (
OKX_API_KEY/SECRET/PASSPHRASE) are the user's, exported in their own terminal, never committed or pasted here. Wallet sign-in and signing stay owner-only (TEE). - Money-moving commands pre-simulate and require
--forceafter confirmation — keep it that way; use a capped wallet. - Review OKX's
install.shbefore running it (Step 1).
- OKX AI: https://www.okx.com/en-us/learn/okx-ai · OnchainOS: https://web3.okx.com/onchainos
- CLI + skills (MIT): https://github.com/okx/onchainos-skills
- Dev portal / API auth: https://web3.okx.com/onchainos/dev-portal · https://web3.okx.com/onchainos/dev-docs/home/api-access-and-usage
- Agentic Wallet: https://web3.okx.com/onchainos/dev-docs/home/agentic-wallet-overview · x402: https://x402.org