okx-x402-payment

Signs x402 EIP-3009 payment authorizations to unlock HTTP 402 payment-gated resources.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/Nith567/xlayer-skills-arena --skill okx-x402-payment-nith567
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: okx-x402-payment
Source: https://github.com/Nith567/xlayer-skills-arena/tree/main/okx-x402-payment
Command: npx skills add https://github.com/Nith567/xlayer-skills-arena --skill okx-x402-payment-nith567

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When an API or web resource returns HTTP 402 Payment Required, you need to decode the payment payload, sign an EIP-3009 authorization, and replay the request with a payment header — a multi-step cryptographic flow that is tedious to perform manually. ## Core Features & Use Cases - 402 Payload Decoding: Parses the base64-encoded x402 payload and extracts network, amount, payTo, asset, and timeout parameters. - TEE or Local Signing: Signs via the OKX Onchain OS TEE wallet session, or falls back to local EIP-3009 signing with the user's own private key. - Header Assembly and Replay: Builds the PAYMENT-SIGNATURE or X-PAYMENT header based on x402Version and replays the original request. - Use Case: You request a paid API endpoint, receive HTTP 402, confirm the payment details, sign the authorization, and automatically retry the request to receive the gated content. ## Quick Start Ask the agent to fetch a URL that requires x402 payment and it will decode the 402 response, confirm the amount with you, sign the payment, and return the resource.

Frequently Asked Questions about okx-x402-payment

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I pay for an API that returns HTTP 402 Payment Required?▼

Send the original request, decode the base64 402 payload to extract network, amount, payTo, and asset, then sign with onchainos payment x402-pay. Attach the returned signature and authorization as a payment header and replay the request.

What is the x402 payment protocol?▼

x402 is an HTTP payment protocol where a server responds with HTTP 402 and a base64 JSON payload describing required payment. The client signs an EIP-3009 transferWithAuthorization and replays the request with a payment header to access the resource.

Can I sign an x402 payment without an OKX wallet?▼

Yes, the local signing fallback lets you sign EIP-3009 typed data with your own private key using ethers.js. The key never leaves your machine, but the token contract must support EIP-3009 transferWithAuthorization.

Which blockchains does x402 payment signing support?▼

Only EVM chains identified in CAIP-2 format such as eip155:1 for Ethereum, eip155:196 for X Layer, and eip155:8453 for Base. Non-EVM chains like Solana, Tron, Ton, and Sui are not supported.

Why did my x402 payment get rejected as expired?▼

The authorization has a validBefore timestamp set to now plus maxTimeoutSeconds, defaulting to 300 seconds. If the server rejects it as expired, sign a fresh authorization with a new nonce and replay the request.