From 91d122bbb58473daaed5ba405cb4a832e07387ad Mon Sep 17 00:00:00 2001 From: Johan Loutfi Date: Fri, 9 Oct 2026 11:01:05 +0200 Subject: [PATCH 1/5] docs(x402): correct the coinbase migration page on agent clients, route keys and fees --- src/pages/agents/faq.mdx | 2 +- .../recipes/migrate-from-coinbase-x402.mdx | 41 +++++++++++-------- src/pages/agents/x402/quickstart.mdx | 2 +- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/src/pages/agents/faq.mdx b/src/pages/agents/faq.mdx index 5cf3843..757c051 100644 --- a/src/pages/agents/faq.mdx +++ b/src/pages/agents/faq.mdx @@ -27,7 +27,7 @@ import { HelpFooter } from '@/components/HelpFooter' }, { question: "How is this different from Coinbase x402?", - answer: "Coinbase x402 handles USDC only. Parallel x402 accepts USDp, USDC, and sUSDp, converts automatically when the agent pays in a different token than you receive, and sponsors gas on Base, HyperEVM, and Avalanche. It's the same x402 standard, so you can migrate in minutes." + answer: "Coinbase x402 settles the token the agent signs for. Parallel x402 accepts USDp, USDC, and sUSDp, and converts between them when the agent pays in a different token than you receive: USDp and sUSDp on every network, USDC on Base and Avalanche. Your server moves in minutes, and agents pay with the Parallel client, @parallel-protocol/x402-fetch." }, { question: "Is the facilitator audited?", diff --git a/src/pages/agents/recipes/migrate-from-coinbase-x402.mdx b/src/pages/agents/recipes/migrate-from-coinbase-x402.mdx index a974415..ac42ae0 100644 --- a/src/pages/agents/recipes/migrate-from-coinbase-x402.mdx +++ b/src/pages/agents/recipes/migrate-from-coinbase-x402.mdx @@ -1,25 +1,26 @@ --- title: Migrate from Coinbase x402 to Parallel -description: Point your middleware at the Parallel facilitator and start accepting USDp, USDC, and sUSDp. A few lines of code, no agent-side changes. +description: Point your middleware at the Parallel facilitator and start accepting USDp, USDC, and sUSDp. A few lines change on your server, and your agents pay with the Parallel client. --- import { HelpFooter } from '@/components/HelpFooter' # Migrate from Coinbase x402 to Parallel -If you already use the Coinbase x402 facilitator, switching to Parallel takes a few minutes. x402 is a standard — your routes, your pricing, and your existing agent clients keep working. +If you already use the Coinbase x402 middleware, moving your server to Parallel takes a few minutes. Your routes and prices carry over, written in the Parallel format below. Your agents need the Parallel client: Parallel uses its own payment format, so a Coinbase x402 client cannot pay a Parallel route. ## The change -**Before (Coinbase x402):** +**Before (Coinbase x402, `x402-express`):** ```ts import { paymentMiddleware } from "x402-express"; +import { facilitator } from "@coinbase/x402"; app.use(paymentMiddleware( "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", { "/api/search": { price: "$0.01", network: "base" } }, - { url: "https://x402.org/facilitator" } + facilitator )); ``` @@ -44,37 +45,41 @@ Install `@parallel-protocol/x402` 0.8.2 or later: since 1 October 2026 the facil Keep the facilitator's URL in https, as above. Since 0.8.1, the SDK refuses a plain http URL outside `localhost`, `127.0.0.1` and `[::1]` with an `X402ConfigError` when the middleware is created. It calls that address only and never follows a redirect, which fails the call with `FACILITATOR_UNAVAILABLE`. -The shape changes — `payTo` moves into the route, and prices drop the `$` prefix — but every concept maps one-to-one. Agents paying in USDC keep paying in USDC. Agents holding USDp can now pay you natively, with the facilitator handling conversion at no extra fee. +Three things change in a route: + +- `payTo` moves into the route. +- The price is an amount of each accepted token, without the `$` prefix: `"0.01"` asks for 0.01 USDp, 0.01 USDC, or 0.01 sUSDp. +- The route key is a plain path, and it also covers the paths below it: `"/api"` covers `"/api/search"`. Keys with a method, a wildcard, or a parameter, such as `"GET /api/search"`, `"/api/*"`, or `"/api/[id]"`, match no request, and a request that matches no route is served without payment. Write `"/api/search"` or `"/api"` instead. ## What you gain -- **Automatic conversion** when the agent holds one token and you accept another — no extra platform fee. -- **Gas sponsored** on Base, HyperEVM, and Avalanche. -- **More tokens accepted** — USDp, USDC, and sUSDp (yield-bearing: your revenue earns from the moment it settles). -- **Same x402 standard** — no API change, no breaking change, no agent migration required. +- **Automatic conversion** when the agent holds one token and you accept another: between USDp and sUSDp on every network, and with USDC on Base and Avalanche, where USDC backs USDp. The facilitator takes no fee. A swap through the Parallelizer pays its mint or burn fee, on the agent's side: you receive at least your price. +- **Three tokens accepted**: USDp, USDC, and sUSDp (yield-bearing: your revenue earns from the moment it settles). ## What stays the same - Your handler signatures. -- Your existing agent clients. -- Your wallet address — funds still settle directly to it. +- Your wallet address: payments settle to it. +- Gas: the facilitator pays it on Base, HyperEVM, and Avalanche, as the Coinbase facilitator does. + +## What changes for your agents + +Agents pay Parallel routes with [`@parallel-protocol/x402-fetch`](/agents/x402/agent-quickstart), a drop-in `fetch` replacement. Parallel uses its own payment format, so a Coinbase x402 client cannot pay a Parallel route. ## Comparison | | Coinbase x402 | **Parallel x402** | |---|---|---| -| Tokens accepted | USDC only | **USDC, USDp, and sUSDp** | -| Conversion | — | **Automatic, no extra platform fee** | -| Gas | Standard | **Sponsored on Base, HyperEVM, and Avalanche** | +| Conversion between tokens | No | **Automatic, no facilitator fee** | | Settles to | Your wallet | **Your wallet** | -| Standard | x402 | **x402 (compatible)** | +| Agent client | Coinbase x402 clients | **`@parallel-protocol/x402-fetch`** | ## FAQ -**Do I lose access to USDC payments?** No. USDC is fully supported. +**Do I lose access to USDC payments?** No. USDC is accepted next to USDp and sUSDp. -**Do I need to update my agent clients?** No. x402 is a standard — agents sending standard USDC payment payloads keep working. +**Do I need to update my agent clients?** Yes. Agents pay Parallel routes with [`@parallel-protocol/x402-fetch`](/agents/x402/agent-quickstart). A Coinbase x402 client cannot pay them, since Parallel uses its own payment format. -**Can I run both facilitators in parallel?** Yes — point different routes (or different deployments) at different facilitators. +**Can I run both facilitators in parallel?** Yes. Keep the Coinbase middleware on some routes and put the Parallel middleware on others, or on another deployment. An agent pays each route with the client of its facilitator. diff --git a/src/pages/agents/x402/quickstart.mdx b/src/pages/agents/x402/quickstart.mdx index 99e0c29..b1196f0 100644 --- a/src/pages/agents/x402/quickstart.mdx +++ b/src/pages/agents/x402/quickstart.mdx @@ -145,7 +145,7 @@ Read more: [The verify / settle flow](/agents/x402/verify-vs-settle). ## Next steps - [Concepts: how routing, fees, and gas work](/agents/x402/concepts) -- [Migrate from Coinbase x402 in one line](/agents/recipes/migrate-from-coinbase-x402) +- [Migrate from Coinbase x402](/agents/recipes/migrate-from-coinbase-x402) - [API reference](/agents/x402/api-reference) From 40592288453516fb67d2ee7ffb9eb8ef470ab557 Mon Sep 17 00:00:00 2001 From: Johan Loutfi Date: Wed, 4 Nov 2026 10:35:07 +0100 Subject: [PATCH 2/5] docs(x402): the migration page covers coinbase clients on metered usdc routes --- .../recipes/migrate-from-coinbase-x402.mdx | 83 +++++++++++++++---- 1 file changed, 69 insertions(+), 14 deletions(-) diff --git a/src/pages/agents/recipes/migrate-from-coinbase-x402.mdx b/src/pages/agents/recipes/migrate-from-coinbase-x402.mdx index ac42ae0..15b6d92 100644 --- a/src/pages/agents/recipes/migrate-from-coinbase-x402.mdx +++ b/src/pages/agents/recipes/migrate-from-coinbase-x402.mdx @@ -1,17 +1,17 @@ --- title: Migrate from Coinbase x402 to Parallel -description: Point your middleware at the Parallel facilitator and start accepting USDp, USDC, and sUSDp. A few lines change on your server, and your agents pay with the Parallel client. +description: Point your middleware at the Parallel facilitator and start accepting USDp, USDC, and sUSDp. A few lines change on your server. Agents pay with the Parallel client, or with Coinbase x402 clients on metered USDC routes on Base. --- import { HelpFooter } from '@/components/HelpFooter' # Migrate from Coinbase x402 to Parallel -If you already use the Coinbase x402 middleware, moving your server to Parallel takes a few minutes. Your routes and prices carry over, written in the Parallel format below. Your agents need the Parallel client: Parallel uses its own payment format, so a Coinbase x402 client cannot pay a Parallel route. +If you already use the Coinbase x402 middleware, moving your server to Parallel takes a few minutes. Your routes and prices carry over, written in the Parallel format below. Agents pay fixed-price routes with the Parallel client, since a Coinbase x402 client cannot sign Parallel's `exact` payments. Coinbase x402 clients that support the `upto` scheme can still pay a metered route on Base in USDC. See [Agents on Coinbase x402 clients](#agents-on-coinbase-x402-clients). ## The change -**Before (Coinbase x402, `x402-express`):** +**Before (Coinbase x402 v1, `x402-express`):** ```ts import { paymentMiddleware } from "x402-express"; @@ -24,6 +24,34 @@ app.use(paymentMiddleware( )); ``` +**Before (Coinbase x402 v2, `@x402/express`):** + +```ts +import { paymentMiddleware, x402ResourceServer } from "@x402/express"; +import { ExactEvmScheme } from "@x402/evm/exact/server"; +import { HTTPFacilitatorClient } from "@x402/core/server"; + +const facilitatorClient = new HTTPFacilitatorClient({ + url: "https://api.cdp.coinbase.com/platform/v2/x402" +}); +const resourceServer = new x402ResourceServer(facilitatorClient) + .register("eip155:8453", new ExactEvmScheme()); + +app.use(paymentMiddleware( + { + "GET /api/search": { + accepts: [{ + scheme: "exact", + price: "$0.01", + network: "eip155:8453", + payTo: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F" + }] + } + }, + resourceServer +)); +``` + **After (Parallel x402):** ```ts @@ -41,30 +69,57 @@ app.use(paymentMiddleware({ })); ``` -Install `@parallel-protocol/x402` 0.8.2 or later: since 1 October 2026 the facilitator refuses a settle that does not present the token it issued at verify, and versions before 0.8.0 do not send it. Version 0.8.1 adds the URL checks below. +Install `@parallel-protocol/x402` 0.10.0 or later. It is the first version that takes payments from Coinbase x402 clients, on metered routes. A version before 0.8.0 no longer settles anything: since 1 October 2026 the facilitator refuses a settle that does not present the token it issued at verify. Version 0.8.1 adds the URL checks below. Keep the facilitator's URL in https, as above. Since 0.8.1, the SDK refuses a plain http URL outside `localhost`, `127.0.0.1` and `[::1]` with an `X402ConfigError` when the middleware is created. It calls that address only and never follows a redirect, which fails the call with `FACILITATOR_UNAVAILABLE`. -Three things change in a route: +Four things change in a route: - `payTo` moves into the route. -- The price is an amount of each accepted token, without the `$` prefix: `"0.01"` asks for 0.01 USDp, 0.01 USDC, or 0.01 sUSDp. +- The price is an amount of each accepted token, without the `$` prefix: `"0.01"` asks for 0.01 USDp, 0.01 USDC, or 0.01 sUSDp. A price with `$` is refused with `X402ConfigError` when the middleware is created. +- The network is a chain slug: `"base"`, `"ethereum"`, `"avalanche"` or `"hyperevm"`. The SDK looks up the default tokens and their decimals by slug, and a route written with the `"eip155:8453"` form of Coinbase's v2 SDK finds neither, so its first request fails with `X402ConfigError` unless you set `acceptedTokens` and `decimals` yourself. - The route key is a plain path, and it also covers the paths below it: `"/api"` covers `"/api/search"`. Keys with a method, a wildcard, or a parameter, such as `"GET /api/search"`, `"/api/*"`, or `"/api/[id]"`, match no request, and a request that matches no route is served without payment. Write `"/api/search"` or `"/api"` instead. ## What you gain -- **Automatic conversion** when the agent holds one token and you accept another: between USDp and sUSDp on every network, and with USDC on Base and Avalanche, where USDC backs USDp. The facilitator takes no fee. A swap through the Parallelizer pays its mint or burn fee, on the agent's side: you receive at least your price. -- **Three tokens accepted**: USDp, USDC, and sUSDp (yield-bearing: your revenue earns from the moment it settles). +- **Automatic conversion** when the agent holds one token and you accept another: between USDp and sUSDp on every network, and with USDC on Base and Avalanche, where USDC backs USDp. The facilitator takes no fee. On a fixed-price route, a swap through the Parallelizer pays its mint or burn fee on the agent's side, and you receive at least your price. On a metered route paid in USDC, the USDp you receive is the Parallelizer's conversion of the USDC charged, so its mint fee is on your side. +- **Up to three tokens accepted**: USDp, USDC, and sUSDp, all three by default on a fixed-price route, or the ones you list in `acceptedTokens`. sUSDp is yield-bearing: your revenue earns from the moment it settles. ## What stays the same -- Your handler signatures. +- Your handler signatures. On Next.js, wrap each route handler with `withPayment`. It passes the handler the request only, and expects a `NextResponse` back. - Your wallet address: payments settle to it. -- Gas: the facilitator pays it on Base, HyperEVM, and Avalanche, as the Coinbase facilitator does. +- Gas: the facilitator sends the settlement transaction, so agents need no gas token. ## What changes for your agents -Agents pay Parallel routes with [`@parallel-protocol/x402-fetch`](/agents/x402/agent-quickstart), a drop-in `fetch` replacement. Parallel uses its own payment format, so a Coinbase x402 client cannot pay a Parallel route. +Agents pay fixed-price routes with [`@parallel-protocol/x402-fetch`](/agents/x402/agent-quickstart), a drop-in `fetch` replacement. A Coinbase x402 client cannot pay them, because Parallel's `exact` payments use their own format. Coinbase x402 clients can keep paying metered routes on Base in USDC, as below. + +## Agents on Coinbase x402 clients + +Coinbase x402 clients that support the `upto` scheme, AgentCash among them, can pay a metered route on Base in USDC. They sign a Permit2 transfer of the cap. The middleware translates the payment, and Parallel's escrow converts the USDC charged to USDp, which you receive. + +```ts +import { PARALLEL_TOKENS } from "@parallel-protocol/x402"; +import { paymentMiddleware } from "@parallel-protocol/x402/express"; + +app.use(paymentMiddleware({ + facilitator: { url: "https://agents.parallel.best" }, + routes: { + "/api/search": { + scheme: "upto", + price: "0.01", + network: "base", + payTo: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + acceptedTokens: [PARALLEL_TOKENS.base.usdc, PARALLEL_TOKENS.base.usdp] + } + } +})); +``` + +Before you list USDC, approve the escrow for USDC once from the `payTo` address, with an ERC-20 `approve` on Base USDC. The escrow is `0xc3F4de61381A05ED7FBE61c8327B45507BA87F26`, which `getUptoEscrowAddress("base")` in `@parallel-protocol/chains` returns. Use a dedicated receiving address, since it limits what the approval exposes. Until the approval is in place, these payments are refused at verify with `MERCHANT_NOT_ENABLED`. + +On a metered route, `price` is a cap. Your handler names the amount it charges in the `payment-settle-amount` header, and the cap is charged when it names none. Write the price as a decimal string. Coinbase x402 clients count the whole cap against their spending limit, which is $1 per payment by default in their current release, so keep the cap low. The receipt gives the USDC charged in `amountSettled`, and the USDp you received in `amountDelivered`. ## Comparison @@ -72,13 +127,13 @@ Agents pay Parallel routes with [`@parallel-protocol/x402-fetch`](/agents/x402/a |---|---|---| | Conversion between tokens | No | **Automatic, no facilitator fee** | | Settles to | Your wallet | **Your wallet** | -| Agent client | Coinbase x402 clients | **`@parallel-protocol/x402-fetch`** | +| Agent client | Coinbase x402 clients | **`@parallel-protocol/x402-fetch`, and Coinbase x402 clients on metered USDC routes on Base** | ## FAQ -**Do I lose access to USDC payments?** No. USDC is accepted next to USDp and sUSDp. +**Do I lose access to USDC payments?** No. USDC is accepted next to USDp and sUSDp. On a fixed-price route, agents pay it through the Parallel client. On a metered route on Base, Coinbase x402 clients pay it too. -**Do I need to update my agent clients?** Yes. Agents pay Parallel routes with [`@parallel-protocol/x402-fetch`](/agents/x402/agent-quickstart). A Coinbase x402 client cannot pay them, since Parallel uses its own payment format. +**Do I need to update my agent clients?** For fixed-price routes, yes: agents pay them with [`@parallel-protocol/x402-fetch`](/agents/x402/agent-quickstart). Agents on Coinbase x402 clients with the `upto` scheme can keep paying metered routes on Base in USDC. **Can I run both facilitators in parallel?** Yes. Keep the Coinbase middleware on some routes and put the Parallel middleware on others, or on another deployment. An agent pays each route with the client of its facilitator. From 5e7e3528bf65e5b7e1e10d43b2fe4eb80ad0401a Mon Sep 17 00:00:00 2001 From: Johan Loutfi Date: Wed, 4 Nov 2026 10:35:16 +0100 Subject: [PATCH 3/5] docs(agents): faq on the gas quota, metered usdc and the facilitator health --- src/pages/agents/faq.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/agents/faq.mdx b/src/pages/agents/faq.mdx index 757c051..40e119a 100644 --- a/src/pages/agents/faq.mdx +++ b/src/pages/agents/faq.mdx @@ -11,15 +11,15 @@ import { HelpFooter } from '@/components/HelpFooter' &chain= on the facilitator. Webhook delivery is on the roadmap." }, { question: "What about KYC / AML?", From 1fb2160a79eeb2b43ecfa61c59b08385465210df Mon Sep 17 00:00:00 2001 From: Johan Loutfi Date: Wed, 4 Nov 2026 10:47:26 +0100 Subject: [PATCH 4/5] docs(agents): the faq names the audited contracts --- src/pages/agents/faq.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/agents/faq.mdx b/src/pages/agents/faq.mdx index 40e119a..c9691cf 100644 --- a/src/pages/agents/faq.mdx +++ b/src/pages/agents/faq.mdx @@ -31,7 +31,7 @@ import { HelpFooter } from '@/components/HelpFooter' }, { question: "Is the facilitator audited?", - answer: "The smart contracts that settle every payment are audited by Bailsec, Cyfrin, and Certora. The facilitator itself is a hosted service operated by Parallel." + answer: "The protocol contracts payments go through, the USDp and sUSDp tokens and the Parallelizer, are audited by Bail Security, Cyfrin and Certora. The reports are on the audits page, docs.parallel.best/security/audits. The facilitator itself is a hosted service operated by Parallel." }, { question: "What happens if the facilitator goes down?", From 39aafe88e5dd141f2814c5d7bdcba3a461c2a0ce Mon Sep 17 00:00:00 2001 From: Johan Loutfi Date: Wed, 4 Nov 2026 12:50:16 +0100 Subject: [PATCH 5/5] docs(agents): the escrow approval is renewed once payments use it up --- src/pages/agents/faq.mdx | 2 +- src/pages/agents/recipes/migrate-from-coinbase-x402.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/agents/faq.mdx b/src/pages/agents/faq.mdx index c9691cf..c21fcd1 100644 --- a/src/pages/agents/faq.mdx +++ b/src/pages/agents/faq.mdx @@ -15,7 +15,7 @@ import { HelpFooter } from '@/components/HelpFooter' }, { question: "Do I need to create an account?", - answer: "No. There's no signup, no KYB, and no Parallel onboarding. Funds settle directly to the wallet address you control. You can start accepting payments in about five minutes. Accepting USDC on a metered route needs one transaction: your payTo address approves the escrow for USDC once." + answer: "No. There's no signup, no KYB, and no Parallel onboarding. Funds settle directly to the wallet address you control. You can start accepting payments in about five minutes. Accepting USDC on a metered route needs one approval: your payTo address approves the escrow for USDC, and renews it when payments bring the allowance below the route's cap." }, { question: "What stablecoins are supported?", diff --git a/src/pages/agents/recipes/migrate-from-coinbase-x402.mdx b/src/pages/agents/recipes/migrate-from-coinbase-x402.mdx index 15b6d92..7072d4c 100644 --- a/src/pages/agents/recipes/migrate-from-coinbase-x402.mdx +++ b/src/pages/agents/recipes/migrate-from-coinbase-x402.mdx @@ -117,7 +117,7 @@ app.use(paymentMiddleware({ })); ``` -Before you list USDC, approve the escrow for USDC once from the `payTo` address, with an ERC-20 `approve` on Base USDC. The escrow is `0xc3F4de61381A05ED7FBE61c8327B45507BA87F26`, which `getUptoEscrowAddress("base")` in `@parallel-protocol/chains` returns. Use a dedicated receiving address, since it limits what the approval exposes. Until the approval is in place, these payments are refused at verify with `MERCHANT_NOT_ENABLED`. +Before you list USDC, approve the escrow for USDC once from the `payTo` address, with an ERC-20 `approve` on Base USDC. The escrow is `0xc3F4de61381A05ED7FBE61c8327B45507BA87F26`, which `getUptoEscrowAddress("base")` in `@parallel-protocol/chains` returns. Each payment uses up the USDC it converts from that allowance: when what is left falls below the route's cap, approve again. Until then, and before the first approval, these payments are refused at verify with `MERCHANT_NOT_ENABLED`. Use a dedicated receiving address, since it limits what the approval exposes. On a metered route, `price` is a cap. Your handler names the amount it charges in the `payment-settle-amount` header, and the cap is charged when it names none. Write the price as a decimal string. Coinbase x402 clients count the whole cap against their spending limit, which is $1 per payment by default in their current release, so keep the cap low. The receipt gives the USDC charged in `amountSettled`, and the USDp you received in `amountDelivered`.