{"skill":{"slug":"pay-for-service-2","displayName":"Pay For Service","summary":"Access paid API endpoints and content using the x402 payment protocol. Use when you or the user want to call a paid API, access gated content, make an x402 p...","description":"---\nname: pay-for-service\ndescription: Access paid API endpoints and content using the x402 payment protocol. Use when you or the user want to call a paid API, access gated content, make an x402 payment, use a paid service, or retrieve content that requires payment. Covers \"fetch this paid resource\", \"access x402 content\", \"pay for this API call\".\nuser-invocable: true\ndisable-model-invocation: false\nallowed-tools: [\"Bash(fdx status*)\", \"Bash(fdx call getX402Content*)\", \"Bash(fdx call authorizePayment*)\", \"Bash(fdx call getWalletOverview*)\"]\n---\n\n# Paying for Services (x402)\n\nUse the Finance District wallet to access paid API endpoints and gated content via the x402 HTTP payment protocol. The wallet handles payment authorization and signing automatically — the agent fetches the content in a single call.\n\n## How x402 Works\n\nx402 is an HTTP-native payment protocol:\n\n1. A server returns HTTP 402 with payment requirements\n2. The wallet signs a payment and retries the request with a payment header\n3. The facilitator verifies and settles the payment\n4. The server returns the content\n\nThe Finance District wallet supports x402 payments on multiple chains and assets, not just a single network.\n\n## Confirm wallet is authenticated\n\n```bash\nfdx status\n```\n\nIf the wallet is not authenticated, refer to the `authenticate` skill.\n\n## Check Balance\n\nEnsure the wallet has sufficient funds to cover the payment:\n\n```bash\nfdx call getWalletOverview\n```\n\n## Fetching Paid Content\n\n### getX402Content — Fetch content from a paid endpoint\n\nThe primary command for accessing x402 resources. It discovers payment requirements, authorizes payment, and retrieves the content in one step:\n\n```bash\nfdx call getX402Content --url <endpoint-url>\n```\n\n#### Parameters\n\n| Parameter                | Required | Description                                           |\n| ------------------------ | -------- | ----------------------------------------------------- |\n| `--url`                  | Yes      | The x402-enabled endpoint URL                         |\n| `--preferredNetwork`     | No       | Preferred chain ID for payment (e.g. `8453` for Base) |\n| `--preferredNetworkName` | No       | Preferred chain name (e.g. `base`, `ethereum`)        |\n| `--preferredAsset`       | No       | Preferred payment asset (e.g. `USDC`)                 |\n| `--maxPaymentAmount`     | No       | Maximum payment amount to authorize                   |\n\n### authorizePayment — Pre-authorize a payment\n\nFor cases where you want to inspect payment requirements or authorize without fetching:\n\n```bash\nfdx call authorizePayment --url <endpoint-url>\n```\n\n#### Parameters\n\nSame as `getX402Content`.\n\n## Examples\n\n```bash\n# Fetch content from a paid API (auto-discovers requirements and pays)\nfdx call getX402Content \\\n  --url https://api.example.com/premium/data\n\n# Prefer paying with USDC on Base\nfdx call getX402Content \\\n  --url https://api.example.com/premium/data \\\n  --preferredNetworkName base \\\n  --preferredAsset USDC\n\n# Set a max payment cap\nfdx call getX402Content \\\n  --url https://api.example.com/premium/data \\\n  --maxPaymentAmount 1000000\n\n# Just authorize without fetching\nfdx call authorizePayment \\\n  --url https://api.example.com/premium/data\n```\n\n## Flow\n\n1. Check authentication with `fdx status`\n2. Check wallet balance with `fdx call getWalletOverview`\n3. Call `fdx call getX402Content --url <endpoint>` to fetch paid content\n4. If the payment amount seems high, use `fdx call authorizePayment` first to inspect, then confirm with the human before proceeding\n5. Return the fetched content to the human\n\n**Important:** Always inform your human about the payment before executing, especially for unfamiliar endpoints or amounts that seem high. Let them confirm they want to proceed.\n\n## Difference from Coinbase x402\n\nThe Finance District wallet supports **multi-chain and multi-asset** x402 payments. You can specify a preferred network and asset, giving flexibility to pay from whichever chain and token has available balance. Coinbase's implementation is limited to Base USDC.\n\n## Prerequisites\n\n- Must be authenticated (`fdx status` to check, see `authenticate` skill)\n- Wallet must have sufficient balance in the required payment asset on the required network\n- If insufficient funds, suggest using the `fund-wallet` skill or `swap-tokens` skill\n\n## Error Handling\n\n- \"Not authenticated\" — Run `fdx setup` first, or see `authenticate` skill\n- \"Insufficient balance\" — Check balance; see `fund-wallet` skill\n- \"No x402 payment requirements found\" — The URL may not be an x402-enabled endpoint\n- \"Payment failed\" — May be a network issue; retry or try a different preferred network\n","tags":{"latest":"0.1.0"},"stats":{"comments":0,"downloads":690,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1773031734067,"updatedAt":1779077820969},"latestVersion":{"version":"0.1.0","createdAt":1773031734067,"changelog":"Initial release of pay-for-service-2 skill.\n\n- Enables access to paid API endpoints and gated content using the x402 payment protocol.\n- Supports one-step payment and content retrieval with getX402Content, and separate payment authorization with authorizePayment.\n- Allows payment from multi-chain, multi-asset Finance District wallet (not limited to Base/USDC).\n- Includes flows for authentication, balance checking, payment authorization, and error handling.\n- User instructions and command examples provided for fetching and paying for resources.","license":"MIT-0"},"metadata":null,"owner":{"handle":"rachidjarray-hk-qa-fdt","userId":"s172yy311dfxd4jhew164jveqs884sf3","displayName":"Rachid Jarray","image":"https://avatars.githubusercontent.com/u/111736103?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780089809506}}