[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-coinbase-build-x402-client":3,"mdc-27cr5k-key":38,"related-org-coinbase-build-x402-client":2411,"related-repo-coinbase-build-x402-client":2455},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":27,"repoUrl":28,"updatedAt":29,"license":30,"forks":31,"topics":32,"repo":33,"sourceUrl":36,"mdContent":37},"build-x402-client","implement x402 payment client for HTTP APIs","Write code that pays for an HTTP API returning 402 Payment Required, using the x402 protocol and\na CDP-managed wallet. Covers TypeScript and Python. Use when the user wants to call a paid\nendpoint from their own application or agent, add x402 payments to an HTTP client, hit an API\nthat charges per request, migrate an existing x402 client off a raw private key, or is stuck on\nan unexpected 402 response.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"coinbase","Coinbase","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fcoinbase.png",[12,16,18,21,24],{"name":13,"slug":14,"type":15},"TypeScript","typescript","tag",{"name":17,"slug":17,"type":15},"x402",{"name":19,"slug":20,"type":15},"Payments","payments",{"name":22,"slug":23,"type":15},"Python","python",{"name":25,"slug":26,"type":15},"API Development","api-development",189,"https:\u002F\u002Fgithub.com\u002Fcoinbase\u002Fcdp-sdk","2026-08-06T06:09:11.226639",null,181,[],{"repoUrl":28,"stars":27,"forks":31,"topics":34,"description":35},[],"Client libraries for managing EVM and Solana wallets while relying on CDP to secure private keys.","https:\u002F\u002Fgithub.com\u002Fcoinbase\u002Fcdp-sdk\u002Ftree\u002FHEAD\u002Fskills\u002Fbuild-x402-client","---\nname: build-x402-client\ndescription: |\n  Write code that pays for an HTTP API returning 402 Payment Required, using the x402 protocol and\n  a CDP-managed wallet. Covers TypeScript and Python. Use when the user wants to call a paid\n  endpoint from their own application or agent, add x402 payments to an HTTP client, hit an API\n  that charges per request, migrate an existing x402 client off a raw private key, or is stuck on\n  an unexpected 402 response.\ncompatibility: Requires a CDP API key and wallet secret. Node.js >= 22 (TypeScript) or Python >= 3.10.\nmetadata:\n  author: cdp@coinbase.com\n  version: \"0.1.0\"\n---\n\n# Build an x402 client\n\nTake the user from nothing to one successful paid API call: resolve a CDP-managed wallet, wrap\ntheir HTTP client so it answers `402` automatically, fund the wallet on testnet, verify with a\n`200`.\n\nResolve the Decisions table below before writing any code, then read only the language subsection\nyou resolved to in step 3. This file covers TypeScript and Python; reading both will blend them.\n\n## When not to use this skill\n\n- **The user's end users should pay from their own wallets.** That is\n  [x402 payments with User Wallets](https:\u002F\u002Fdocs.cdp.coinbase.com\u002Fwallets\u002Fusing-wallets\u002Fx402-payments),\n  a browser flow, not this server-side one.\n- **The user wants an agent to spend money now, without writing code.** Use the agentic-wallet\n  [pay-for-service](https:\u002F\u002Fdocs.cdp.coinbase.com\u002Fagentic-wallet\u002Fcli\u002Fskills\u002Fpay-for-service) skill,\n  which drives the `awal` CLI. It is the nearest neighbour to this skill and the most likely\n  mis-selection.\n- **The user is the one charging.** Use the `build-x402-server` skill.\n- **The user needs to construct and sign a payment by hand** (`signX402Payment`, custom retry\n  logic). Out of scope here; see\n  [Client configuration](https:\u002F\u002Fdocs.cdp.coinbase.com\u002Fx402\u002Fbuyer\u002Fclient-configuration).\n\n## Decisions\n\nResolve every row before writing code. Detect first; only ask when detection is ambiguous.\n\n| Decision       | How to detect                                                                                    | Ask only if                | Default                  |\n| -------------- | ------------------------------------------------------------------------------------------------ | -------------------------- | ------------------------ |\n| Language       | `package.json` -> TypeScript. `pyproject.toml` \u002F `requirements.txt` -> Python.                   | Both present, or neither   | Ask                      |\n| HTTP client    | TS: `axios` in deps -> axios, else `fetch`. Python: `httpx` or any `async def` -> httpx, `requests` -> requests. | No HTTP client in deps     | TS `fetch`, Python httpx |\n| Network        | `environment: \"development\"` selects Base testnet.                                               | Never assume mainnet       | `development`            |\n| Transport      | An MCP server URL or an existing MCP client -> MCP variant. A plain URL -> HTTP.                 | Unclear what the target is | HTTP                     |\n| Starting point | An existing x402 client holding a raw private key -> migration path.                             | —                          | Fresh integration        |\n\nThe network row is a hard rule, not a preference: **never move the user to Base mainnet unless they\nask for it in the current turn**, because mainnet payments spend real USDC.\n\n## Steps\n\n### 1. Confirm credentials\n\nBefore installing anything, check that the environment has all three of `CDP_API_KEY_ID`,\n`CDP_API_KEY_SECRET`, and `CDP_WALLET_SECRET`. The API key authenticates the caller to CDP; the\nwallet secret is what lets the SDK sign payments. Missing either one fails at runtime, and it is a\nworse experience to discover that three steps in. Send the user to\n[API key authentication](https:\u002F\u002Fdocs.cdp.coinbase.com\u002Fwallets\u002Fquickstart\u002Fapi-key-auth) if they have\nno key yet. Also confirm the runtime: Node.js 22 or later, or Python 3.10 or later.\n\n### 2. Install\n\nPick the dependencies matching the Decisions table. `@x402\u002Fcore`, `@x402\u002Fevm`, `@x402\u002Fsvm`, and\n`@x402\u002Fextensions` are optional peer dependencies of the CDP SDK, so they are not installed for you,\nand all four are needed even for an EVM-only integration because `@coinbase\u002Fcdp-sdk\u002Fx402` imports\nthem at module load.\n\nFor TypeScript, use the package manager already configured in the project. If none is configured,\nuse npm. Install:\n\n- **fetch:** `@coinbase\u002Fcdp-sdk`, `@x402\u002Fcore`, `@x402\u002Fevm`, `@x402\u002Fsvm`,\n  `@x402\u002Fextensions`, and `@x402\u002Ffetch`\n- **axios:** the same packages with `@x402\u002Faxios` instead of `@x402\u002Ffetch`, plus `axios`\n- **MCP:** the same packages with `@x402\u002Fmcp` instead of `@x402\u002Ffetch`, plus\n  `@modelcontextprotocol\u002Fsdk`\n\nFor Python, use the package manager already configured in the project. If none is configured, use\npip. Install:\n\n- **async:** `cdp-sdk` and `x402[evm,svm,httpx]`\n- **sync:** `cdp-sdk` and `x402[evm,svm,requests]`\n\n### 3. Write the client\n\nRead only the subsection matching the language resolved above.\n\n#### TypeScript\n\n`CdpX402Client` is the whole point of the TypeScript path. It provisions the wallet, registers the\npayment schemes, and already satisfies the signer interface the x402 wrappers expect, so it drops\ninto any of them unchanged.\n\n```typescript\nimport { CdpX402Client } from \"@coinbase\u002Fcdp-sdk\u002Fx402\";\nimport { wrapFetchWithPayment } from \"@x402\u002Ffetch\";\n\nconst client = new CdpX402Client({ environment: \"development\" });\n\n\u002F\u002F The wallet lives inside the client, so print the address to know what to fund.\nconst { evmAddress } = await client.getAddresses();\nconsole.log(`Paying from ${evmAddress}`);\n\nconst fetchWithPayment = wrapFetchWithPayment(globalThis.fetch, client);\nconst response = await fetchWithPayment(\"https:\u002F\u002Fx402.vercel.app\u002Fprotected\");\nconsole.log(`HTTP ${response.status}`);\n```\n\nThere is no key to store anywhere — that is the reason a developer reaches for CDP here, so say so\nrather than burying it.\n\nThree things that break first:\n\n- Top-level `await` needs ESM or an `async main()`. In a CommonJS project this is the first error.\n- Omitting `environment` means Base mainnet and real USDC.\n- `getAddresses()` also returns `svmAddress` for Solana. The field is `svmAddress`, not\n  `solanaAddress`.\n\n**axios:** same client object, different wrapper — `wrapAxiosWithPayment(axios.create(), client)`\nfrom `@x402\u002Faxios`, which returns a wrapped axios instance.\n\n**MCP:** paying for tool calls rather than routes, with `wrapMCPClientWithPayment(mcpClient,\nclient)` from `@x402\u002Fmcp`. See `clients\u002Fmcp\u002Fsimple.ts` below.\n\n**Migration:** swap whatever signer the existing `x402Client` holds for `CdpX402Client`; the call\nsites stay where they are. See `x402DevMigration.ts` below.\n\n#### Python\n\nThere is no `CdpX402Client` in Python, so assemble the pieces by hand rather than hunting for a\none-liner that does not exist.\n\n```python\nimport asyncio\n\nfrom cdp import CdpClient\nfrom cdp.evm_local_account import EvmLocalAccount\nfrom x402 import x402Client\nfrom x402.http.clients import x402HttpxClient\nfrom x402.mechanisms.evm import EthAccountSigner\nfrom x402.mechanisms.evm.exact import ExactEvmScheme\n\n\nasync def main() -> None:\n    async with CdpClient() as cdp:\n        account = await cdp.evm.get_or_create_account(name=\"x402-client-wallet-1\")\n        signer = EthAccountSigner(EvmLocalAccount(account))\n        print(f\"Paying from {signer.address}\")  # this is the address to fund\n\n        payment_client = x402Client()\n        payment_client.register(\"eip155:84532\", ExactEvmScheme(signer))\n\n        async with x402HttpxClient(payment_client) as http:\n            response = await http.get(\"https:\u002F\u002Fx402.vercel.app\u002Fprotected\")\n            await response.aread()\n\n        print(f\"HTTP {response.status_code}\")\n\n\nasyncio.run(main())\n```\n\n`EvmLocalAccount` and the x402 signer protocol declare `sign_typed_data` differently, and\n`EthAccountSigner` is what reconciles them. Writing the wrap explicitly is a readability choice\nrather than a requirement: `ExactEvmScheme` already auto-wraps anything that is an `eth_account`\n`BaseAccount`, which `EvmLocalAccount` is, so passing the account directly works too. Keep the\nexplicit form so the adaptation is visible. A type checker may flag it, since `EvmLocalAccount`\nsubclasses `BaseAccount` rather than `LocalAccount`; at runtime it is correct.\n\nThree things that break first:\n\n- `CdpClient` is an async context manager. Resolve the account inside `async with`.\n- On the httpx path, `await response.aread()` before touching the body.\n- `\"eip155:84532\"` is Base Sepolia. Changing it is a deliberate network change.\n\n**requests:** the sync alternative for a project with no async entry point. `x402_requests(client)`\nfrom `x402.http.clients` is a function that returns a `requests.Session`, and it needs\n`x402ClientSync` rather than `x402Client` — mixing the two raises a `TypeError`.\n\n**MCP:** see `clients\u002Fmcp\u002Fsimple.py` below.\n\n### 4. Fund the wallet\n\nRun the client once. With no USDC it fails, and it prints the address to fund. Send Base Sepolia\nUSDC there:\n\n```typescript\nimport { CdpClient } from \"@coinbase\u002Fcdp-sdk\";\n\nawait new CdpClient().evm.requestFaucet({\n  address: evmAddress,\n  network: \"base-sepolia\",\n  token: \"usdc\",\n});\n```\n\n```python\nawait cdp.evm.request_faucet(address=signer.address, network=\"base-sepolia\", token=\"usdc\")\n```\n\nThe CDP faucet funds the same wallets the CDP Facilitator settles against, so there is no second\nfaucet to find. Wait for the transfer to confirm before re-running — requesting and paying in the\nsame run fails on an empty balance.\n\n### 5. Verify\n\nRe-run. `HTTP 200` is the success signal, and it proves the whole path: the payment was verified,\nsettled onchain, and the protected resource came back. If the user has no endpoint of their own\nyet, `https:\u002F\u002Fx402.vercel.app\u002Fprotected` charges $0.01 on Base Sepolia.\n\n## Troubleshooting\n\n| Symptom                            | Cause                                                          | Fix                                                            |\n| ---------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |\n| `402` no matter how often you retry | Wallet holds no USDC, or the faucet transfer has not confirmed | Check the balance of the printed address before retrying       |\n| Python `TypeError` on the client   | A sync client paired with async pieces, or the reverse         | `x402_requests` needs `x402ClientSync`; `x402HttpxClient` needs `x402Client` |\n| Wallet authentication error        | `CDP_WALLET_SECRET` missing or wrong                           | It is separate from the API key secret; check both             |\n| No scheme registered for network   | Registered chain ID differs from the one the server asks for   | Match the `network` in the `402` response                      |\n| Payment exceeds balance            | —                                                              | Report the shortfall in USDC, not atomic units: 10000 is $0.01 |\n\n## Runnable examples\n\nTypeScript, under `https:\u002F\u002Fgithub.com\u002Fcoinbase\u002Fcdp-sdk\u002Fblob\u002Fmain\u002Fexamples\u002Ftypescript\u002Fx402\u002Fclients\u002F`:\n`payForApi.ts`, `payForApiWithAxios.ts`, `payForApiWithSpendControls.ts`, `x402DevMigration.ts`,\n`mcp\u002Fsimple.ts`.\n\nPython, under `https:\u002F\u002Fgithub.com\u002Fcoinbase\u002Fcdp-sdk\u002Fblob\u002Fmain\u002Fexamples\u002Fpython\u002Fx402\u002Fclients\u002F`:\n`pay_for_api.py`, `pay_for_api_with_requests.py`, `mcp\u002Fsimple.py`.\n\n## Beyond the first paid call\n\n- Spend limits, allowlists, lifecycle hooks: [Client configuration](https:\u002F\u002Fdocs.cdp.coinbase.com\u002Fx402\u002Fbuyer\u002Fclient-configuration)\n- Finding services to pay for: [Discover services](https:\u002F\u002Fdocs.cdp.coinbase.com\u002Fx402\u002Fbuyer\u002Fdiscover-services)\n- Discovery and payment over MCP: [Discover and pay over MCP](https:\u002F\u002Fdocs.cdp.coinbase.com\u002Fx402\u002Fbuyer\u002Fmcp-payments)\n- Mainnet: drop `environment: \"development\"`, fund with real USDC, and confirm with the user first\n",{"data":39,"body":44},{"name":4,"description":6,"compatibility":40,"metadata":41},"Requires a CDP API key and wallet secret. Node.js >= 22 (TypeScript) or Python >= 3.10.",{"author":42,"version":43},"cdp@coinbase.com","0.1.0",{"type":45,"children":46},"root",[47,56,79,84,91,189,195,200,432,444,450,457,495,501,545,550,659,664,711,717,722,727,738,1223,1228,1233,1303,1327,1359,1391,1395,1407,1638,1716,1720,1765,1819,1835,1841,1846,2040,2054,2059,2065,2085,2091,2264,2270,2317,2350,2356,2405],{"type":48,"tag":49,"props":50,"children":52},"element","h1",{"id":51},"build-an-x402-client",[53],{"type":54,"value":55},"text","Build an x402 client",{"type":48,"tag":57,"props":58,"children":59},"p",{},[60,62,69,71,77],{"type":54,"value":61},"Take the user from nothing to one successful paid API call: resolve a CDP-managed wallet, wrap\ntheir HTTP client so it answers ",{"type":48,"tag":63,"props":64,"children":66},"code",{"className":65},[],[67],{"type":54,"value":68},"402",{"type":54,"value":70}," automatically, fund the wallet on testnet, verify with a\n",{"type":48,"tag":63,"props":72,"children":74},{"className":73},[],[75],{"type":54,"value":76},"200",{"type":54,"value":78},".",{"type":48,"tag":57,"props":80,"children":81},{},[82],{"type":54,"value":83},"Resolve the Decisions table below before writing any code, then read only the language subsection\nyou resolved to in step 3. This file covers TypeScript and Python; reading both will blend them.",{"type":48,"tag":85,"props":86,"children":88},"h2",{"id":87},"when-not-to-use-this-skill",[89],{"type":54,"value":90},"When not to use this skill",{"type":48,"tag":92,"props":93,"children":94},"ul",{},[95,118,145,163],{"type":48,"tag":96,"props":97,"children":98},"li",{},[99,105,107,116],{"type":48,"tag":100,"props":101,"children":102},"strong",{},[103],{"type":54,"value":104},"The user's end users should pay from their own wallets.",{"type":54,"value":106}," That is\n",{"type":48,"tag":108,"props":109,"children":113},"a",{"href":110,"rel":111},"https:\u002F\u002Fdocs.cdp.coinbase.com\u002Fwallets\u002Fusing-wallets\u002Fx402-payments",[112],"nofollow",[114],{"type":54,"value":115},"x402 payments with User Wallets",{"type":54,"value":117},",\na browser flow, not this server-side one.",{"type":48,"tag":96,"props":119,"children":120},{},[121,126,128,135,137,143],{"type":48,"tag":100,"props":122,"children":123},{},[124],{"type":54,"value":125},"The user wants an agent to spend money now, without writing code.",{"type":54,"value":127}," Use the agentic-wallet\n",{"type":48,"tag":108,"props":129,"children":132},{"href":130,"rel":131},"https:\u002F\u002Fdocs.cdp.coinbase.com\u002Fagentic-wallet\u002Fcli\u002Fskills\u002Fpay-for-service",[112],[133],{"type":54,"value":134},"pay-for-service",{"type":54,"value":136}," skill,\nwhich drives the ",{"type":48,"tag":63,"props":138,"children":140},{"className":139},[],[141],{"type":54,"value":142},"awal",{"type":54,"value":144}," CLI. It is the nearest neighbour to this skill and the most likely\nmis-selection.",{"type":48,"tag":96,"props":146,"children":147},{},[148,153,155,161],{"type":48,"tag":100,"props":149,"children":150},{},[151],{"type":54,"value":152},"The user is the one charging.",{"type":54,"value":154}," Use the ",{"type":48,"tag":63,"props":156,"children":158},{"className":157},[],[159],{"type":54,"value":160},"build-x402-server",{"type":54,"value":162}," skill.",{"type":48,"tag":96,"props":164,"children":165},{},[166,171,173,179,181,188],{"type":48,"tag":100,"props":167,"children":168},{},[169],{"type":54,"value":170},"The user needs to construct and sign a payment by hand",{"type":54,"value":172}," (",{"type":48,"tag":63,"props":174,"children":176},{"className":175},[],[177],{"type":54,"value":178},"signX402Payment",{"type":54,"value":180},", custom retry\nlogic). Out of scope here; see\n",{"type":48,"tag":108,"props":182,"children":185},{"href":183,"rel":184},"https:\u002F\u002Fdocs.cdp.coinbase.com\u002Fx402\u002Fbuyer\u002Fclient-configuration",[112],[186],{"type":54,"value":187},"Client configuration",{"type":54,"value":78},{"type":48,"tag":85,"props":190,"children":192},{"id":191},"decisions",[193],{"type":54,"value":194},"Decisions",{"type":48,"tag":57,"props":196,"children":197},{},[198],{"type":54,"value":199},"Resolve every row before writing code. Detect first; only ask when detection is ambiguous.",{"type":48,"tag":201,"props":202,"children":203},"table",{},[204,233],{"type":48,"tag":205,"props":206,"children":207},"thead",{},[208],{"type":48,"tag":209,"props":210,"children":211},"tr",{},[212,218,223,228],{"type":48,"tag":213,"props":214,"children":215},"th",{},[216],{"type":54,"value":217},"Decision",{"type":48,"tag":213,"props":219,"children":220},{},[221],{"type":54,"value":222},"How to detect",{"type":48,"tag":213,"props":224,"children":225},{},[226],{"type":54,"value":227},"Ask only if",{"type":48,"tag":213,"props":229,"children":230},{},[231],{"type":54,"value":232},"Default",{"type":48,"tag":234,"props":235,"children":236},"tbody",{},[237,283,353,386,409],{"type":48,"tag":209,"props":238,"children":239},{},[240,246,273,278],{"type":48,"tag":241,"props":242,"children":243},"td",{},[244],{"type":54,"value":245},"Language",{"type":48,"tag":241,"props":247,"children":248},{},[249,255,257,263,265,271],{"type":48,"tag":63,"props":250,"children":252},{"className":251},[],[253],{"type":54,"value":254},"package.json",{"type":54,"value":256}," -> TypeScript. ",{"type":48,"tag":63,"props":258,"children":260},{"className":259},[],[261],{"type":54,"value":262},"pyproject.toml",{"type":54,"value":264}," \u002F ",{"type":48,"tag":63,"props":266,"children":268},{"className":267},[],[269],{"type":54,"value":270},"requirements.txt",{"type":54,"value":272}," -> Python.",{"type":48,"tag":241,"props":274,"children":275},{},[276],{"type":54,"value":277},"Both present, or neither",{"type":48,"tag":241,"props":279,"children":280},{},[281],{"type":54,"value":282},"Ask",{"type":48,"tag":209,"props":284,"children":285},{},[286,291,336,341],{"type":48,"tag":241,"props":287,"children":288},{},[289],{"type":54,"value":290},"HTTP client",{"type":48,"tag":241,"props":292,"children":293},{},[294,296,302,304,310,312,318,320,326,328,334],{"type":54,"value":295},"TS: ",{"type":48,"tag":63,"props":297,"children":299},{"className":298},[],[300],{"type":54,"value":301},"axios",{"type":54,"value":303}," in deps -> axios, else ",{"type":48,"tag":63,"props":305,"children":307},{"className":306},[],[308],{"type":54,"value":309},"fetch",{"type":54,"value":311},". Python: ",{"type":48,"tag":63,"props":313,"children":315},{"className":314},[],[316],{"type":54,"value":317},"httpx",{"type":54,"value":319}," or any ",{"type":48,"tag":63,"props":321,"children":323},{"className":322},[],[324],{"type":54,"value":325},"async def",{"type":54,"value":327}," -> httpx, ",{"type":48,"tag":63,"props":329,"children":331},{"className":330},[],[332],{"type":54,"value":333},"requests",{"type":54,"value":335}," -> requests.",{"type":48,"tag":241,"props":337,"children":338},{},[339],{"type":54,"value":340},"No HTTP client in deps",{"type":48,"tag":241,"props":342,"children":343},{},[344,346,351],{"type":54,"value":345},"TS ",{"type":48,"tag":63,"props":347,"children":349},{"className":348},[],[350],{"type":54,"value":309},{"type":54,"value":352},", Python httpx",{"type":48,"tag":209,"props":354,"children":355},{},[356,361,372,377],{"type":48,"tag":241,"props":357,"children":358},{},[359],{"type":54,"value":360},"Network",{"type":48,"tag":241,"props":362,"children":363},{},[364,370],{"type":48,"tag":63,"props":365,"children":367},{"className":366},[],[368],{"type":54,"value":369},"environment: \"development\"",{"type":54,"value":371}," selects Base testnet.",{"type":48,"tag":241,"props":373,"children":374},{},[375],{"type":54,"value":376},"Never assume mainnet",{"type":48,"tag":241,"props":378,"children":379},{},[380],{"type":48,"tag":63,"props":381,"children":383},{"className":382},[],[384],{"type":54,"value":385},"development",{"type":48,"tag":209,"props":387,"children":388},{},[389,394,399,404],{"type":48,"tag":241,"props":390,"children":391},{},[392],{"type":54,"value":393},"Transport",{"type":48,"tag":241,"props":395,"children":396},{},[397],{"type":54,"value":398},"An MCP server URL or an existing MCP client -> MCP variant. A plain URL -> HTTP.",{"type":48,"tag":241,"props":400,"children":401},{},[402],{"type":54,"value":403},"Unclear what the target is",{"type":48,"tag":241,"props":405,"children":406},{},[407],{"type":54,"value":408},"HTTP",{"type":48,"tag":209,"props":410,"children":411},{},[412,417,422,427],{"type":48,"tag":241,"props":413,"children":414},{},[415],{"type":54,"value":416},"Starting point",{"type":48,"tag":241,"props":418,"children":419},{},[420],{"type":54,"value":421},"An existing x402 client holding a raw private key -> migration path.",{"type":48,"tag":241,"props":423,"children":424},{},[425],{"type":54,"value":426},"—",{"type":48,"tag":241,"props":428,"children":429},{},[430],{"type":54,"value":431},"Fresh integration",{"type":48,"tag":57,"props":433,"children":434},{},[435,437,442],{"type":54,"value":436},"The network row is a hard rule, not a preference: ",{"type":48,"tag":100,"props":438,"children":439},{},[440],{"type":54,"value":441},"never move the user to Base mainnet unless they\nask for it in the current turn",{"type":54,"value":443},", because mainnet payments spend real USDC.",{"type":48,"tag":85,"props":445,"children":447},{"id":446},"steps",[448],{"type":54,"value":449},"Steps",{"type":48,"tag":451,"props":452,"children":454},"h3",{"id":453},"_1-confirm-credentials",[455],{"type":54,"value":456},"1. Confirm credentials",{"type":48,"tag":57,"props":458,"children":459},{},[460,462,468,470,476,478,484,486,493],{"type":54,"value":461},"Before installing anything, check that the environment has all three of ",{"type":48,"tag":63,"props":463,"children":465},{"className":464},[],[466],{"type":54,"value":467},"CDP_API_KEY_ID",{"type":54,"value":469},",\n",{"type":48,"tag":63,"props":471,"children":473},{"className":472},[],[474],{"type":54,"value":475},"CDP_API_KEY_SECRET",{"type":54,"value":477},", and ",{"type":48,"tag":63,"props":479,"children":481},{"className":480},[],[482],{"type":54,"value":483},"CDP_WALLET_SECRET",{"type":54,"value":485},". The API key authenticates the caller to CDP; the\nwallet secret is what lets the SDK sign payments. Missing either one fails at runtime, and it is a\nworse experience to discover that three steps in. Send the user to\n",{"type":48,"tag":108,"props":487,"children":490},{"href":488,"rel":489},"https:\u002F\u002Fdocs.cdp.coinbase.com\u002Fwallets\u002Fquickstart\u002Fapi-key-auth",[112],[491],{"type":54,"value":492},"API key authentication",{"type":54,"value":494}," if they have\nno key yet. Also confirm the runtime: Node.js 22 or later, or Python 3.10 or later.",{"type":48,"tag":451,"props":496,"children":498},{"id":497},"_2-install",[499],{"type":54,"value":500},"2. Install",{"type":48,"tag":57,"props":502,"children":503},{},[504,506,512,514,520,521,527,529,535,537,543],{"type":54,"value":505},"Pick the dependencies matching the Decisions table. ",{"type":48,"tag":63,"props":507,"children":509},{"className":508},[],[510],{"type":54,"value":511},"@x402\u002Fcore",{"type":54,"value":513},", ",{"type":48,"tag":63,"props":515,"children":517},{"className":516},[],[518],{"type":54,"value":519},"@x402\u002Fevm",{"type":54,"value":513},{"type":48,"tag":63,"props":522,"children":524},{"className":523},[],[525],{"type":54,"value":526},"@x402\u002Fsvm",{"type":54,"value":528},", and\n",{"type":48,"tag":63,"props":530,"children":532},{"className":531},[],[533],{"type":54,"value":534},"@x402\u002Fextensions",{"type":54,"value":536}," are optional peer dependencies of the CDP SDK, so they are not installed for you,\nand all four are needed even for an EVM-only integration because ",{"type":48,"tag":63,"props":538,"children":540},{"className":539},[],[541],{"type":54,"value":542},"@coinbase\u002Fcdp-sdk\u002Fx402",{"type":54,"value":544}," imports\nthem at module load.",{"type":48,"tag":57,"props":546,"children":547},{},[548],{"type":54,"value":549},"For TypeScript, use the package manager already configured in the project. If none is configured,\nuse npm. Install:",{"type":48,"tag":92,"props":551,"children":552},{},[553,600,630],{"type":48,"tag":96,"props":554,"children":555},{},[556,561,563,569,570,575,576,581,582,587,588,593,594],{"type":48,"tag":100,"props":557,"children":558},{},[559],{"type":54,"value":560},"fetch:",{"type":54,"value":562}," ",{"type":48,"tag":63,"props":564,"children":566},{"className":565},[],[567],{"type":54,"value":568},"@coinbase\u002Fcdp-sdk",{"type":54,"value":513},{"type":48,"tag":63,"props":571,"children":573},{"className":572},[],[574],{"type":54,"value":511},{"type":54,"value":513},{"type":48,"tag":63,"props":577,"children":579},{"className":578},[],[580],{"type":54,"value":519},{"type":54,"value":513},{"type":48,"tag":63,"props":583,"children":585},{"className":584},[],[586],{"type":54,"value":526},{"type":54,"value":469},{"type":48,"tag":63,"props":589,"children":591},{"className":590},[],[592],{"type":54,"value":534},{"type":54,"value":477},{"type":48,"tag":63,"props":595,"children":597},{"className":596},[],[598],{"type":54,"value":599},"@x402\u002Ffetch",{"type":48,"tag":96,"props":601,"children":602},{},[603,608,610,616,618,623,625],{"type":48,"tag":100,"props":604,"children":605},{},[606],{"type":54,"value":607},"axios:",{"type":54,"value":609}," the same packages with ",{"type":48,"tag":63,"props":611,"children":613},{"className":612},[],[614],{"type":54,"value":615},"@x402\u002Faxios",{"type":54,"value":617}," instead of ",{"type":48,"tag":63,"props":619,"children":621},{"className":620},[],[622],{"type":54,"value":599},{"type":54,"value":624},", plus ",{"type":48,"tag":63,"props":626,"children":628},{"className":627},[],[629],{"type":54,"value":301},{"type":48,"tag":96,"props":631,"children":632},{},[633,638,639,645,646,651,653],{"type":48,"tag":100,"props":634,"children":635},{},[636],{"type":54,"value":637},"MCP:",{"type":54,"value":609},{"type":48,"tag":63,"props":640,"children":642},{"className":641},[],[643],{"type":54,"value":644},"@x402\u002Fmcp",{"type":54,"value":617},{"type":48,"tag":63,"props":647,"children":649},{"className":648},[],[650],{"type":54,"value":599},{"type":54,"value":652},", plus\n",{"type":48,"tag":63,"props":654,"children":656},{"className":655},[],[657],{"type":54,"value":658},"@modelcontextprotocol\u002Fsdk",{"type":48,"tag":57,"props":660,"children":661},{},[662],{"type":54,"value":663},"For Python, use the package manager already configured in the project. If none is configured, use\npip. Install:",{"type":48,"tag":92,"props":665,"children":666},{},[667,690],{"type":48,"tag":96,"props":668,"children":669},{},[670,675,676,682,684],{"type":48,"tag":100,"props":671,"children":672},{},[673],{"type":54,"value":674},"async:",{"type":54,"value":562},{"type":48,"tag":63,"props":677,"children":679},{"className":678},[],[680],{"type":54,"value":681},"cdp-sdk",{"type":54,"value":683}," and ",{"type":48,"tag":63,"props":685,"children":687},{"className":686},[],[688],{"type":54,"value":689},"x402[evm,svm,httpx]",{"type":48,"tag":96,"props":691,"children":692},{},[693,698,699,704,705],{"type":48,"tag":100,"props":694,"children":695},{},[696],{"type":54,"value":697},"sync:",{"type":54,"value":562},{"type":48,"tag":63,"props":700,"children":702},{"className":701},[],[703],{"type":54,"value":681},{"type":54,"value":683},{"type":48,"tag":63,"props":706,"children":708},{"className":707},[],[709],{"type":54,"value":710},"x402[evm,svm,requests]",{"type":48,"tag":451,"props":712,"children":714},{"id":713},"_3-write-the-client",[715],{"type":54,"value":716},"3. Write the client",{"type":48,"tag":57,"props":718,"children":719},{},[720],{"type":54,"value":721},"Read only the subsection matching the language resolved above.",{"type":48,"tag":723,"props":724,"children":725},"h4",{"id":14},[726],{"type":54,"value":13},{"type":48,"tag":57,"props":728,"children":729},{},[730,736],{"type":48,"tag":63,"props":731,"children":733},{"className":732},[],[734],{"type":54,"value":735},"CdpX402Client",{"type":54,"value":737}," is the whole point of the TypeScript path. It provisions the wallet, registers the\npayment schemes, and already satisfies the signer interface the x402 wrappers expect, so it drops\ninto any of them unchanged.",{"type":48,"tag":739,"props":740,"children":744},"pre",{"className":741,"code":742,"language":14,"meta":743,"style":743},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { CdpX402Client } from \"@coinbase\u002Fcdp-sdk\u002Fx402\";\nimport { wrapFetchWithPayment } from \"@x402\u002Ffetch\";\n\nconst client = new CdpX402Client({ environment: \"development\" });\n\n\u002F\u002F The wallet lives inside the client, so print the address to know what to fund.\nconst { evmAddress } = await client.getAddresses();\nconsole.log(`Paying from ${evmAddress}`);\n\nconst fetchWithPayment = wrapFetchWithPayment(globalThis.fetch, client);\nconst response = await fetchWithPayment(\"https:\u002F\u002Fx402.vercel.app\u002Fprotected\");\nconsole.log(`HTTP ${response.status}`);\n","",[745],{"type":48,"tag":63,"props":746,"children":747},{"__ignoreMap":743},[748,802,843,853,929,937,947,1002,1057,1065,1113,1164],{"type":48,"tag":749,"props":750,"children":753},"span",{"class":751,"line":752},"line",1,[754,760,766,772,777,782,787,792,797],{"type":48,"tag":749,"props":755,"children":757},{"style":756},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[758],{"type":54,"value":759},"import",{"type":48,"tag":749,"props":761,"children":763},{"style":762},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[764],{"type":54,"value":765}," {",{"type":48,"tag":749,"props":767,"children":769},{"style":768},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[770],{"type":54,"value":771}," CdpX402Client",{"type":48,"tag":749,"props":773,"children":774},{"style":762},[775],{"type":54,"value":776}," }",{"type":48,"tag":749,"props":778,"children":779},{"style":756},[780],{"type":54,"value":781}," from",{"type":48,"tag":749,"props":783,"children":784},{"style":762},[785],{"type":54,"value":786}," \"",{"type":48,"tag":749,"props":788,"children":790},{"style":789},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[791],{"type":54,"value":542},{"type":48,"tag":749,"props":793,"children":794},{"style":762},[795],{"type":54,"value":796},"\"",{"type":48,"tag":749,"props":798,"children":799},{"style":762},[800],{"type":54,"value":801},";\n",{"type":48,"tag":749,"props":803,"children":805},{"class":751,"line":804},2,[806,810,814,819,823,827,831,835,839],{"type":48,"tag":749,"props":807,"children":808},{"style":756},[809],{"type":54,"value":759},{"type":48,"tag":749,"props":811,"children":812},{"style":762},[813],{"type":54,"value":765},{"type":48,"tag":749,"props":815,"children":816},{"style":768},[817],{"type":54,"value":818}," wrapFetchWithPayment",{"type":48,"tag":749,"props":820,"children":821},{"style":762},[822],{"type":54,"value":776},{"type":48,"tag":749,"props":824,"children":825},{"style":756},[826],{"type":54,"value":781},{"type":48,"tag":749,"props":828,"children":829},{"style":762},[830],{"type":54,"value":786},{"type":48,"tag":749,"props":832,"children":833},{"style":789},[834],{"type":54,"value":599},{"type":48,"tag":749,"props":836,"children":837},{"style":762},[838],{"type":54,"value":796},{"type":48,"tag":749,"props":840,"children":841},{"style":762},[842],{"type":54,"value":801},{"type":48,"tag":749,"props":844,"children":846},{"class":751,"line":845},3,[847],{"type":48,"tag":749,"props":848,"children":850},{"emptyLinePlaceholder":849},true,[851],{"type":54,"value":852},"\n",{"type":48,"tag":749,"props":854,"children":856},{"class":751,"line":855},4,[857,863,868,873,878,883,888,893,899,904,908,912,916,920,925],{"type":48,"tag":749,"props":858,"children":860},{"style":859},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[861],{"type":54,"value":862},"const",{"type":48,"tag":749,"props":864,"children":865},{"style":768},[866],{"type":54,"value":867}," client ",{"type":48,"tag":749,"props":869,"children":870},{"style":762},[871],{"type":54,"value":872},"=",{"type":48,"tag":749,"props":874,"children":875},{"style":762},[876],{"type":54,"value":877}," new",{"type":48,"tag":749,"props":879,"children":881},{"style":880},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[882],{"type":54,"value":771},{"type":48,"tag":749,"props":884,"children":885},{"style":768},[886],{"type":54,"value":887},"(",{"type":48,"tag":749,"props":889,"children":890},{"style":762},[891],{"type":54,"value":892},"{",{"type":48,"tag":749,"props":894,"children":896},{"style":895},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[897],{"type":54,"value":898}," environment",{"type":48,"tag":749,"props":900,"children":901},{"style":762},[902],{"type":54,"value":903},":",{"type":48,"tag":749,"props":905,"children":906},{"style":762},[907],{"type":54,"value":786},{"type":48,"tag":749,"props":909,"children":910},{"style":789},[911],{"type":54,"value":385},{"type":48,"tag":749,"props":913,"children":914},{"style":762},[915],{"type":54,"value":796},{"type":48,"tag":749,"props":917,"children":918},{"style":762},[919],{"type":54,"value":776},{"type":48,"tag":749,"props":921,"children":922},{"style":768},[923],{"type":54,"value":924},")",{"type":48,"tag":749,"props":926,"children":927},{"style":762},[928],{"type":54,"value":801},{"type":48,"tag":749,"props":930,"children":932},{"class":751,"line":931},5,[933],{"type":48,"tag":749,"props":934,"children":935},{"emptyLinePlaceholder":849},[936],{"type":54,"value":852},{"type":48,"tag":749,"props":938,"children":940},{"class":751,"line":939},6,[941],{"type":48,"tag":749,"props":942,"children":944},{"style":943},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[945],{"type":54,"value":946},"\u002F\u002F The wallet lives inside the client, so print the address to know what to fund.\n",{"type":48,"tag":749,"props":948,"children":950},{"class":751,"line":949},7,[951,955,959,964,969,974,979,984,988,993,998],{"type":48,"tag":749,"props":952,"children":953},{"style":859},[954],{"type":54,"value":862},{"type":48,"tag":749,"props":956,"children":957},{"style":762},[958],{"type":54,"value":765},{"type":48,"tag":749,"props":960,"children":961},{"style":768},[962],{"type":54,"value":963}," evmAddress ",{"type":48,"tag":749,"props":965,"children":966},{"style":762},[967],{"type":54,"value":968},"}",{"type":48,"tag":749,"props":970,"children":971},{"style":762},[972],{"type":54,"value":973}," =",{"type":48,"tag":749,"props":975,"children":976},{"style":756},[977],{"type":54,"value":978}," await",{"type":48,"tag":749,"props":980,"children":981},{"style":768},[982],{"type":54,"value":983}," client",{"type":48,"tag":749,"props":985,"children":986},{"style":762},[987],{"type":54,"value":78},{"type":48,"tag":749,"props":989,"children":990},{"style":880},[991],{"type":54,"value":992},"getAddresses",{"type":48,"tag":749,"props":994,"children":995},{"style":768},[996],{"type":54,"value":997},"()",{"type":48,"tag":749,"props":999,"children":1000},{"style":762},[1001],{"type":54,"value":801},{"type":48,"tag":749,"props":1003,"children":1005},{"class":751,"line":1004},8,[1006,1011,1015,1020,1024,1029,1034,1039,1044,1049,1053],{"type":48,"tag":749,"props":1007,"children":1008},{"style":768},[1009],{"type":54,"value":1010},"console",{"type":48,"tag":749,"props":1012,"children":1013},{"style":762},[1014],{"type":54,"value":78},{"type":48,"tag":749,"props":1016,"children":1017},{"style":880},[1018],{"type":54,"value":1019},"log",{"type":48,"tag":749,"props":1021,"children":1022},{"style":768},[1023],{"type":54,"value":887},{"type":48,"tag":749,"props":1025,"children":1026},{"style":762},[1027],{"type":54,"value":1028},"`",{"type":48,"tag":749,"props":1030,"children":1031},{"style":789},[1032],{"type":54,"value":1033},"Paying from ",{"type":48,"tag":749,"props":1035,"children":1036},{"style":762},[1037],{"type":54,"value":1038},"${",{"type":48,"tag":749,"props":1040,"children":1041},{"style":768},[1042],{"type":54,"value":1043},"evmAddress",{"type":48,"tag":749,"props":1045,"children":1046},{"style":762},[1047],{"type":54,"value":1048},"}`",{"type":48,"tag":749,"props":1050,"children":1051},{"style":768},[1052],{"type":54,"value":924},{"type":48,"tag":749,"props":1054,"children":1055},{"style":762},[1056],{"type":54,"value":801},{"type":48,"tag":749,"props":1058,"children":1060},{"class":751,"line":1059},9,[1061],{"type":48,"tag":749,"props":1062,"children":1063},{"emptyLinePlaceholder":849},[1064],{"type":54,"value":852},{"type":48,"tag":749,"props":1066,"children":1068},{"class":751,"line":1067},10,[1069,1073,1078,1082,1086,1091,1095,1099,1104,1109],{"type":48,"tag":749,"props":1070,"children":1071},{"style":859},[1072],{"type":54,"value":862},{"type":48,"tag":749,"props":1074,"children":1075},{"style":768},[1076],{"type":54,"value":1077}," fetchWithPayment ",{"type":48,"tag":749,"props":1079,"children":1080},{"style":762},[1081],{"type":54,"value":872},{"type":48,"tag":749,"props":1083,"children":1084},{"style":880},[1085],{"type":54,"value":818},{"type":48,"tag":749,"props":1087,"children":1088},{"style":768},[1089],{"type":54,"value":1090},"(globalThis",{"type":48,"tag":749,"props":1092,"children":1093},{"style":762},[1094],{"type":54,"value":78},{"type":48,"tag":749,"props":1096,"children":1097},{"style":768},[1098],{"type":54,"value":309},{"type":48,"tag":749,"props":1100,"children":1101},{"style":762},[1102],{"type":54,"value":1103},",",{"type":48,"tag":749,"props":1105,"children":1106},{"style":768},[1107],{"type":54,"value":1108}," client)",{"type":48,"tag":749,"props":1110,"children":1111},{"style":762},[1112],{"type":54,"value":801},{"type":48,"tag":749,"props":1114,"children":1116},{"class":751,"line":1115},11,[1117,1121,1126,1130,1134,1139,1143,1147,1152,1156,1160],{"type":48,"tag":749,"props":1118,"children":1119},{"style":859},[1120],{"type":54,"value":862},{"type":48,"tag":749,"props":1122,"children":1123},{"style":768},[1124],{"type":54,"value":1125}," response ",{"type":48,"tag":749,"props":1127,"children":1128},{"style":762},[1129],{"type":54,"value":872},{"type":48,"tag":749,"props":1131,"children":1132},{"style":756},[1133],{"type":54,"value":978},{"type":48,"tag":749,"props":1135,"children":1136},{"style":880},[1137],{"type":54,"value":1138}," fetchWithPayment",{"type":48,"tag":749,"props":1140,"children":1141},{"style":768},[1142],{"type":54,"value":887},{"type":48,"tag":749,"props":1144,"children":1145},{"style":762},[1146],{"type":54,"value":796},{"type":48,"tag":749,"props":1148,"children":1149},{"style":789},[1150],{"type":54,"value":1151},"https:\u002F\u002Fx402.vercel.app\u002Fprotected",{"type":48,"tag":749,"props":1153,"children":1154},{"style":762},[1155],{"type":54,"value":796},{"type":48,"tag":749,"props":1157,"children":1158},{"style":768},[1159],{"type":54,"value":924},{"type":48,"tag":749,"props":1161,"children":1162},{"style":762},[1163],{"type":54,"value":801},{"type":48,"tag":749,"props":1165,"children":1167},{"class":751,"line":1166},12,[1168,1172,1176,1180,1184,1188,1193,1197,1202,1206,1211,1215,1219],{"type":48,"tag":749,"props":1169,"children":1170},{"style":768},[1171],{"type":54,"value":1010},{"type":48,"tag":749,"props":1173,"children":1174},{"style":762},[1175],{"type":54,"value":78},{"type":48,"tag":749,"props":1177,"children":1178},{"style":880},[1179],{"type":54,"value":1019},{"type":48,"tag":749,"props":1181,"children":1182},{"style":768},[1183],{"type":54,"value":887},{"type":48,"tag":749,"props":1185,"children":1186},{"style":762},[1187],{"type":54,"value":1028},{"type":48,"tag":749,"props":1189,"children":1190},{"style":789},[1191],{"type":54,"value":1192},"HTTP ",{"type":48,"tag":749,"props":1194,"children":1195},{"style":762},[1196],{"type":54,"value":1038},{"type":48,"tag":749,"props":1198,"children":1199},{"style":768},[1200],{"type":54,"value":1201},"response",{"type":48,"tag":749,"props":1203,"children":1204},{"style":762},[1205],{"type":54,"value":78},{"type":48,"tag":749,"props":1207,"children":1208},{"style":768},[1209],{"type":54,"value":1210},"status",{"type":48,"tag":749,"props":1212,"children":1213},{"style":762},[1214],{"type":54,"value":1048},{"type":48,"tag":749,"props":1216,"children":1217},{"style":768},[1218],{"type":54,"value":924},{"type":48,"tag":749,"props":1220,"children":1221},{"style":762},[1222],{"type":54,"value":801},{"type":48,"tag":57,"props":1224,"children":1225},{},[1226],{"type":54,"value":1227},"There is no key to store anywhere — that is the reason a developer reaches for CDP here, so say so\nrather than burying it.",{"type":48,"tag":57,"props":1229,"children":1230},{},[1231],{"type":54,"value":1232},"Three things that break first:",{"type":48,"tag":92,"props":1234,"children":1235},{},[1236,1257,1270],{"type":48,"tag":96,"props":1237,"children":1238},{},[1239,1241,1247,1249,1255],{"type":54,"value":1240},"Top-level ",{"type":48,"tag":63,"props":1242,"children":1244},{"className":1243},[],[1245],{"type":54,"value":1246},"await",{"type":54,"value":1248}," needs ESM or an ",{"type":48,"tag":63,"props":1250,"children":1252},{"className":1251},[],[1253],{"type":54,"value":1254},"async main()",{"type":54,"value":1256},". In a CommonJS project this is the first error.",{"type":48,"tag":96,"props":1258,"children":1259},{},[1260,1262,1268],{"type":54,"value":1261},"Omitting ",{"type":48,"tag":63,"props":1263,"children":1265},{"className":1264},[],[1266],{"type":54,"value":1267},"environment",{"type":54,"value":1269}," means Base mainnet and real USDC.",{"type":48,"tag":96,"props":1271,"children":1272},{},[1273,1279,1281,1287,1289,1294,1296,1302],{"type":48,"tag":63,"props":1274,"children":1276},{"className":1275},[],[1277],{"type":54,"value":1278},"getAddresses()",{"type":54,"value":1280}," also returns ",{"type":48,"tag":63,"props":1282,"children":1284},{"className":1283},[],[1285],{"type":54,"value":1286},"svmAddress",{"type":54,"value":1288}," for Solana. The field is ",{"type":48,"tag":63,"props":1290,"children":1292},{"className":1291},[],[1293],{"type":54,"value":1286},{"type":54,"value":1295},", not\n",{"type":48,"tag":63,"props":1297,"children":1299},{"className":1298},[],[1300],{"type":54,"value":1301},"solanaAddress",{"type":54,"value":78},{"type":48,"tag":57,"props":1304,"children":1305},{},[1306,1310,1312,1318,1320,1325],{"type":48,"tag":100,"props":1307,"children":1308},{},[1309],{"type":54,"value":607},{"type":54,"value":1311}," same client object, different wrapper — ",{"type":48,"tag":63,"props":1313,"children":1315},{"className":1314},[],[1316],{"type":54,"value":1317},"wrapAxiosWithPayment(axios.create(), client)",{"type":54,"value":1319},"\nfrom ",{"type":48,"tag":63,"props":1321,"children":1323},{"className":1322},[],[1324],{"type":54,"value":615},{"type":54,"value":1326},", which returns a wrapped axios instance.",{"type":48,"tag":57,"props":1328,"children":1329},{},[1330,1334,1336,1342,1344,1349,1351,1357],{"type":48,"tag":100,"props":1331,"children":1332},{},[1333],{"type":54,"value":637},{"type":54,"value":1335}," paying for tool calls rather than routes, with ",{"type":48,"tag":63,"props":1337,"children":1339},{"className":1338},[],[1340],{"type":54,"value":1341},"wrapMCPClientWithPayment(mcpClient, client)",{"type":54,"value":1343}," from ",{"type":48,"tag":63,"props":1345,"children":1347},{"className":1346},[],[1348],{"type":54,"value":644},{"type":54,"value":1350},". See ",{"type":48,"tag":63,"props":1352,"children":1354},{"className":1353},[],[1355],{"type":54,"value":1356},"clients\u002Fmcp\u002Fsimple.ts",{"type":54,"value":1358}," below.",{"type":48,"tag":57,"props":1360,"children":1361},{},[1362,1367,1369,1375,1377,1382,1384,1390],{"type":48,"tag":100,"props":1363,"children":1364},{},[1365],{"type":54,"value":1366},"Migration:",{"type":54,"value":1368}," swap whatever signer the existing ",{"type":48,"tag":63,"props":1370,"children":1372},{"className":1371},[],[1373],{"type":54,"value":1374},"x402Client",{"type":54,"value":1376}," holds for ",{"type":48,"tag":63,"props":1378,"children":1380},{"className":1379},[],[1381],{"type":54,"value":735},{"type":54,"value":1383},"; the call\nsites stay where they are. See ",{"type":48,"tag":63,"props":1385,"children":1387},{"className":1386},[],[1388],{"type":54,"value":1389},"x402DevMigration.ts",{"type":54,"value":1358},{"type":48,"tag":723,"props":1392,"children":1393},{"id":23},[1394],{"type":54,"value":22},{"type":48,"tag":57,"props":1396,"children":1397},{},[1398,1400,1405],{"type":54,"value":1399},"There is no ",{"type":48,"tag":63,"props":1401,"children":1403},{"className":1402},[],[1404],{"type":54,"value":735},{"type":54,"value":1406}," in Python, so assemble the pieces by hand rather than hunting for a\none-liner that does not exist.",{"type":48,"tag":739,"props":1408,"children":1411},{"className":1409,"code":1410,"language":23,"meta":743,"style":743},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import asyncio\n\nfrom cdp import CdpClient\nfrom cdp.evm_local_account import EvmLocalAccount\nfrom x402 import x402Client\nfrom x402.http.clients import x402HttpxClient\nfrom x402.mechanisms.evm import EthAccountSigner\nfrom x402.mechanisms.evm.exact import ExactEvmScheme\n\n\nasync def main() -> None:\n    async with CdpClient() as cdp:\n        account = await cdp.evm.get_or_create_account(name=\"x402-client-wallet-1\")\n        signer = EthAccountSigner(EvmLocalAccount(account))\n        print(f\"Paying from {signer.address}\")  # this is the address to fund\n\n        payment_client = x402Client()\n        payment_client.register(\"eip155:84532\", ExactEvmScheme(signer))\n\n        async with x402HttpxClient(payment_client) as http:\n            response = await http.get(\"https:\u002F\u002Fx402.vercel.app\u002Fprotected\")\n            await response.aread()\n\n        print(f\"HTTP {response.status_code}\")\n\n\nasyncio.run(main())\n",[1412],{"type":48,"tag":63,"props":1413,"children":1414},{"__ignoreMap":743},[1415,1423,1430,1438,1446,1454,1462,1470,1478,1485,1492,1500,1508,1517,1526,1535,1543,1552,1561,1569,1578,1587,1596,1604,1613,1621,1629],{"type":48,"tag":749,"props":1416,"children":1417},{"class":751,"line":752},[1418],{"type":48,"tag":749,"props":1419,"children":1420},{},[1421],{"type":54,"value":1422},"import asyncio\n",{"type":48,"tag":749,"props":1424,"children":1425},{"class":751,"line":804},[1426],{"type":48,"tag":749,"props":1427,"children":1428},{"emptyLinePlaceholder":849},[1429],{"type":54,"value":852},{"type":48,"tag":749,"props":1431,"children":1432},{"class":751,"line":845},[1433],{"type":48,"tag":749,"props":1434,"children":1435},{},[1436],{"type":54,"value":1437},"from cdp import CdpClient\n",{"type":48,"tag":749,"props":1439,"children":1440},{"class":751,"line":855},[1441],{"type":48,"tag":749,"props":1442,"children":1443},{},[1444],{"type":54,"value":1445},"from cdp.evm_local_account import EvmLocalAccount\n",{"type":48,"tag":749,"props":1447,"children":1448},{"class":751,"line":931},[1449],{"type":48,"tag":749,"props":1450,"children":1451},{},[1452],{"type":54,"value":1453},"from x402 import x402Client\n",{"type":48,"tag":749,"props":1455,"children":1456},{"class":751,"line":939},[1457],{"type":48,"tag":749,"props":1458,"children":1459},{},[1460],{"type":54,"value":1461},"from x402.http.clients import x402HttpxClient\n",{"type":48,"tag":749,"props":1463,"children":1464},{"class":751,"line":949},[1465],{"type":48,"tag":749,"props":1466,"children":1467},{},[1468],{"type":54,"value":1469},"from x402.mechanisms.evm import EthAccountSigner\n",{"type":48,"tag":749,"props":1471,"children":1472},{"class":751,"line":1004},[1473],{"type":48,"tag":749,"props":1474,"children":1475},{},[1476],{"type":54,"value":1477},"from x402.mechanisms.evm.exact import ExactEvmScheme\n",{"type":48,"tag":749,"props":1479,"children":1480},{"class":751,"line":1059},[1481],{"type":48,"tag":749,"props":1482,"children":1483},{"emptyLinePlaceholder":849},[1484],{"type":54,"value":852},{"type":48,"tag":749,"props":1486,"children":1487},{"class":751,"line":1067},[1488],{"type":48,"tag":749,"props":1489,"children":1490},{"emptyLinePlaceholder":849},[1491],{"type":54,"value":852},{"type":48,"tag":749,"props":1493,"children":1494},{"class":751,"line":1115},[1495],{"type":48,"tag":749,"props":1496,"children":1497},{},[1498],{"type":54,"value":1499},"async def main() -> None:\n",{"type":48,"tag":749,"props":1501,"children":1502},{"class":751,"line":1166},[1503],{"type":48,"tag":749,"props":1504,"children":1505},{},[1506],{"type":54,"value":1507},"    async with CdpClient() as cdp:\n",{"type":48,"tag":749,"props":1509,"children":1511},{"class":751,"line":1510},13,[1512],{"type":48,"tag":749,"props":1513,"children":1514},{},[1515],{"type":54,"value":1516},"        account = await cdp.evm.get_or_create_account(name=\"x402-client-wallet-1\")\n",{"type":48,"tag":749,"props":1518,"children":1520},{"class":751,"line":1519},14,[1521],{"type":48,"tag":749,"props":1522,"children":1523},{},[1524],{"type":54,"value":1525},"        signer = EthAccountSigner(EvmLocalAccount(account))\n",{"type":48,"tag":749,"props":1527,"children":1529},{"class":751,"line":1528},15,[1530],{"type":48,"tag":749,"props":1531,"children":1532},{},[1533],{"type":54,"value":1534},"        print(f\"Paying from {signer.address}\")  # this is the address to fund\n",{"type":48,"tag":749,"props":1536,"children":1538},{"class":751,"line":1537},16,[1539],{"type":48,"tag":749,"props":1540,"children":1541},{"emptyLinePlaceholder":849},[1542],{"type":54,"value":852},{"type":48,"tag":749,"props":1544,"children":1546},{"class":751,"line":1545},17,[1547],{"type":48,"tag":749,"props":1548,"children":1549},{},[1550],{"type":54,"value":1551},"        payment_client = x402Client()\n",{"type":48,"tag":749,"props":1553,"children":1555},{"class":751,"line":1554},18,[1556],{"type":48,"tag":749,"props":1557,"children":1558},{},[1559],{"type":54,"value":1560},"        payment_client.register(\"eip155:84532\", ExactEvmScheme(signer))\n",{"type":48,"tag":749,"props":1562,"children":1564},{"class":751,"line":1563},19,[1565],{"type":48,"tag":749,"props":1566,"children":1567},{"emptyLinePlaceholder":849},[1568],{"type":54,"value":852},{"type":48,"tag":749,"props":1570,"children":1572},{"class":751,"line":1571},20,[1573],{"type":48,"tag":749,"props":1574,"children":1575},{},[1576],{"type":54,"value":1577},"        async with x402HttpxClient(payment_client) as http:\n",{"type":48,"tag":749,"props":1579,"children":1581},{"class":751,"line":1580},21,[1582],{"type":48,"tag":749,"props":1583,"children":1584},{},[1585],{"type":54,"value":1586},"            response = await http.get(\"https:\u002F\u002Fx402.vercel.app\u002Fprotected\")\n",{"type":48,"tag":749,"props":1588,"children":1590},{"class":751,"line":1589},22,[1591],{"type":48,"tag":749,"props":1592,"children":1593},{},[1594],{"type":54,"value":1595},"            await response.aread()\n",{"type":48,"tag":749,"props":1597,"children":1599},{"class":751,"line":1598},23,[1600],{"type":48,"tag":749,"props":1601,"children":1602},{"emptyLinePlaceholder":849},[1603],{"type":54,"value":852},{"type":48,"tag":749,"props":1605,"children":1607},{"class":751,"line":1606},24,[1608],{"type":48,"tag":749,"props":1609,"children":1610},{},[1611],{"type":54,"value":1612},"        print(f\"HTTP {response.status_code}\")\n",{"type":48,"tag":749,"props":1614,"children":1616},{"class":751,"line":1615},25,[1617],{"type":48,"tag":749,"props":1618,"children":1619},{"emptyLinePlaceholder":849},[1620],{"type":54,"value":852},{"type":48,"tag":749,"props":1622,"children":1624},{"class":751,"line":1623},26,[1625],{"type":48,"tag":749,"props":1626,"children":1627},{"emptyLinePlaceholder":849},[1628],{"type":54,"value":852},{"type":48,"tag":749,"props":1630,"children":1632},{"class":751,"line":1631},27,[1633],{"type":48,"tag":749,"props":1634,"children":1635},{},[1636],{"type":54,"value":1637},"asyncio.run(main())\n",{"type":48,"tag":57,"props":1639,"children":1640},{},[1641,1647,1649,1655,1657,1663,1665,1671,1673,1679,1685,1687,1692,1694,1699,1701,1706,1708,1714],{"type":48,"tag":63,"props":1642,"children":1644},{"className":1643},[],[1645],{"type":54,"value":1646},"EvmLocalAccount",{"type":54,"value":1648}," and the x402 signer protocol declare ",{"type":48,"tag":63,"props":1650,"children":1652},{"className":1651},[],[1653],{"type":54,"value":1654},"sign_typed_data",{"type":54,"value":1656}," differently, and\n",{"type":48,"tag":63,"props":1658,"children":1660},{"className":1659},[],[1661],{"type":54,"value":1662},"EthAccountSigner",{"type":54,"value":1664}," is what reconciles them. Writing the wrap explicitly is a readability choice\nrather than a requirement: ",{"type":48,"tag":63,"props":1666,"children":1668},{"className":1667},[],[1669],{"type":54,"value":1670},"ExactEvmScheme",{"type":54,"value":1672}," already auto-wraps anything that is an ",{"type":48,"tag":63,"props":1674,"children":1676},{"className":1675},[],[1677],{"type":54,"value":1678},"eth_account",{"type":48,"tag":63,"props":1680,"children":1682},{"className":1681},[],[1683],{"type":54,"value":1684},"BaseAccount",{"type":54,"value":1686},", which ",{"type":48,"tag":63,"props":1688,"children":1690},{"className":1689},[],[1691],{"type":54,"value":1646},{"type":54,"value":1693}," is, so passing the account directly works too. Keep the\nexplicit form so the adaptation is visible. A type checker may flag it, since ",{"type":48,"tag":63,"props":1695,"children":1697},{"className":1696},[],[1698],{"type":54,"value":1646},{"type":54,"value":1700},"\nsubclasses ",{"type":48,"tag":63,"props":1702,"children":1704},{"className":1703},[],[1705],{"type":54,"value":1684},{"type":54,"value":1707}," rather than ",{"type":48,"tag":63,"props":1709,"children":1711},{"className":1710},[],[1712],{"type":54,"value":1713},"LocalAccount",{"type":54,"value":1715},"; at runtime it is correct.",{"type":48,"tag":57,"props":1717,"children":1718},{},[1719],{"type":54,"value":1232},{"type":48,"tag":92,"props":1721,"children":1722},{},[1723,1741,1754],{"type":48,"tag":96,"props":1724,"children":1725},{},[1726,1732,1734,1740],{"type":48,"tag":63,"props":1727,"children":1729},{"className":1728},[],[1730],{"type":54,"value":1731},"CdpClient",{"type":54,"value":1733}," is an async context manager. Resolve the account inside ",{"type":48,"tag":63,"props":1735,"children":1737},{"className":1736},[],[1738],{"type":54,"value":1739},"async with",{"type":54,"value":78},{"type":48,"tag":96,"props":1742,"children":1743},{},[1744,1746,1752],{"type":54,"value":1745},"On the httpx path, ",{"type":48,"tag":63,"props":1747,"children":1749},{"className":1748},[],[1750],{"type":54,"value":1751},"await response.aread()",{"type":54,"value":1753}," before touching the body.",{"type":48,"tag":96,"props":1755,"children":1756},{},[1757,1763],{"type":48,"tag":63,"props":1758,"children":1760},{"className":1759},[],[1761],{"type":54,"value":1762},"\"eip155:84532\"",{"type":54,"value":1764}," is Base Sepolia. Changing it is a deliberate network change.",{"type":48,"tag":57,"props":1766,"children":1767},{},[1768,1773,1775,1781,1782,1788,1790,1796,1798,1804,1805,1810,1812,1818],{"type":48,"tag":100,"props":1769,"children":1770},{},[1771],{"type":54,"value":1772},"requests:",{"type":54,"value":1774}," the sync alternative for a project with no async entry point. ",{"type":48,"tag":63,"props":1776,"children":1778},{"className":1777},[],[1779],{"type":54,"value":1780},"x402_requests(client)",{"type":54,"value":1319},{"type":48,"tag":63,"props":1783,"children":1785},{"className":1784},[],[1786],{"type":54,"value":1787},"x402.http.clients",{"type":54,"value":1789}," is a function that returns a ",{"type":48,"tag":63,"props":1791,"children":1793},{"className":1792},[],[1794],{"type":54,"value":1795},"requests.Session",{"type":54,"value":1797},", and it needs\n",{"type":48,"tag":63,"props":1799,"children":1801},{"className":1800},[],[1802],{"type":54,"value":1803},"x402ClientSync",{"type":54,"value":1707},{"type":48,"tag":63,"props":1806,"children":1808},{"className":1807},[],[1809],{"type":54,"value":1374},{"type":54,"value":1811}," — mixing the two raises a ",{"type":48,"tag":63,"props":1813,"children":1815},{"className":1814},[],[1816],{"type":54,"value":1817},"TypeError",{"type":54,"value":78},{"type":48,"tag":57,"props":1820,"children":1821},{},[1822,1826,1828,1834],{"type":48,"tag":100,"props":1823,"children":1824},{},[1825],{"type":54,"value":637},{"type":54,"value":1827}," see ",{"type":48,"tag":63,"props":1829,"children":1831},{"className":1830},[],[1832],{"type":54,"value":1833},"clients\u002Fmcp\u002Fsimple.py",{"type":54,"value":1358},{"type":48,"tag":451,"props":1836,"children":1838},{"id":1837},"_4-fund-the-wallet",[1839],{"type":54,"value":1840},"4. Fund the wallet",{"type":48,"tag":57,"props":1842,"children":1843},{},[1844],{"type":54,"value":1845},"Run the client once. With no USDC it fails, and it prints the address to fund. Send Base Sepolia\nUSDC there:",{"type":48,"tag":739,"props":1847,"children":1849},{"className":741,"code":1848,"language":14,"meta":743,"style":743},"import { CdpClient } from \"@coinbase\u002Fcdp-sdk\";\n\nawait new CdpClient().evm.requestFaucet({\n  address: evmAddress,\n  network: \"base-sepolia\",\n  token: \"usdc\",\n});\n",[1850],{"type":48,"tag":63,"props":1851,"children":1852},{"__ignoreMap":743},[1853,1893,1900,1946,1967,1996,2025],{"type":48,"tag":749,"props":1854,"children":1855},{"class":751,"line":752},[1856,1860,1864,1869,1873,1877,1881,1885,1889],{"type":48,"tag":749,"props":1857,"children":1858},{"style":756},[1859],{"type":54,"value":759},{"type":48,"tag":749,"props":1861,"children":1862},{"style":762},[1863],{"type":54,"value":765},{"type":48,"tag":749,"props":1865,"children":1866},{"style":768},[1867],{"type":54,"value":1868}," CdpClient",{"type":48,"tag":749,"props":1870,"children":1871},{"style":762},[1872],{"type":54,"value":776},{"type":48,"tag":749,"props":1874,"children":1875},{"style":756},[1876],{"type":54,"value":781},{"type":48,"tag":749,"props":1878,"children":1879},{"style":762},[1880],{"type":54,"value":786},{"type":48,"tag":749,"props":1882,"children":1883},{"style":789},[1884],{"type":54,"value":568},{"type":48,"tag":749,"props":1886,"children":1887},{"style":762},[1888],{"type":54,"value":796},{"type":48,"tag":749,"props":1890,"children":1891},{"style":762},[1892],{"type":54,"value":801},{"type":48,"tag":749,"props":1894,"children":1895},{"class":751,"line":804},[1896],{"type":48,"tag":749,"props":1897,"children":1898},{"emptyLinePlaceholder":849},[1899],{"type":54,"value":852},{"type":48,"tag":749,"props":1901,"children":1902},{"class":751,"line":845},[1903,1907,1911,1915,1919,1923,1928,1932,1937,1941],{"type":48,"tag":749,"props":1904,"children":1905},{"style":756},[1906],{"type":54,"value":1246},{"type":48,"tag":749,"props":1908,"children":1909},{"style":762},[1910],{"type":54,"value":877},{"type":48,"tag":749,"props":1912,"children":1913},{"style":880},[1914],{"type":54,"value":1868},{"type":48,"tag":749,"props":1916,"children":1917},{"style":768},[1918],{"type":54,"value":997},{"type":48,"tag":749,"props":1920,"children":1921},{"style":762},[1922],{"type":54,"value":78},{"type":48,"tag":749,"props":1924,"children":1925},{"style":768},[1926],{"type":54,"value":1927},"evm",{"type":48,"tag":749,"props":1929,"children":1930},{"style":762},[1931],{"type":54,"value":78},{"type":48,"tag":749,"props":1933,"children":1934},{"style":880},[1935],{"type":54,"value":1936},"requestFaucet",{"type":48,"tag":749,"props":1938,"children":1939},{"style":768},[1940],{"type":54,"value":887},{"type":48,"tag":749,"props":1942,"children":1943},{"style":762},[1944],{"type":54,"value":1945},"{\n",{"type":48,"tag":749,"props":1947,"children":1948},{"class":751,"line":855},[1949,1954,1958,1963],{"type":48,"tag":749,"props":1950,"children":1951},{"style":895},[1952],{"type":54,"value":1953},"  address",{"type":48,"tag":749,"props":1955,"children":1956},{"style":762},[1957],{"type":54,"value":903},{"type":48,"tag":749,"props":1959,"children":1960},{"style":768},[1961],{"type":54,"value":1962}," evmAddress",{"type":48,"tag":749,"props":1964,"children":1965},{"style":762},[1966],{"type":54,"value":469},{"type":48,"tag":749,"props":1968,"children":1969},{"class":751,"line":931},[1970,1975,1979,1983,1988,1992],{"type":48,"tag":749,"props":1971,"children":1972},{"style":895},[1973],{"type":54,"value":1974},"  network",{"type":48,"tag":749,"props":1976,"children":1977},{"style":762},[1978],{"type":54,"value":903},{"type":48,"tag":749,"props":1980,"children":1981},{"style":762},[1982],{"type":54,"value":786},{"type":48,"tag":749,"props":1984,"children":1985},{"style":789},[1986],{"type":54,"value":1987},"base-sepolia",{"type":48,"tag":749,"props":1989,"children":1990},{"style":762},[1991],{"type":54,"value":796},{"type":48,"tag":749,"props":1993,"children":1994},{"style":762},[1995],{"type":54,"value":469},{"type":48,"tag":749,"props":1997,"children":1998},{"class":751,"line":939},[1999,2004,2008,2012,2017,2021],{"type":48,"tag":749,"props":2000,"children":2001},{"style":895},[2002],{"type":54,"value":2003},"  token",{"type":48,"tag":749,"props":2005,"children":2006},{"style":762},[2007],{"type":54,"value":903},{"type":48,"tag":749,"props":2009,"children":2010},{"style":762},[2011],{"type":54,"value":786},{"type":48,"tag":749,"props":2013,"children":2014},{"style":789},[2015],{"type":54,"value":2016},"usdc",{"type":48,"tag":749,"props":2018,"children":2019},{"style":762},[2020],{"type":54,"value":796},{"type":48,"tag":749,"props":2022,"children":2023},{"style":762},[2024],{"type":54,"value":469},{"type":48,"tag":749,"props":2026,"children":2027},{"class":751,"line":949},[2028,2032,2036],{"type":48,"tag":749,"props":2029,"children":2030},{"style":762},[2031],{"type":54,"value":968},{"type":48,"tag":749,"props":2033,"children":2034},{"style":768},[2035],{"type":54,"value":924},{"type":48,"tag":749,"props":2037,"children":2038},{"style":762},[2039],{"type":54,"value":801},{"type":48,"tag":739,"props":2041,"children":2043},{"className":1409,"code":2042,"language":23,"meta":743,"style":743},"await cdp.evm.request_faucet(address=signer.address, network=\"base-sepolia\", token=\"usdc\")\n",[2044],{"type":48,"tag":63,"props":2045,"children":2046},{"__ignoreMap":743},[2047],{"type":48,"tag":749,"props":2048,"children":2049},{"class":751,"line":752},[2050],{"type":48,"tag":749,"props":2051,"children":2052},{},[2053],{"type":54,"value":2042},{"type":48,"tag":57,"props":2055,"children":2056},{},[2057],{"type":54,"value":2058},"The CDP faucet funds the same wallets the CDP Facilitator settles against, so there is no second\nfaucet to find. Wait for the transfer to confirm before re-running — requesting and paying in the\nsame run fails on an empty balance.",{"type":48,"tag":451,"props":2060,"children":2062},{"id":2061},"_5-verify",[2063],{"type":54,"value":2064},"5. Verify",{"type":48,"tag":57,"props":2066,"children":2067},{},[2068,2070,2076,2078,2083],{"type":54,"value":2069},"Re-run. ",{"type":48,"tag":63,"props":2071,"children":2073},{"className":2072},[],[2074],{"type":54,"value":2075},"HTTP 200",{"type":54,"value":2077}," is the success signal, and it proves the whole path: the payment was verified,\nsettled onchain, and the protected resource came back. If the user has no endpoint of their own\nyet, ",{"type":48,"tag":63,"props":2079,"children":2081},{"className":2080},[],[2082],{"type":54,"value":1151},{"type":54,"value":2084}," charges $0.01 on Base Sepolia.",{"type":48,"tag":85,"props":2086,"children":2088},{"id":2087},"troubleshooting",[2089],{"type":54,"value":2090},"Troubleshooting",{"type":48,"tag":201,"props":2092,"children":2093},{},[2094,2115],{"type":48,"tag":205,"props":2095,"children":2096},{},[2097],{"type":48,"tag":209,"props":2098,"children":2099},{},[2100,2105,2110],{"type":48,"tag":213,"props":2101,"children":2102},{},[2103],{"type":54,"value":2104},"Symptom",{"type":48,"tag":213,"props":2106,"children":2107},{},[2108],{"type":54,"value":2109},"Cause",{"type":48,"tag":213,"props":2111,"children":2112},{},[2113],{"type":54,"value":2114},"Fix",{"type":48,"tag":234,"props":2116,"children":2117},{},[2118,2141,2191,2214,2247],{"type":48,"tag":209,"props":2119,"children":2120},{},[2121,2131,2136],{"type":48,"tag":241,"props":2122,"children":2123},{},[2124,2129],{"type":48,"tag":63,"props":2125,"children":2127},{"className":2126},[],[2128],{"type":54,"value":68},{"type":54,"value":2130}," no matter how often you retry",{"type":48,"tag":241,"props":2132,"children":2133},{},[2134],{"type":54,"value":2135},"Wallet holds no USDC, or the faucet transfer has not confirmed",{"type":48,"tag":241,"props":2137,"children":2138},{},[2139],{"type":54,"value":2140},"Check the balance of the printed address before retrying",{"type":48,"tag":209,"props":2142,"children":2143},{},[2144,2156,2161],{"type":48,"tag":241,"props":2145,"children":2146},{},[2147,2149,2154],{"type":54,"value":2148},"Python ",{"type":48,"tag":63,"props":2150,"children":2152},{"className":2151},[],[2153],{"type":54,"value":1817},{"type":54,"value":2155}," on the client",{"type":48,"tag":241,"props":2157,"children":2158},{},[2159],{"type":54,"value":2160},"A sync client paired with async pieces, or the reverse",{"type":48,"tag":241,"props":2162,"children":2163},{},[2164,2170,2172,2177,2179,2185,2186],{"type":48,"tag":63,"props":2165,"children":2167},{"className":2166},[],[2168],{"type":54,"value":2169},"x402_requests",{"type":54,"value":2171}," needs ",{"type":48,"tag":63,"props":2173,"children":2175},{"className":2174},[],[2176],{"type":54,"value":1803},{"type":54,"value":2178},"; ",{"type":48,"tag":63,"props":2180,"children":2182},{"className":2181},[],[2183],{"type":54,"value":2184},"x402HttpxClient",{"type":54,"value":2171},{"type":48,"tag":63,"props":2187,"children":2189},{"className":2188},[],[2190],{"type":54,"value":1374},{"type":48,"tag":209,"props":2192,"children":2193},{},[2194,2199,2209],{"type":48,"tag":241,"props":2195,"children":2196},{},[2197],{"type":54,"value":2198},"Wallet authentication error",{"type":48,"tag":241,"props":2200,"children":2201},{},[2202,2207],{"type":48,"tag":63,"props":2203,"children":2205},{"className":2204},[],[2206],{"type":54,"value":483},{"type":54,"value":2208}," missing or wrong",{"type":48,"tag":241,"props":2210,"children":2211},{},[2212],{"type":54,"value":2213},"It is separate from the API key secret; check both",{"type":48,"tag":209,"props":2215,"children":2216},{},[2217,2222,2227],{"type":48,"tag":241,"props":2218,"children":2219},{},[2220],{"type":54,"value":2221},"No scheme registered for network",{"type":48,"tag":241,"props":2223,"children":2224},{},[2225],{"type":54,"value":2226},"Registered chain ID differs from the one the server asks for",{"type":48,"tag":241,"props":2228,"children":2229},{},[2230,2232,2238,2240,2245],{"type":54,"value":2231},"Match the ",{"type":48,"tag":63,"props":2233,"children":2235},{"className":2234},[],[2236],{"type":54,"value":2237},"network",{"type":54,"value":2239}," in the ",{"type":48,"tag":63,"props":2241,"children":2243},{"className":2242},[],[2244],{"type":54,"value":68},{"type":54,"value":2246}," response",{"type":48,"tag":209,"props":2248,"children":2249},{},[2250,2255,2259],{"type":48,"tag":241,"props":2251,"children":2252},{},[2253],{"type":54,"value":2254},"Payment exceeds balance",{"type":48,"tag":241,"props":2256,"children":2257},{},[2258],{"type":54,"value":426},{"type":48,"tag":241,"props":2260,"children":2261},{},[2262],{"type":54,"value":2263},"Report the shortfall in USDC, not atomic units: 10000 is $0.01",{"type":48,"tag":85,"props":2265,"children":2267},{"id":2266},"runnable-examples",[2268],{"type":54,"value":2269},"Runnable examples",{"type":48,"tag":57,"props":2271,"children":2272},{},[2273,2275,2281,2283,2289,2290,2296,2297,2303,2304,2309,2310,2316],{"type":54,"value":2274},"TypeScript, under ",{"type":48,"tag":63,"props":2276,"children":2278},{"className":2277},[],[2279],{"type":54,"value":2280},"https:\u002F\u002Fgithub.com\u002Fcoinbase\u002Fcdp-sdk\u002Fblob\u002Fmain\u002Fexamples\u002Ftypescript\u002Fx402\u002Fclients\u002F",{"type":54,"value":2282},":\n",{"type":48,"tag":63,"props":2284,"children":2286},{"className":2285},[],[2287],{"type":54,"value":2288},"payForApi.ts",{"type":54,"value":513},{"type":48,"tag":63,"props":2291,"children":2293},{"className":2292},[],[2294],{"type":54,"value":2295},"payForApiWithAxios.ts",{"type":54,"value":513},{"type":48,"tag":63,"props":2298,"children":2300},{"className":2299},[],[2301],{"type":54,"value":2302},"payForApiWithSpendControls.ts",{"type":54,"value":513},{"type":48,"tag":63,"props":2305,"children":2307},{"className":2306},[],[2308],{"type":54,"value":1389},{"type":54,"value":469},{"type":48,"tag":63,"props":2311,"children":2313},{"className":2312},[],[2314],{"type":54,"value":2315},"mcp\u002Fsimple.ts",{"type":54,"value":78},{"type":48,"tag":57,"props":2318,"children":2319},{},[2320,2322,2328,2329,2335,2336,2342,2343,2349],{"type":54,"value":2321},"Python, under ",{"type":48,"tag":63,"props":2323,"children":2325},{"className":2324},[],[2326],{"type":54,"value":2327},"https:\u002F\u002Fgithub.com\u002Fcoinbase\u002Fcdp-sdk\u002Fblob\u002Fmain\u002Fexamples\u002Fpython\u002Fx402\u002Fclients\u002F",{"type":54,"value":2282},{"type":48,"tag":63,"props":2330,"children":2332},{"className":2331},[],[2333],{"type":54,"value":2334},"pay_for_api.py",{"type":54,"value":513},{"type":48,"tag":63,"props":2337,"children":2339},{"className":2338},[],[2340],{"type":54,"value":2341},"pay_for_api_with_requests.py",{"type":54,"value":513},{"type":48,"tag":63,"props":2344,"children":2346},{"className":2345},[],[2347],{"type":54,"value":2348},"mcp\u002Fsimple.py",{"type":54,"value":78},{"type":48,"tag":85,"props":2351,"children":2353},{"id":2352},"beyond-the-first-paid-call",[2354],{"type":54,"value":2355},"Beyond the first paid call",{"type":48,"tag":92,"props":2357,"children":2358},{},[2359,2369,2381,2393],{"type":48,"tag":96,"props":2360,"children":2361},{},[2362,2364],{"type":54,"value":2363},"Spend limits, allowlists, lifecycle hooks: ",{"type":48,"tag":108,"props":2365,"children":2367},{"href":183,"rel":2366},[112],[2368],{"type":54,"value":187},{"type":48,"tag":96,"props":2370,"children":2371},{},[2372,2374],{"type":54,"value":2373},"Finding services to pay for: ",{"type":48,"tag":108,"props":2375,"children":2378},{"href":2376,"rel":2377},"https:\u002F\u002Fdocs.cdp.coinbase.com\u002Fx402\u002Fbuyer\u002Fdiscover-services",[112],[2379],{"type":54,"value":2380},"Discover services",{"type":48,"tag":96,"props":2382,"children":2383},{},[2384,2386],{"type":54,"value":2385},"Discovery and payment over MCP: ",{"type":48,"tag":108,"props":2387,"children":2390},{"href":2388,"rel":2389},"https:\u002F\u002Fdocs.cdp.coinbase.com\u002Fx402\u002Fbuyer\u002Fmcp-payments",[112],[2391],{"type":54,"value":2392},"Discover and pay over MCP",{"type":48,"tag":96,"props":2394,"children":2395},{},[2396,2398,2403],{"type":54,"value":2397},"Mainnet: drop ",{"type":48,"tag":63,"props":2399,"children":2401},{"className":2400},[],[2402],{"type":54,"value":369},{"type":54,"value":2404},", fund with real USDC, and confirm with the user first",{"type":48,"tag":2406,"props":2407,"children":2408},"style",{},[2409],{"type":54,"value":2410},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2412,"total":845},[2413,2421,2432],{"slug":4,"name":4,"fn":5,"description":6,"org":2414,"tags":2415,"stars":27,"repoUrl":28,"updatedAt":29},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2416,2417,2418,2419,2420],{"name":25,"slug":26,"type":15},{"name":19,"slug":20,"type":15},{"name":22,"slug":23,"type":15},{"name":13,"slug":14,"type":15},{"name":17,"slug":17,"type":15},{"slug":160,"name":160,"fn":2422,"description":2423,"org":2424,"tags":2425,"stars":27,"repoUrl":28,"updatedAt":2431},"implement x402 payment server for HTTP routes","Write code that charges for an HTTP route with the x402 protocol and receives USDC in a\nCDP-managed wallet. Covers TypeScript (Express, Hono, Next.js) and Python (FastAPI, Flask). Use\nwhen the user wants to monetize an API, price a route per request, put a paywall in front of an\nendpoint, accept payments from agents, or add x402 to a server they already run.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2426,2427,2428,2429,2430],{"name":25,"slug":26,"type":15},{"name":19,"slug":20,"type":15},{"name":22,"slug":23,"type":15},{"name":13,"slug":14,"type":15},{"name":17,"slug":17,"type":15},"2026-08-06T06:09:12.454558",{"slug":2433,"name":2433,"fn":2434,"description":2435,"org":2436,"tags":2437,"stars":2452,"repoUrl":2453,"updatedAt":2454},"agentic-wallet","perform crypto wallet operations and payments","Crypto wallet operations via the awal CLI — sign in, check balances, send USDC\u002FETH\u002FPOL\u002FSOL, trade tokens, fund the wallet, and use the x402 payment protocol to discover paid services, pay for API calls, monetize an API, or query onchain data. Use whenever the user mentions signing in, login, authentication, wallet status, balance, address, sending money, paying someone, transferring tokens, ENS names, swapping\u002Ftrading\u002Fconverting tokens, funding\u002Ftopping up\u002Fonramp, USDC, ETH, POL, SOL, the x402 bazaar, paid APIs, monetizing an endpoint, or querying onchain data on Base.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2438,2441,2444,2447,2448,2451],{"name":2439,"slug":2440,"type":15},"Automation","automation",{"name":2442,"slug":2443,"type":15},"CLI","cli",{"name":2445,"slug":2446,"type":15},"Ethereum","ethereum",{"name":19,"slug":20,"type":15},{"name":2449,"slug":2450,"type":15},"Web3","web3",{"name":17,"slug":17,"type":15},121,"https:\u002F\u002Fgithub.com\u002Fcoinbase\u002Fagentic-wallet-skills","2026-08-06T05:39:18.524241",{"items":2456,"total":804},[2457,2465],{"slug":4,"name":4,"fn":5,"description":6,"org":2458,"tags":2459,"stars":27,"repoUrl":28,"updatedAt":29},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2460,2461,2462,2463,2464],{"name":25,"slug":26,"type":15},{"name":19,"slug":20,"type":15},{"name":22,"slug":23,"type":15},{"name":13,"slug":14,"type":15},{"name":17,"slug":17,"type":15},{"slug":160,"name":160,"fn":2422,"description":2423,"org":2466,"tags":2467,"stars":27,"repoUrl":28,"updatedAt":2431},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2468,2469,2470,2471,2472],{"name":25,"slug":26,"type":15},{"name":19,"slug":20,"type":15},{"name":22,"slug":23,"type":15},{"name":13,"slug":14,"type":15},{"name":17,"slug":17,"type":15}]