/install agnicpay-pay-for-service
Paying for x402 Services
Use npx agnic@latest x402 pay to call x402-enabled API endpoints with automatic USDC payment on Base.
Authentication
Run npx agnic@latest status --json to verify. If not authenticated:
- Headless (CI/server/agent): Set
AGNIC_TOKENenv var or pass--token \x3Ctoken> - Interactive (has browser): Run
npx agnic@latest auth login
See the authenticate-wallet skill for details.
Command Syntax
npx agnic@latest x402 pay \x3Curl> [-X \x3Cmethod>] [-d \x3Cjson>] [-q \x3Cparams>] [-h \x3Cjson>] [--max-amount \x3Cn>] [--json]
See reference/x402-protocol.md for full options, USDC amounts, and input validation rules.
Workflow
-
Check requirements (optional but recommended):
npx agnic@latest x402 details \x3Curl>Shows price, method, and schema without making a payment.
-
Verify balance:
npx agnic@latest balance --network base -
Make the paid request:
npx agnic@latest x402 pay \x3Curl> --json
Examples
# GET request (auto-pays)
npx agnic@latest x402 pay https://example.com/api/weather --json
# POST request with body
npx agnic@latest x402 pay https://example.com/api/sentiment -X POST -d '{"text": "I love this product"}' --json
# Limit max payment to $0.10
npx agnic@latest x402 pay https://example.com/api/data --max-amount 100000 --json
Prerequisites
- Must be authenticated (
npx agnic@latest statusto check) - Wallet must have sufficient USDC balance on Base
Error Handling
Common errors:
- "Not authenticated" -- Run
npx agnic@latest auth loginor setAGNIC_TOKEN - "Insufficient balance" -- Fund wallet with USDC (
npx agnic@latest balanceto check) - "No X402 payment requirements found" -- URL may not be an x402 endpoint
- Invalid JSON in
--data-- Ensure the body is valid JSON before passing - HTTP 4xx/5xx from the API -- Show the status code and response body to the user
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install agnicpay-pay-for-service - After installation, invoke the skill by name or use
/agnicpay-pay-for-service - Provide required inputs per the skill's parameter spec and get structured output
What is Agnic Pay for Service?
Make paid requests to x402-enabled APIs using USDC on Base. Use when the user explicitly asks to call a paid API, make an x402 payment, pay for a request, or... It is an AI Agent Skill for Claude Code / OpenClaw, with 104 downloads so far.
How do I install Agnic Pay for Service?
Run "/install agnicpay-pay-for-service" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Agnic Pay for Service free?
Yes, Agnic Pay for Service is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Agnic Pay for Service support?
Agnic Pay for Service is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Agnic Pay for Service?
It is built and maintained by Agnic.AI (@agnicpay-prog); the current version is v2.0.2.