okx-agent-payments-protocol
What it does
This skill guides the agent through services that require payment before they respond, using HTTP 402 and the x402 protocol. It is for developers building agents that pay for API calls or manage payment channels.
When to use it
- βWhen an agent gets an HTTP 402 payment-required response from a service.
- βWhen you need to open, top up, settle, or refund a payment channel.
- βWhen you want to create or check a payment link for a paid service.
Skill link
https://github.com/internet-court/internet-court-skill/blob/main/vendored/okx/okx-agent-payments-protocol/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βMy agent just got a 402 payment-required response from an API. Can you help it pay and retry the request?β
5 new skills a week. 1 minute to read.
How it works
The agent reads the payment details in the response, shows you the payment options it found, and asks you to confirm before any payment is made. Then it sends the payment proof and retries the request.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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 / ro
FAQ
Will it pay without my approval?
No. The skill requires you to confirm the payment option before any money moves.
Which payment methods does it cover?
It covers accepts-based 402 responses, WWW-Authenticate Payment challenges, and payment channels.
Can it handle payment links?
Yes. It can create and check payment links as well as payment channels.
Details
Original description by the author
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
Popularity
- GitHub stars
- 7.0k
- Ranking position
- #13659
- License
- β
- Updated
- 10/26/2026
Comments
- β¦
More skills from this repository
internet-court
7.0kHelps your agent pay, hire, or deal safely with another AI agent or paid service, and points it to the right specialized guide.
genlayer-erc7710-connector
7.0kHelps your agent connect an AI review result to a permission system, so a bad review can limit or cancel an agent's permissions.
genlayer-intelligent-contracts
7.0kHelps your agent define the rules, evidence and outputs of an AI judge that checks whether another agent followed its mandate.
x402-erc7710
7.0kHelps your agent pay for web services one request at a time, and set up ongoing spending that stays within a permission budget.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.