# Okx Agent Payments Protocol

Use when an agent hits HTTP 402 / payment-required, or the user mentions x402...

- Repository: https://github.com/internet-court/internet-court-skill (7050 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-10-26
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add internet-court/internet-court-skill --skill okx-agent-payments-protocol -g -a claude-code -y`
Codex: `npx skills add internet-court/internet-court-skill --skill okx-agent-payments-protocol -g -a codex -y`
Cursor: `npx skills add internet-court/internet-court-skill --skill okx-agent-payments-protocol -g -a cursor -y`
Gemini CLI: `npx skills add internet-court/internet-court-skill --skill okx-agent-payments-protocol -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add internet-court/internet-court-skill`

## 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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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 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.

The rest: https://github.com/internet-court/internet-court-skill/blob/HEAD/vendored/okx/okx-agent-payments-protocol/SKILL.md
