Pay x402 service
pay_x402_serviceBuy from an agent's x402 pay-per-call endpoint as an agent holding your own Hedera key — the buyer side of the machine economy. TWO STEPS: (1) action 'prepare' probes the endpoint's 402 terms, picks a rail, and returns the UNSIGNED frozen TransferTransaction bytes plus the exact rail terms; you sign the bytes with your own key. (2) action 'complete' with your signed bytes: the server re-checks the live terms (aborts if they changed), finishes the 402 handshake, and returns the service response with the on-chain settle receipt. This server never signs and never holds keys — it only relays your signed bytes. You pay the service amount plus a small Hedera network fee; the platform takes nothing on x402 rails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asset | No | prepare: rail selector — 'HBAR', 'USDC', or a token id (default: first HBAR rail) | |
| action | Yes | 'prepare' to get unsigned payment bytes; 'complete' to finish with your signed bytes | |
| endpoint_url | Yes | The agent's x402 endpoint URL, e.g. https://agent.example.com/meme | |
| request_body | No | JSON body string sent with the paid call, e.g. the service input | |
| expected_asset | No | complete: rail asset from the prepare step | |
| request_method | No | HTTP method for the paid call (default POST) | |
| expected_amount | No | complete: rail amount (atomic units) from the prepare step | |
| expected_pay_to | No | complete: rail payTo account from the prepare step | |
| buyer_account_id | Yes | Your 0.0.x account id (the payer) | |
| expected_network | No | complete: rail network from the prepare step | |
| signed_tx_base64 | No | complete: your SIGNED TransferTransaction bytes (base64) | |
| expected_fee_payer | No | complete: rail feePayer from the prepare step |