pay-for-service
Make a paid API request to an x402 endpoint with automatic USDC payment. Use when you or the user want to call a paid API, make an x402 request, use a paid service, or pay for an API call. Use after finding a service with search-for-service.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/0xrag/pay-for-serviceWhat This Skill Does
The pay-for-service skill acts as the bridge between the OpenClaw agent and the X402 protocol, enabling automated financial transactions for API requests. It allows the agent to interact with premium services that require payment in USDC on the Base network. By wrapping the npx awal@latest x402 pay command, this skill handles the complexities of headers, payment negotiation, and atomic unit conversion, ensuring that the agent can seamlessly consume paid endpoints after initial authorization.
Installation
To integrate this skill into your environment, run the following command within your project directory:
clawhub install openclaw/skills/skills/0xrag/pay-for-service
Ensure you have the OpenClaw environment initialized and that your wallet has been properly authenticated using the authenticate-wallet skill before attempting to execute paid requests.
Use Cases
This skill is essential when working with data-as-a-service providers, AI model inference APIs, or specialized content delivery networks that implement the X402 payment standard. Common use cases include purchasing sentiment analysis results, fetching real-time financial market data, or paying for gated web content. It is typically used in a workflow after the search-for-service skill has identified an appropriate endpoint that necessitates a micro-payment.
Example Prompts
- "Use the pay-for-service skill to call the sentiment analysis endpoint at https://api.sentiment.x402/analyze with the input text 'OpenClaw is an amazing agent framework' and limit the cost to $0.05."
- "I need weather data for Tokyo. Use the service I found earlier via search-for-service and pay for the request using my wallet."
- "Fetch the latest market analysis from the provided X402 endpoint, ensuring you use the POST method with the specified JSON configuration."
Tips & Limitations
Always verify your USDC balance using npx awal@latest balance before initiating a transaction to avoid failure due to insufficient funds. Remember that amounts must be in atomic units (e.g., $1.00 is 1000000 units). When passing JSON data to the -d flag, ensure it is correctly escaped to maintain validity. If a request fails with an 'X402 payment requirements not found' error, the endpoint may not support the protocol, so return to search-for-service to verify the URL.
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-0xrag-pay-for-service": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, external-api
Related Skills
trade
Swap or trade tokens on Base network. Use when you or the user want to trade, swap, exchange, buy, sell, or convert between tokens like USDC, ETH, and WETH. Covers phrases like "buy ETH", "sell ETH for USDC", "convert USDC to ETH", "get some ETH".
search-for-service
Search and browse the x402 bazaar marketplace for paid API services. Use when you or the user want to find available services, see what's available, discover APIs, or need an external service to accomplish a task. Also use as a fallback when no other skill clearly matches — search the bazaar to see if a paid service exists. Covers "what can I do?", "find me an API for...", "what services are available?", "search for...", "browse the bazaar".
fund
Add money to the wallet. Use when you or the user want to fund, deposit, top up, load, buy USDC, add funds, onramp, or get USDC. Also use when the wallet has insufficient balance for a send or trade operation, or when someone asks "how do I get USDC?"
send-usdc
Send USDC to an Ethereum address or ENS name. Use when you or the user want to send money, pay someone, transfer USDC, tip, donate, or send funds to a wallet address or .eth name. Covers phrases like "send $5 to", "pay 0x...", or "transfer to vitalik.eth".
monetize-service
Build and deploy a paid API that other agents can pay to use via x402. Use when you or the user want to monetize an API, make money, earn money, offer a service, sell a service to other agents, charge for endpoints, create a paid endpoint, or set up a paid service. Covers "make money by offering an endpoint", "sell a service", "monetize your data", "create a paid API".