Command Palette

Search for a command to run...

Назад к скиллам
скилл № 30528

http-402-internet-native-payments

Internet-native payments using the HTTP 402 Payment Required standard. Set up as a buyer to pay for API access, or as a seller to monetize your APIs.

БесплатноБез исполняемых скриптов
rondoflowот rondoflow★ 37 звёзд на GitHub

Установить http-402-internet-native-payments в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

x402 Payment Protocol

x402 is an open, internet-native payment standard built around the HTTP 402 Payment Required status code. It enables programmatic payments between clients and servers without accounts, sessions, or credential management.

Key Benefits:

  • Zero protocol fees (only blockchain network fees)
  • Zero friction (no accounts or KYC required)
  • Instant settlement via stablecoins
  • Works with AI agents and automated systems

Documentation: https://docs.x402.org | GitHub: https://github.com/coinbase/x402


How x402 Works

  1. Client requests a resource from a server
  2. Server responds with 402 Payment Required + payment instructions
  3. Client signs and submits a payment payload
  4. Server verifies payment, optionally via a facilitator
  5. Server returns the requested resource

Environment Variables

For Buyers (Clients)

# EVM wallet private key (Ethereum/Base/Polygon)
EVM_PRIVATE_KEY=0x...

# Solana wallet private key (base58 encoded)
SVM_PRIVATE_KEY=...

# Target server URL
RESOURCE_SERVER_URL=http://localhost:4021
ENDPOINT_PATH=/weather

For Sellers (Servers)

# Your EVM wallet address to receive payments
EVM_ADDRESS=0x...

# Your Solana wallet address to receive payments
SVM_ADDRESS=...

# Facilitator URL (see list below)
FACILITATOR_URL=https://x402.org/facilitator

Network Identifiers (CAIP-2)

Network CAIP-2 ID Description
Base
Base Mainnet eip155:8453 Base L2 mainnet
Base Sepolia eip155:84532 Base L2 testnet
Solana
Solana Mainnet solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp Solana mainnet
Solana Devnet solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1 Solana testnet
Polygon
Polygon Mainnet eip155:137 Polygon PoS mainnet
Polygon Amoy eip155:80002 Polygon testnet
Avalanche
Avalanche C-Chain eip155:43114 Avalanche mainnet
Avalanche Fuji eip155:43113 Avalanche testnet
Sei
Sei Mainnet eip155:1329 Sei EVM mainnet
Sei Testnet eip155:713715 Sei EVM testnet
X Layer
X Layer Mainnet eip155:196 OKX L2 mainnet
X Layer Testnet eip155:1952 OKX L2 testnet
SKALE
SKALE Base eip155:1187947933 SKALE mainnet
SKALE Base Sepolia eip155:324705682 SKALE testnet

Facilitators

Facilitators handle payment verification and blockchain settlement. Choose one:

Name URL Notes
x402.org https://x402.org/facilitator Default, testnet only
Coinbase https://api.cdp.coinbase.com/platform/v2/x402 Production
PayAI https://facilitator.payai.network Production
Corbits https://facilitator.corbits.dev Production
x402rs https://facilitator.x402.rs Production
Dexter https://x402.dexter.cash Production
Heurist https://facilitator.heurist.xyz Production
Kobaru https://gateway.kobaru.io Production
Mogami https://facilitator.mogami.tech Production
Nevermined https://api.live.nevermined.app/api/v1/ Production
Openfacilitator https://pay.openfacilitator.io Production
Solpay https://x402.solpay.cash Production
Primer https://x402.primer.systems Production
xEcho https://facilitator.xechoai.xyz Production

Buyer Examples (Client)

TypeScript with fetch

Install dependencies:

npm install @x402/fetch @x402/evm @x402/svm viem @solana/kit @scure/base dotenv

Code:

import { config } from "dotenv";
import { x402Client, wrapFetchWithPayment, x402HTTPClient } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { registerExactSvmScheme } from "@x402/svm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
import { createKeyPairSignerFromBytes } from "@solana/kit";
import { base58 } from "@scure/base";

config();

const evmPrivateKey = process.env.EVM_PRIVATE_KEY as `0x${string}`;
const svmPrivateKey = process.env.SVM_PRIVATE_KEY as string;
const url = `${process.env.RESOURCE_SERVER_URL}${process.env.ENDPOINT_PATH}`;

async function main(): Promise<void> {
  const evmSigner = privateKeyToAccount(evmPrivateKey);
  const svmSigner = await createKeyPairSignerFromBytes(base58.decode(svmPrivateKey));

  const client = new x402Client();
  registerExactEvmScheme(client, { signer: evmSigner });
  registerExactSvmScheme(client, { signer: svmSigner });

  const fetchWithPayment = wrapFetchWithPayment(fetch, client);

  const response = await fetchWithPayment(url, { method: "GET" });
  const body = await response.json();
  console.log("Response:", body);

  if (response.ok) {
    const paymentResponse = new x402HTTPClient(client).getPaymentSettleResponse(
      name => response.headers.get(name)
    );
    console.log("Payment:", JSON.stringify(paymentResponse, null, 2));
  }
}

ma
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • manifest.json

FAQ

Что делает скилл http-402-internet-native-payments?

Internet-native payments using the HTTP 402 Payment Required standard. Set up as a buyer to pay for API access, or as a seller to monetize your APIs.

Как установить скилл http-402-internet-native-payments?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл http-402-internet-native-payments запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить http-402-internet-native-payments с