Pay an exact amount with any token
pay_exactMake sure a recipient gets EXACTLY a set amount (e.g. 10 USDC on Base), paid with whatever token and chain you hold (e.g. SOL on Solana). Ideal for paying invoices, topping up an x402/agent wallet, or funding gas on another chain. Returns the exact amount to send and a deposit address.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"token": "<token>",
"amount_out": "<amount_out>",
"pay_with_token": "<pay_with_token>",
"recipient": "<recipient>",
"refund_address": "<refund_address>"
},
"name": "pay_exact"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| test | No | Test mode: true = no real money. You get a fake deposit address that completes by itself in ~15s, so you can test status, invoices, receipts and webhooks for free. | |
| chain | No | Chain the recipient receives on, e.g. 'base'. | |
| speed | No | Optional. Default 'best_price': Swap Ripper quotes two networks at once and uses whichever is cheaper for you (and the other if one fails); the reply's route_choice shows both. 'fast' forces the ~seconds Relay route. | |
| token | Yes | Token the recipient must receive, e.g. 'USDC'. | |
| referrer | No | Optional: your NEAR account (e.g. 'myagent.near'). You earn 1/3 of the service fee on every swap routed with it. The user pays the same. | |
| recipient | Yes | Address that receives the output, ON THE DESTINATION CHAIN. | |
| amount_out | Yes | Exact amount the recipient must receive, e.g. '10'. | |
| request_id | No | Recommended: your own unique ID for this payment (e.g. a UUID). Retrying with the same request_id returns the SAME payment instructions, so you never pay twice. | |
| slippage_bps | No | Max slippage in basis points (default 100 = 1%, range 10-500). | |
| pay_with_chain | No | Chain you pay from, e.g. 'solana'. | |
| pay_with_token | Yes | Token you will pay with, e.g. 'SOL'. | |
| refund_address | Yes | Address for automatic refunds, ON THE SOURCE CHAIN. Usually the sending wallet. |