Skip to content

Commit 5db51ea

Browse files
authored
docs(x402): clarify the payment signature is reusable until balance runs out (#2618)
## Context The x402 page doesn't state that the signed `PAYMENT-SIGNATURE` can be reused across calls. A reader following the direct-API steps may assume each call needs a fresh signature and a new on-chain settlement. ## Solution - Add a `:::note` in the direct-API section: the same `PAYMENT-SIGNATURE` stays valid while the prepaid balance lasts; resend it on every call with no re-signing or new settlement, and only sign again when the API returns `402` (balance exhausted) — the manual equivalent of what `mcpc` does automatically on the MCP path. - Tighten the prepaid-balance bullet to say subsequent calls reuse the same signature.
1 parent 48e3a8c commit 5db51ea

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • sources/platform/integrations/ai

sources/platform/integrations/ai/x402.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ You can also send x402 payments directly against the Apify REST API. This works
8181
1. Resend the request with two headers: `X-APIFY-PAYMENT-PROTOCOL: X402` and `PAYMENT-SIGNATURE: <signed payload>`.
8282
1. The API settles the payment on-chain, runs the Actor, and returns the dataset items directly.
8383

84+
:::note Reuse the same signature
85+
86+
The signed `PAYMENT-SIGNATURE` stays valid while your prepaid balance lasts. Send it with every subsequent request - each call draws from the balance with no new signing and no new on-chain settlement. When the balance is exhausted, the API responds with `402` again; sign the payment again to continue.
87+
88+
:::
89+
8490
### Example
8591

8692
:::caution Actor name format
@@ -117,7 +123,7 @@ You can replace `apify~instagram-post-scraper` with any supported Actor from [Ap
117123
Both paths (MCP server and direct API) share the same pricing model:
118124

119125
- Minimum transaction: $1 in USDC.
120-
- The payment is tracked as a prepaid balance. Subsequent calls draw from it without new on-chain transactions.
126+
- The payment is tracked as a prepaid balance. Subsequent calls reuse the same signature and draw from it without re-signing or any new on-chain transaction.
121127
- When using the MCP server, `mcpc` signs a new payment automatically when the balance runs out.
122128
- After 60 minutes of inactivity (no running Actors), any remaining balance is refunded on-chain to your wallet, minus a small [gas fee (network cost)](https://docs.base.org/base-chain/network-information/network-fees) charged by the Base network to process the transaction.
123129

0 commit comments

Comments
 (0)