OKX Agent Payments Skill for Claude Code: Paid APIs
Lets Claude pay for HTTP 402 endpoints, payment links and subscriptions from your OKX wallet, for developers building or using paid agent services.
- Installs
- 15.5K
- on skills.sh
- Stars
- 343
- on GitHub
- Files
- 9
- besides SKILL.md
- Updated
- Oct 2026
- last repo commit
When a request comes back HTTP 402 Payment Required, this skill makes Claude show you the price and then pay it. It covers one-off x402 payments, MPP charges and prepaid sessions, recurring subscriptions, and payment links (a2a-pay). Signing runs through the onchainos CLI and your logged-in OKX wallet.
This spends real money. You are the one charged, in the token and network shown on the confirmation card. SKILL.md requires one confirmation card per payment, with a few exceptions listed under Permissions. Read them before you use sessions, subscriptions or payment links.
Good for
- Developers whose agent hits a paid API that answers HTTP 402
- Sellers who want to create a payment link and check whether it was paid
- Builders testing paid agent endpoints, metered sessions or subscriptions
Install okx-agent-payments-protocol
Claude Code
- 1
Copy this prompt.
Install the okx-agent-payments-protocol skill in Claude Code. Run this command: npx -y @okxweb3/onchainos-installer install Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js, Git.
The README installs the whole onchainos set (CLI, skills and A2A runtime) in one go, not this skill alone. It lists Git and Node.js as prerequisites. The skill also leans on okx-agentic-wallet from the same repo for login, balances and funding. Add --beta for the beta channel.
From the project README. Source.
What's in the skill
When it loads
Handle agent payments and paid endpoints via x402, MPP, payment links, a2a-pay, and HTTP-payment recurring or metered billing. Use for HTTP 402/payment-required; paid Agent or A2MCP endpoints; x402/Permit2; MPP channels, vouchers, or sessions; HTTP-payment subscriptions; or paymentId/link operations or status. Trigger phrases: x402/x402Version, X-PAYMENT, PAYMENT-REQUIRED, PAYMENT-SIGNATURE, WWW-Authenticate: Payment, x402 exact/exact+Permit2/upto/aggr_deferred, MPP charge/session, channelId/channel_id, payment-channel voucher/topup/settle/refund, metered billing, paymentId, a2a_, payment link, A2MCP, paid endpoint, and HTTP 402 period/permit2_subscription.
Sections in SKILL.md
- Triggers (full list)
- Preflight
- Command Routing & Reference map
- Path A (accepts-based): quote → confirm → pay — PREFERRED 2-round flow
- Step A1 — Extract params (round 1)
- Step A2 — Quote
- Step A3 — Confirm (round 2) — MANDATORY, never skip
- Step A4 — Pay
- Step A1: Start from the original response (legacy / WWW-Authenticate detail)
- Step A2: Detect the protocol
- Step A3-Accepts: Decode
- Step A3-WWW-Authenticate: Decode
- Step A3-Params: Build the request-parameter plan
- Source 1 — Bazaar outputSchema.input (preferred)
- Source 2 — non-Bazaar (conservative)
- Fill values
Key facts
- Author
- OKX
- Repository
- okx/onchainos-skills
- Installs on skills.sh
- 15,462 as of 2026-11-02
- GitHub stars
- 343 for the whole okx/onchainos-skills repo
- License
- MIT (SKILL.md frontmatter)
- Last repo commit
- 2026-10-30
- What is inside
- 10 files including SKILL.md: 2 shared notes and 7 references for the payment types. The folder holds only .md files.
- skills.sh audits
- Gen Agent Trust Hub: pass; Socket: warn; Snyk: warn
- Skill version
- 4.6.7 in the SKILL.md frontmatter
What it includes
Probe a paid URL, show the price, pay after your yes
payment quote <url> reads the 402, checks your balance and ranks the payment options. After you confirm, payment pay --payment-id signs, replays the request and returns the receipt. It covers the exact, exact with Permit2, upto and aggr_deferred schemes. For upto, the amount is a cap, not a fixed charge.
Try: “This API returned 402. Check the price and pay it.”
Runs code ·
Quote and pay (x402)Subscribe, access, change or cancel a recurring plan
payment subscription subscribe signs a Permit2 allowance and subscription terms. Then access, change, cancel, cancel-pending, my-subscriptions and allowance-status manage it. Signing commits you to repeat charges up to the signed amount and expiry.
Try: “Subscribe to this API plan and show me my active subscriptions.”
Runs code ·
Subscriptions (period)One-shot payment for a WWW-Authenticate Payment challenge
payment charge signs a one-shot payment. In transaction mode the server pays gas. In hash mode you broadcast the on-chain transaction yourself first. A charge can split the amount across up to 10 recipients.
Runs code ·
MPP chargePrepay a channel, issue vouchers, top up, close
payment session open locks a prepaid deposit in escrow, voucher draws from it per request, topup adds more and close settles and refunds the unused part. It works only with the wallet login, not a local key.
Runs code ·
MPP sessionCreate a link as seller, or pay one as buyer
a2a-pay create makes a link for an amount, token and recipient address. a2a-pay pay signs whatever the seller’s link declares. a2a-pay status polls up to 60 seconds for a final state.
Try: “Create a payment link for 0.01 USDT to my address.”
Runs code ·
Payment links (a2a-pay)Quote and pay for a tool call on a paid MCP server
For endpoints that end in /mcp or /sse, payment quote lists the tools, then quote with --tool triggers the 402. Payment then follows the normal pay step.
Runs code ·
Paid MCP endpoints (A2MCP)pay-local signs with a private key from your environment
If you are not logged in, you can choose payment pay-local. It reads EVM_PRIVATE_KEY from the environment or ~/.onchainos/.env and signs on your machine. It supports exact and upto but not aggr_deferred.
Runs code ·
Local-key fallbackToken allowance for Permit2 before a Permit2 payment
If the Permit2 allowance is missing, accepts-schemes.md has the skill offer MAX (the largest possible allowance) or a number you enter, and says not to default to MAX. After that approval, later Permit2 payments for the token are off-chain signatures.
Write ·
Permit2 allowanceRead a PAYMENT-RESPONSE header or charge receipt
payment decode-receipt turns a receipt into readable fields such as status, transaction, amount and payer.
Decode receiptRuns the onchainos installer once per thread
At the start of each thread the skill follows the wallet skill’s preflight, which runs the @okxweb3/onchainos-installer package through npx.
Runs code ·
Preflight installer
From the official docs
Permissions
High risk
This skill signs payments from your OKX wallet, and payment links and subscriptions have no preview of their own. Use a wallet with a small balance and read each confirmation card before you answer.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It signs real payments from your wallet
Quoted 402 payments need your yes on a card showing network, token, amount and recipient. Check the recipient and the amount, and note that upto amounts are a cap. github.com
Payment links and subscriptions skip a fresh preview
a2a_charge.md says paying a link signs whatever the seller’s challenge declares, with no preview of its own. subscription.md says its commands have no confirming gate. Check the seller out of band before you give the skill a paymentId or an offer. github.com
Sessions lock a deposit and subscriptions allow repeat charges
A session deposit stays in escrow until you close the channel or the seller times out (typically 12 to 24 hours, per session.md). A subscription signs a Permit2 allowance with an amount and expiry. Close channels when you finish and check the signed limits. github.com
The local-key fallback signs outside the enclave
pay-local reads EVM_PRIVATE_KEY from your environment or ~/.onchainos/.env. accepts-schemes.md calls the TEE payment path the recommended one and tells you to chmod 600 the file. github.com
It runs an npx installer at the start of a thread
The preflight step runs the @okxweb3/onchainos-installer package from npm. That is third-party code, so install it on a machine you trust. github.com
Gas and withdrawal fees
SKILL.md says on-chain gas on X Layer is free once your funds arrive. It also says an exchange may charge a withdrawal fee when you fund the wallet, so check before you top up. github.com
Security advisories
No published security advisories as of Nov 2, 2026.
Technical details
| Turning on read-only | No read-only switch. Say no at the confirmation card to stop a payment. |
|---|---|
| Talks to | The paid URLs and MCP endpoints you give it. OKX wallet and payment services through the onchainos CLI. npm registry (npx installer at the start of each thread) |
| Sign-in and keys | Wallet login is held by the onchainos CLI. The pay-local fallback reads EVM_PRIVATE_KEY from the environment or ~/.onchainos/.env. |
| Scopes |
|
Questions
What does the OKX Agent Payments Protocol skill do?
It makes Claude pay for things that answer HTTP 402 Payment Required, such as paid APIs and paid MCP tools. It also creates and pays payment links and manages subscriptions and prepaid sessions. Signing runs through your OKX wallet and the onchainos CLI.
How do I install it?
Use the install box above. The README installs the CLI, the skills and the A2A runtime together with one npx command, and lists Git and Node.js as prerequisites. The skill folder alone cannot sign anything.
Who is charged, and how?
You are, from the wallet you logged in with, in the token and on the network on the confirmation card. A session also locks a prepaid deposit in escrow until you close the channel. A subscription signs an allowance that the seller can draw on up to the signed amount and expiry.
Does it always ask before paying?
For quoted HTTP 402 payments, yes: SKILL.md requires one confirmation card per payment and says no saved preference can skip it. Two flows work differently. Paying an a2a-pay link signs whatever the link declares, with no preview of its own, and the subscription commands have no confirming gate of their own. Check the seller and the offer yourself first.
Can I try it without paying?
SKILL.md and its references describe no test mode or sandbox. Treat every payment as real, and start with a small amount on a wallet that holds little.
Can I use my own private key instead of the OKX wallet?
For the quote-and-pay path, yes, through pay-local, which reads EVM_PRIVATE_KEY from the environment or ~/.onchainos/.env. The reference warns that this key is not protected by the enclave and tells you to lock the file down. Sessions and MPP charges need the wallet login.
Does it work with Claude Code only?
The README documents the installer, which sets up the skills, and shows a Claude Code MCP command for the CLI. It names no other client for this skill, so check the install box for the targets we list.
How is it different from OKX Agentic Wallet?
The wallet skill manages balances, sends, swaps and bridges. This skill handles paying for 402 endpoints, payment links and subscriptions, and leans on the wallet for login, balance and funding.
Information
updated Nov 2, 2026
- Repository
- okx/onchainos-skills
- Folder
skills/okx-agent-payments-protocol
Sources
Docs, issue trackers and discussions this page is built from.
Show all 8Hide
- onchainos-skills README · github.com
- SKILL.md · github.com
- session.md · github.com
- subscription.md · github.com
- a2a_charge.md · github.com
- accepts-schemes.md · github.com
- charge.md · github.com
- a2mcp-mcp.md · github.com