okx-agent-payments-protocol
Use when an agent hits HTTP 402 / payment-required, or the user mentions x402, x402Version, X-PAYMENT, PAYMENT-REQUIRED, PAYMENT-SIGNATURE, WWW-Authenticate: Payment, permit2, upto, metered billing, a payment channel / voucher / session, channelId / channel_id, opening / closing / topping up / settling / refunding a channel, a paymentId or a2a_ link, creating / checking a payment link, A2MCP / an A2MCP endpoint, or sending a request to / calling an Agent's endpoint with a concrete endpoint URL. Covers x402 (exact, exact+Permit2, upto, aggr_deferred), MPP (charge / session), and a2a-pay payment
npx skills add internet-court/internet-court-skill --skill okx-agent-payments-protocol --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
The skill is a dispatcher for payments that triggers on HTTP 402 or related payment indicators (e.g., x402, X-PAYMENT, PAYMENT-REQUIRED, a2a-pay, etc.). It coordinates decoding of 402 payloads, building a parameter plan for replay, and guiding the user through a single confirmation card flow per payment. It supports three paths: session (channel-based), charge (one-shot), and a2a-pay (paymentId-based), and it references specific CLI commands and reference maps for each path. It enforces zero-user-text until the final confirmation card is shown and ensures a single confirmation card is emitted per payment, with exact user-facing terminology and internal routing details kept away from the user.
How it works
- When a response indicates a payment protocol (e.g., WWW-Authenticate: Payment or PAYMENT-REQUIRED with x402Version), it differentiates between v1/v2 formats and between session vs. one-shot flows.
- It may prompt the user to choose between session and one-shot if both are offered, otherwise proceeds to decode the appropriate payload.
- Step A3-Accepts decodes a base64-encoded v2 payload or uses the v1 JSON to extract the available accepts options for display, while preserving the raw payload for the actual CLI replay.
- Step A3-WWW-Authenticate decodes the header payload to gather intent (charge vs. session) and shows methodDetails like chainId, escrowContract, and other fields; it validates supported methods and expiry of challenges.
- Step A3-Params builds a plan of parameters to attach to the replay, sourced either from the decoded outputSchema/input or from explicit seller signals, with one plan entry per declared param.
- Step A3.5 (multi-scheme) engages only when two or more of exact, aggr_deferred, charge, period are present, and directs loading of references/multi-scheme guidance; otherwise, it proceeds to Step A4 with the chosen candidate.
When to use it
Use when an agent encounters HTTP 402 / payment-required or sees trigger words related to x402, X-PAYMENT, PAYMENT-REQUIRED, a2a-pay, or channel-based payment operations (opening/closing/top-up/settle/refund). The skill covers x402 variants (exact, exact+Permit2, upto, aggr_deferred), MPP (charge / session), and a2a-pay paymentId flows.
What it can touch
- Uses CLI commands like
payment pay --payload [--selected-index],payment subscription subscribe/access/change/cancel/cancel-pending/my-subscriptions/allowance-status,payment charge --challenge,payment session open/voucher/topup/close, andpayment a2a-pay create/pay/statusas references for routing. It relies on decoding headers and payloads and building a param plan; it does not itself perform the actual payment but guides the dispatcher to the correct flow.
Caveats
- The protocol relies on specific external literals (e.g., x402Version, WWW-Authenticate: Payment, PAYMENT-REQUIRED) and must present user-facing text only about the payment, confirmation options, and results; internal routing stays hidden.
- If a method in WWW-Authenticate is not supported (e.g., tempo, svm, stripe), the flow must stop.
- The instruction requires a single confirmation card per payment and prohibits narrating internal protocol detection to the user.
- The license is MIT, as declared in the skill metadata.
# OKX Agent Payments Protocol (Dispatcher) > **⚠️ READ FIRST — ZERO-TEXT-ON-TRIGGER + NEVER-SKIP-USER-GATES.** > > Between detecting a 402 (or any trigger word) and emitting the first user-facing card — the Step A3.5 recommendation card, or the Step A4 confirmation card — output **ZERO** user-visible text. No "received 402", no "triggered OKX Agent Payments Protocol", no "detected N schemes", no enumeration of schemes / networks / tokens / amounts, no "loading skill" — in any language (the same prohibition applies to the equivalent phrases in any other language). The skill-load tool call may run but emits no surrounding prose. > > Exactly **one** confirmation card runs per payment: A3.5's recommendation card (2+ candidates and user picks `yes`) OR A4's confirmation card (single candidate, OR user picked an alternative from A3.5's expanded list). Do NOT skip the applicable card under the pretext of "past user preference" / "streamlining" / "already confirmed once" — those preferences do not exist. Do NOT render both cards back-to-back with the same info — after `yes` on A3.5.5, go straight to Step A5. The next user-visible text after detection MUST be one of the two cards. Three pay
- Triggers (full list)
- Pre-flight Checks
- Command Routing & Reference map
- Step A1: Start from the original response
- 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
- Step A3.5: Multi-scheme recommendation (when applicable)
- Step A4: Display payment details and STOP
- Step A5: Check wallet status (only after the user explicitly confirms)
onchainos wallet status
What does the okx-agent-payments-protocol skill do?
Use when an agent hits HTTP 402 / payment-required, or the user mentions x402, x402Version, X-PAYMENT, PAYMENT-REQUIRED, PAYMENT-SIGNATURE, WWW-Authenticate: Payment, permit2, upto, metered billing, a payment channel / voucher / session, channelId / channel_id, opening / closing / topping up / settling / refunding a channel, a paymentId or a2a_ link, creating / checking a payment link, A2MCP / an A2MCP endpoint, or sending a request to / calling an Agent's endpoint with a concrete endpoint URL. Covers x402 (exact, exact+Permit2, upto, aggr_deferred), MPP (charge / session), and a2a-pay payment
How do I install it?
Run `npx skills add internet-court/internet-court-skill --skill okx-agent-payments-protocol --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From internet-court/internet-court-skill, a repository with 1,536 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.