Swap tokens across chains
create_swapLock a quote and get a one-time deposit address. Send exactly send_exactly of the source token there and the output lands at recipient automatically, usually in under a minute. Non-custodial, no API key, no wallet connection, automatic refund on failure. For EVM sources, deposit_tx is a ready-to-sign transaction.
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": {
"from_token": "<from_token>",
"to_token": "<to_token>",
"amount": "<amount>",
"recipient": "<recipient>",
"refund_address": "<refund_address>"
},
"name": "create_swap"
}
}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. | |
| 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. | |
| amount | Yes | Amount of from_token to send, as a human-readable decimal string, e.g. '25' or '0.015'. Not base units. | |
| 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. | |
| to_chain | No | Chain to receive on. | |
| to_token | Yes | Token to receive (same formats as from_token). | |
| recipient | Yes | Address that receives the output, ON THE DESTINATION CHAIN. | |
| from_chain | No | Chain the token is sent from, e.g. 'solana', 'base', 'ethereum', 'bitcoin'. Needed when the symbol exists on several chains. | |
| from_token | Yes | Token to send: symbol ('USDC', 'ETH', 'BTC'), 'SYMBOL@chain', 'SYMBOL on chain', or an asset_id from search_tokens. | |
| 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). | |
| refund_address | Yes | Address for automatic refunds, ON THE SOURCE CHAIN. Usually the sending wallet. |