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 / settl…
Install / Use
npx skills add internet-court/internet-court-skill --skill okx-agent-payments-protocolInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Finance & AccountingSupported Platforms
Our assessment of okx-agent-payments-protocol
okx-agent-payments-protocol scores 96/100 on our quality scale, 5th of 61 Finance & Accounting skills we index (top 9%).
Its SKILL.md is 32 KB long, well organised into 30 sections with 6 code examples: a thorough specification that gives an agent plenty to work with.
With 6,129 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 39 days ago, so okx-agent-payments-protocol is actively maintained.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
okx-agent-payments-protocol compared with similar skills
All 4 of these similar skills score higher than okx-agent-payments-protocol; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| okx-agent-payments-protocol (this skill)by internet-court | 96 | 6.1k | 39d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 85.9k | 12d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 74.0k | 1d ago | CLAUDE.md |
| rufloby ruvnet | 100 | 73.4k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.1k | today | CLAUDE.md |
Frequently asked questions
- How do I install okx-agent-payments-protocol?
- Run
npx skills add internet-court/internet-court-skill --skill okx-agent-payments-protocol. The install tabs above show the steps for each supported agent. - Which AI agents does okx-agent-payments-protocol work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is okx-agent-payments-protocol safe to use?
- It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is okx-agent-payments-protocol still maintained?
- The repository was last updated 39 days ago, so okx-agent-payments-protocol is actively maintained.
Skill content
View source on GitHubname: okx-agent-payments-protocol
description: "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 paymentId flows. Any close / topup / settle / voucher / refund near a channel_id or session is an MPP mid-session op. Two-phase quote/pay: payment quote, payment pay --payment-id, decode-receipt. The full bilingual trigger list (including Chinese) lives in the skill body."
license: MIT
metadata:
author: okx
version: "4.4.10"
homepage: "https://web3.okx.com"
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 — afteryeson A3.5.5, go straight to Step A5. The next user-visible text after detection MUST be one of the two cards.
Three payment paths, distinguished by HTTP signature: accepts-based 402 (challenge in body for v1 or PAYMENT-REQUIRED header for v2), WWW-Authenticate: Payment 402 (channel-capable, intent="charge" or "session"), and a2a-pay (paymentId-based, no 402). Shared steps below (detect → decode → confirm → wallet check), then dispatch to a reference.
User-facing terminology — IMPORTANT
Rule 1 — Always call it "OKX Agent Payments Protocol", and always render it bolded. Use the exact English term OKX Agent Payments Protocol in user-visible messages regardless of the user's language, and always wrap it in markdown bold (
**OKX Agent Payments Protocol**) so the user sees it emphasized. Keep it as a fixed English noun phrase even inside otherwise-Chinese sentences. Reserve protocol literals and internal identifiers for CLI invocations, HTTP headers, JSON payloads, and code — never speak them to the user.Rule 2 — Do not narrate internal protocol detection. The dispatch logic (which header was detected, which reference is being loaded, which scheme/intent was selected, TEE vs local-key path) is internal — keep it internal. The user only needs to see: (a) what is being paid, (b) what they need to confirm, (c) the result.
Rule 2 carve-out — narrow, alternatives list only. Inside Step A3.5, the literals
exact/aggr_deferred/chargemay be exposed to the user only in the expanded alternatives list (the list rendered after the user picks "show others"), because at that point the user is explicitly choosing between schemes. They MUST NOT appear in: the default recommendation card, the "N other methods" summary line, status narration, error displays, post-payment summaries, or anywhere else. The recommendation card shows network / token / amount / recipient only — never the scheme name.Rule 3 — Externally-defined protocol literals stay byte-for-byte exact. The JSON field
x402Version, the HTTP headersX-PAYMENT/PAYMENT-SIGNATURE/PAYMENT-REQUIRED/WWW-Authenticate: Payment, and the reference URLhttps://x402.orgMUST appear verbatim wherever the protocol/server requires them — these are externally defined and changing them breaks interop. CLI subcommand names (onchainos payment pay/pay-local/charge/session .../a2a-pay ...) are this CLI's own surface and may evolve; refer to them by their current name in CLI invocations and code, but never speak them to the user (Rule 2).Example
(EN)
Preparing a payment via the **OKX Agent Payments Protocol**. Here are the charge details — please confirm before I proceed…When narrating in another language, translate this lead line but keep OKX Agent Payments Protocol as a bolded English noun phrase.
Progress narration counts as user-visible — Rules 1-3 still apply.
Long-running flows (decode → confirm → wallet check → sign → replay) tempt status updates. Every progress line ("I'm now…", or its Chinese equivalent) is user-facing; Step labels and reference/scheme names are internal — do NOT echo them. The anchors:
| ❌ Don't say | ✅ Say | |---|---| | "Detected HTTP 402, triggering OKX Agent Payments Protocol" / "Detected
PAYMENT-REQUIRED, loadingexact" | (silent — detection / routing is internal) | | "CLI selectedexact, assembling thePAYMENT-SIGNATUREheader" / "taking the TEE path" | "Signing done, replaying the request" | | "Detected 2 schemes: exact (USD₮0), aggr_deferred (USDG)" / "checking balance to filter candidates" | (silent — enumeration + balance check are internal; only the recommendation card is user-visible) | | "Entering session / charge mode" | "Channel opened" — describe the user-visible effect, not the internal mode | | "Per past preference, paying without re-confirming" | (forbidden — no such preference; the gate is mandatory every time) |The same rules apply when narrating in any other language — match the intent of these ❌/✅ phrasings, not just the English wording.
These rules are authoritative and always in force — when unsure whether a status line leaks internals, match it against the rows above and default to silence.
Triggers (full list)
- EN:
402, payment required,x402,x402Version,X-PAYMENT,PAYMENT-REQUIRED,PAYMENT-SIGNATURE,WWW-Authenticate: Payment,permit2,upto, metered billing, open / close / topup / settle channel, voucher, session payment,channelId,channel_id,paymentId,a2a_, create payment link, payment link, payment status - subscribe / subscription / recurring payment / recurring charge / "pay every month" / cancel subscription / upgrade plan / downgrade plan →
periodscheme (seereferences/subscription.md)- ⚠️ EXCEPT when the message contains jobId / subId / ASP / provider / trial / renew / deliver / periodCount / subscription task — those are Agent Commerce subscription tasks (monthly service agreements), route to
okx-aiinstead.
- ⚠️ EXCEPT when the message contains jobId / subId / ASP / provider / trial / renew / deliver / periodCount / subscription task — those are Agent Commerce subscription tasks (monthly service agreements), route to
- The same trigger vocabulary applies to its equivalents in any other language (e.g. Chinese subscription / recurring-billing terms route to the
periodscheme the same way). - Carve-out: AI-service/ASP subscriptions from the agent marketplace (context: ASP / Agent#N / 任务 / 试用期 / 服务方; NO 402 offer / resource URL / paymentId) belong to okx-ai (onchainos agent my-subscriptions / subscribe-detail), NOT the period scheme. For a bare "my subscriptions / 我的订阅" with neither signal, ask the user once instead of assuming period.
Any close / topup / settle / voucher / refund near a channel_id or session context = MPP mid-session op → references/session.md.
Pre-flight Checks
Read ../okx-agentic-wallet/_shared/preflight.md (fallback: _shared/preflight.md).
Command Routing & Reference map
Each 402 signal (or paymentId) → CLI command → reference. Detailed gating + decode/confirm steps are in Path A / Path B below.
| Signal | Command | Reference |
|---|---|---|
| 402 + PAYMENT-REQUIRED (v2) / body x402Version (v1) — one or many accepts[] schemes (exact / exact+Permit2 / upto / aggr_deferred) | Primary — Path A: payment quote <url> → confirm → payment pay --payment-id --yes. Single-scheme and multi-scheme take the same quote flow (the CLI decodes, converts, balance-checks, signs, replays, and returns the receipt). Even if you already curled the raw 402, re-enter via payment quote <url> — never assemble a header by hand and never jump straight to sign-only. Compat only: payment pay --payload [--selected-index] (sign-only + manual replay) when quote is unavailable. | Success path loads no reference. references/accepts-schemes.md only for: post-pay scheme-specific receipt reading, Permit2 allowance insufficient one-time approve, pay-local, the pay --payload compat path, or legacy x402 v1 (the CLI-output field tells you which scheme — permit2Authorization = upto / exact+Permit2, sessionCert = aggr_deferred, authorization = exact) |
| 402 offer with an accepts[] entry whose scheme == "period" (a.k.a. permit2_subscription) — recurring/subscription billing | payment subscription subscribe/access/change/cancel/cancel-pending/my-subscriptions/allowance-status | references/subscription.md |
| 402 + WWW-Authenticate: Payment, intent="charge" | payment charge --challenge | references/charge.md |
| 402 + WWW-Authenticate: Payment, intent="session" (or mid-session channel_id) | payment session open/voucher/topup/close | references/session.md |
| paymentId / a2a_… link / create-or-check payment link | payment a2a-pay create/pay/status | references/a2a_charge.md |
| A2MCP / 402 endpoint URL, "pay this endpoint", entry A/B payment node | payment quote <url> [--param k=v ...] [--method GET \| POST \| ...] | (inline — Path A) |
| A2MCP MCP-transport endpoint (URL ends /mcp or /sse, returns text/event-stream / JSON-RPC, or you have a tool name) | payment quote <url> (discovery → mcpTools[]) → payment quote <url> --tool <name> --param k=v (trigger 402) → payment pay --payment-id <id> --yes | references/a2mcp-mcp.md |
| User confirmed the quoted payment (currency/amount/scheme chosen) | payment pay --payment-id <id> [--selected-index <n>] --yes | (inline — Path A) |
| Need to decode a PAYMENT-RESPONSE header or a charge receipt | payment decode-receipt (--header <b64> \| --receipt <json>) | (inline — read-only) |
Don't load a reference on the success path. On the primary Path A flow,
onchainos payment pay --payment-id --yessigns, replays, and returns the settled receipt directly — skipreferences/accepts-schemes.mdentirely (this holds for a singleaccepts[]scheme exactly as for multi-scheme). On the compatpay --payloadpath the CLI returns anauthorization_headeryou replay yourself — same rule, no reference on success. Loadreferences/accepts-schemes.mdonly on a failure / legacy path:Permit2 allowance insufficient→references/accepts-schemes.md(one-time approve), or a legacy x402 v1 raw proof → its "Legacy: x402 v1" section.charge/session/a2a_chargeare always loaded — those are multi-phase flows.
Channel mid-session ops (close / topup / settle / voucher / refund mentioned with an active
channel_id, regardless of fresh 402) → stay here, jump straight intoreferences/session.mdat the matching phase. Do NOT search for a separateclose-channel/topup-channel/settle-channeltool — they're allonchainos payment session ...subcommands.
Path A: HTTP 402
Path A (accepts-based): quote → confirm → pay — PREFERRED 2-round flow
**For an accepts-based 402 / A2MCP endpoint, the CLI does all m
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
85.9kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
74.0kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ruflo
73.4k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
CowAgent
47.1kOpen-source super AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
