second-state/x402/x402-payment
Claude Code and agent skill by second-state/x402
- community
Checking that the SKILL.md file is still in the repository.
Pay x402-compatible URLs by opening a local browser page for MetaMask signing. Use when a URL returns HTTP 402 or when you know a URL requires x402 payment.
Install
npx vskill@latest install second-state/x402/x402-paymentSKILL.md
x402 Payment Skill
When you need to access a URL that requires x402 payment (HTTP 402 Payment Required), use this skill to handle the full payment flow. The script opens a temporary browser page for the user to sign the payment with MetaMask, then retries the request with the signed payment header.
When to Use
- A URL returns HTTP 402 Payment Required
- The user asks you to pay for / access an x402-gated resource
- The user provides a URL that you know requires x402 payment
How to Invoke
Run the payment script using Bash:
Replace SKILL_DIR with the absolute path to this skill's directory.
Arguments
| Argument | Default | Description | |
|---|---|---|---|
url | (required) | The x402-compatible URL to call | |
--method | GET | HTTP method | |
--body | none | Request body as JSON string | |
--headers | none | Additional HTTP headers as JSON string | |
--timeout | 120 | Seconds to wait for MetaMask signing | |
--port | 18402 | Preferred port for the local signing server | |
--network | none | Filter payment options by network (e.g. eip155:84532 for Base Sepolia) | |
--cheapest | off | Auto-select the cheapest standard payment option (excludes batched/gateway schemes) |
What Happens
- The script calls the target URL
- If no 402 → returns the response directly (no payment needed)
- If 402 → opens a browser page showing payment details (amount, token, chain)
- User signs the payment in MetaMask
- Script retries the URL with the signed payment header
- Returns the final API response
The user must have MetaMask installed in their browser with a funded wallet.
Reading the Output
The script outputs a single JSON line to stdout:
Success (payment completed)
Success (no payment needed)
Failure
Error Scenarios
- Timeout: User did not complete signing within the timeout period
- User rejection: User clicked Reject in MetaMask (will show as timeout or error)
- API error after payment:
successwill be false, checkstatus_codeandbody - MetaMask not installed: Script will time out; stderr will note the browser was opened
Example
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/x402-payment/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/second-state/x402/x402-payment)