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★ 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
- Client requests a resource from a server
- Server responds with
402 Payment Required+ payment instructions - Client signs and submits a payment payload
- Server verifies payment, optionally via a facilitator
- 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
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- 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), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…