primer-x402
Make HTTP-native crypto payments using the x402 protocol. Pay for APIs, access paid resources, and handle 402 Payment Required responses with USDC on Base and other EVM chains.
Why use this skill?
Enable your AI agent to pay for APIs and premium resources automatically using the x402 protocol and USDC. Secure, gasless, and efficient payments for OpenClaw.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/primersystems2357/primer-x402What This Skill Does
The primer-x402 skill brings native crypto payment capabilities to your AI agent, allowing it to interact with the emerging ecosystem of pay-per-use APIs and resources. Built on the x402 protocol, this skill enables your agent to programmatically handle the '402 Payment Required' HTTP status code. When an agent attempts to access a restricted resource, the skill automatically intercepts the payment requirements, facilitates a secure transaction using USDC on EVM-compatible chains like Base, and retries the request with the necessary authorization. This allows agents to autonomously subscribe to premium data streams, cloud compute resources, or paywalled content without human intervention.
Installation
To integrate this skill, navigate to your project root and run:
clawhub install openclaw/skills/skills/primersystems2357/primer-x402
Once installed, initialize the environment using the CLI: x402 openclaw init. This command sets up the local configuration, creates a dedicated payment wallet, and provides a wallet address for you to fund with USDC. Ensure your environment variables are configured with your X402_PRIVATE_KEY for production payment signing.
Use Cases
- Autonomous Research: Your agent can pay for access to premium news, financial data APIs, or research journals that implement paywalls.
- Distributed Compute: Automatically provision paid GPU or serverless function credits to perform heavy analysis tasks.
- Resource Management: Manage recurring API subscriptions by programmatically handling balance checks and payment renewals for third-party services.
- Error Recovery: Gracefully handle failed requests by identifying that a payment is required, allowing the agent to continue its workflow rather than stalling.
Example Prompts
- "I'm hitting a 402 error on the analytics API, can you check the price and pay for it if it's under $0.50?"
- "Check my current x402 wallet balance and see if I have enough to pay for today's data fetch."
- "Run a probe on this API endpoint to find out exactly how much it costs to access."
Tips & Limitations
- Funding: Always ensure your agent's wallet has sufficient USDC on the target network before initiating payment-heavy tasks.
- Dry Runs: Utilize the
--dry-runflag in the CLI to verify costs before committing to a transaction, preventing unexpected spending. - Security: Treat your
X402_PRIVATE_KEYwith extreme caution. It should never be hardcoded; use environment variables or a secure key management system. - Supported Chains: The protocol focuses on EVM chains like Base, Ethereum, and Arbitrum. Confirm that the specific resource you are trying to access is compatible with your current network settings.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-primersystems2357-primer-x402": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, file-write, external-api