build-x402-client
Skill by coinbase
Build A client that pays for HTTP APIs returning 402 Payment Required, using the x402 protocol and a CDP-managed wallet. It covers TypeScript and Python and is aimed at developers calling paid endpoints from their own app or agent.
Install build-x402-client
Built from the published package, never by AI.
git clone --depth 1 https://github.com/coinbase/cdp-sdk /tmp/cdp-sdk && mkdir -p ~/.claude/skills && cp -r /tmp/cdp-sdk/skills/build-x402-client ~/.claude/skills/build-x402-clientRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/coinbase/cdp-sdk /tmp/cdp-sdk && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/cdp-sdk/skills/build-x402-client ~/.gemini/antigravity-cli/skills/build-x402-clientAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill guides an assistant through writing code that pays for HTTP APIs that answer 402 Payment Required. It uses the x402 protocol and a wallet managed by Coinbase Developer Platform (CDP). The skill first detects the language, HTTP client and transport from the project, then confirms the CDP API key and wallet secret. It installs the matching packages and writes a client that answers 402 responses automatically.
The default network is Base testnet, and the skill says not to move to Base mainnet unless the user asks in the current turn. The client is then funded with testnet USDC from the CDP faucet, and a successful call returns HTTP 200. The source says it is for developers who want to call a paid endpoint from their own application or agent, add x402 payments to an HTTP client, or migrate off a raw private key.
Written from the project's SKILL.md and checked against it.
What it can do
- Language and client detectionChooses TypeScript or Python and the HTTP client from the project's dependencies and files.
- Credential checkConfirms CDP_API_KEY_ID, CDP_API_KEY_SECRET and CDP_WALLET_SECRET are set before installing.
- Dependency installLists the x402 and CDP SDK packages to install for fetch, axios, MCP, httpx or requests.
- TypeScript clientWrites a CdpX402Client setup wrapped around fetch, with a route to axios and MCP variants.
- Python clientWrites an async CdpClient setup with x402Client and x402HttpxClient, plus a requests variant.
- Testnet fundingRequests Base Sepolia USDC from the CDP faucet for the wallet address the client prints.
- VerificationRe-runs the client and treats HTTP 200 as proof that the payment settled and the resource returned.
- Troubleshooting tableLists common 402, TypeError, wallet authentication and network mismatch errors with fixes.
What you need
- CDP API key
- CDP wallet secret
- Node.js 22 or later, or Python 3.10 or later
- USDC on Base Sepolia for testing
Try asking
- Write a TypeScript client that pays for https://x402.vercel.app/protected
- Add x402 payments to my Python httpx client using a CDP wallet
- Migrate my x402 client off a raw private key to CdpX402Client
Good to know
- The skill is for server-side code; end users paying from their own wallets need a different flow.
- Mainnet payments spend real USDC, so the default is testnet.
- There is no CdpX402Client in Python, so the client is assembled by hand.
- Node.js 22 or later or Python 3.10 or later is required.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/build-x402-client/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to build-x402-client
All alternatives →Lists live launchpad token feeds and AI-detected hot topics for meme tokens on BSC, Solana and Base. Covers new, finalizing and just-migrated tokens on launchpads such as Pump.fun and Four.meme.
The okx-market skill lets an AI assistant retrieve cryptocurrency market data from the OKX V5 REST API. It is aimed at users who want spot, derivatives and index data in Python without an account.
Calculates key SaaS health metrics such as ARR, churn, LTV and CAC from raw business numbers, then gives prioritized advice. Built for founders and finance leads who share revenue or customer figures.
Fetches U.S. SEC EDGAR data for research. It resolves a ticker to its CIK, lists recent filings with primary-document URLs, and pulls XBRL financial series. Built for analysts who need free, U.S.-only filing data.
Provides free, no-auth access to Eastmoney market data for A-shares, Hong Kong stocks and US stocks. It covers fund flows, dragon-tiger lists, financial statements and stock screening.
Reads and manages a user's QuickBooks business through Intuit's official MCP server. It answers finance questions from reports, invoices, customers, products and benchmarks, and completes approved actions.
Compare with meme-rush, okx-market or saas-metrics-coach
build-x402-client: common questions
Does this skill work with a CDP-managed wallet?
Yes. The skill is built around a CDP-managed wallet, and the TypeScript client provisions the wallet through CdpX402Client. The source says there is no key to store.
Which languages are covered?
The source covers TypeScript and Python. It tells the assistant to read only the subsection for the language it detected, because the two paths differ.
Is this skill for building a paid API instead?
No. The source says that a user who is charging for an API should use the build-x402-server skill instead.
How do I install build-x402-client?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is build-x402-client free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is build-x402-client safe to use?
It scores 74 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to build-x402-client?
Similar skills: meme-rush, okx-market, saas-metrics-coach, sec-edgar.
