x402_sign_payment
Parse X402 payment requirements from the PAYMENT-REQUIRED header or response body, create a signed payment authorization, and submit it to complete a 402-protected HTTP request.
Instructions
Parse X402 payment requirements from PAYMENT-REQUIRED header or response body, create a signed payment authorization, and submit the payment to complete a 402-protected request. Supports signing modes: local_private_key (local EVM wallet), quick_wallet (custodial MCP wallet), and plugin_wallet (browser extension wallet). For centralized payment (中心化支付), obtain Gate Pay access_token via x402_gate_pay_auth and use x402_submit_payment with sign_mode centralized_payment — no MCP calls for Gate Pay auth. Provide either payment_required_header or response_body containing X402 payment requirements.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Target URL for the payment request | |
| body | No | JSON string request body (optional) | |
| method | No | HTTP method for the request | |
| sign_mode | No | Optional preferred signing mode. Omit to auto-select the highest-priority ready mode. | |
| response_body | No | Optional: Response body from 402 response, used for parsing payment requirements if PAYMENT-REQUIRED header is not available | |
| wallet_login_provider | No | When quick_wallet needs login: google = Google account, gate = Gate account. Defaults to gate. | |
| payment_required_header | No | Base64-encoded PAYMENT-REQUIRED header value from a 402 response |