okx-agent-payments-protocol
Ce qu’il fait
Ce skill guide l'agent face aux services qui exigent un paiement avant de répondre, grâce à HTTP 402 et au protocole x402. Il s'adresse aux développeurs qui construisent des agents payant des appels d'API ou gérant des canaux de paiement.
Quand l’utiliser
- ✓Quand un agent reçoit une réponse HTTP 402 de demande de paiement de la part d'un service.
- ✓Quand vous devez ouvrir, recharger, régler ou rembourser un canal de paiement.
- ✓Quand vous voulez créer ou vérifier un lien de paiement pour un service payant.
Lien du skill
https://github.com/internet-court/internet-court-skill/blob/main/vendored/okx/okx-agent-payments-protocol/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Mon agent vient de recevoir une réponse 402 de demande de paiement d'une API. Peux-tu l'aider à payer et à relancer la requête ?”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
L'agent lit les détails de paiement dans la réponse, vous montre les options de paiement trouvées et vous demande de confirmer avant tout paiement. Il envoie ensuite la preuve de paiement et relance la requête.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis 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
Questions fréquentes
Paiera-t-il sans mon accord ?
Non. Le skill exige que vous confirmiez l'option de paiement avant tout mouvement d'argent.
Quels modes de paiement couvre-t-il ?
Il couvre les réponses 402 basées sur accepts, les défis Payment de WWW-Authenticate et les canaux de paiement.
Peut-il gérer les liens de paiement ?
Oui. Il peut créer et vérifier des liens de paiement ainsi que des canaux de paiement.
Détails
Description originale de l’auteur
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
Popularité
- Étoiles GitHub
- 7.0k
- Position au classement
- #13659
- Licence
- —
- Mis à jour
- 26/10/2026
Commentaires
- …
Autres skills de ce dépôt
internet-court
7.0kAide votre agent à payer ou traiter en toute sécurité avec un autre agent IA ou un service payant, et l'oriente vers le bon guide.
genlayer-erc7710-connector
7.0kAide votre agent à relier un résultat de revue IA à un système de permissions, afin qu'une mauvaise évaluation limite ou annule les permissions d'un agent.
genlayer-intelligent-contracts
7.0kAide votre agent à définir les règles, les preuves et les résultats d'un juge IA qui vérifie si un autre agent a respecté son mandat.
x402-erc7710
7.0kAide votre agent à payer des services web requête par requête, et à mettre en place des dépenses récurrentes dans la limite d'un budget d'autorisation.
Skills similaires
api-connector-builder
280kPermet à votre agent de créer de nouvelles connexions API en suivant le modèle existant. À utiliser pour ajouter une intégration sans inventer une nouvelle façon de faire.
api-design
280kAide votre agent à concevoir des API REST selon les bonnes pratiques. Utile pour définir la communication entre API, l'affichage des erreurs et l'organisation des données.
backend-patterns
280kAide votre agent avec les architectures côté serveur et l'optimisation des bases de données. Utile pour créer ou relire du code qui s'exécute sur le serveur.