{"uid":"cap_URD_abw3gy-KH4q2DPiMS","slug":"x402-gateway-swap-create-0ea0b17d","name":"x402-gateway Swap Create","description":"Swap Create: Create a non-custodial swap order and get the deposit address: send exactly the expected amount there and the payout goes to your address. No funds move in this call. Pay per call in USDC on Base via x402 — POST https://x402.freeq.one/tools/swap_create.","url":"https://x402.freeq.one/tools/swap_create?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"fixed":{"type":"boolean","example":false,"description":"Fixed (locked-rate) order; requires rate_id from swap_estimate (default false = floating)"},"amount":{"type":"string","example":"0.01","description":"Amount of the source currency to swap (positive decimal)"},"rate_id":{"type":"string","example":"rate1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c","description":"Locked-rate id from a fixed swap_estimate; required when fixed is true"},"address_to":{"type":"string","example":"0x0000000000000000000000000000000000000000","description":"Destination wallet address; validated against the destination currency's own address format before any order is created"},"currency_to":{"type":"string","example":"eth:eth","description":"Destination currency as ticker:network (e.g. eth:eth)"},"currency_from":{"type":"string","example":"btc:btc","description":"Source currency as ticker:network (e.g. btc:btc)"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_n2ZxC3T34ZKsakV_uW4Sh","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Creates a non-custodial crypto swap order and returns a deposit address to send the source currency to, triggering a payout to the specified destination address.","exampleAgentPrompt":"Create a non-custodial swap to exchange 0.01 BTC (btc:btc) for ETH, with the payout going to my Ethereum address 0xAbCd1234567890abcdef1234567890abcdef1234 — use a floating rate.","exampleUseCases":[{"title":"Swap BTC to ETH for a wallet","prompt":"I want to swap 0.05 BTC for ETH and have it sent to my Ethereum wallet 0x1234567890abcdef1234567890abcdef12345678 — floating rate is fine, just give me the deposit address."},{"title":"Fixed-rate cross-chain conversion","prompt":"I got a locked rate quote earlier with rate ID rate1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c — create a fixed-rate swap order to exchange 0.5 ETH on Ethereum for BTC, sending the payout to my Bitcoin address bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh."},{"title":"Agent-driven portfolio rebalancing","prompt":"As part of rebalancing, swap 100 USDC on Ethereum (usdc:eth) into SOL and send the SOL to my Solana wallet address 4Nd1mBQtrMJVYVfKf2PX98ej5RjMFCXHVBcPJpWJtdV — use a floating rate."}],"resultDescription":"Returns the swap order details including a deposit address to send the exact source amount to, plus the expected payout amount and order ID. No funds are moved by the API call itself — the swap is triggered only when the user sends the correct amount to the deposit address.","failureModes":["Invalid currency ticker:network format — returns validation error","Destination wallet address fails format validation for the destination currency — returns 400 error","rate_id missing or expired when fixed=true — returns error requiring a fresh estimate","Amount is zero, negative, or non-numeric — returns validation error","Unsupported currency pair — returns error indicating pair is unavailable","x402 payment not included or insufficient — returns HTTP 402 with payment details"],"whenToPreferThis":"Use this endpoint when an AI agent needs to programmatically initiate a non-custodial crypto swap between two currencies without requiring user accounts, KYC, or API keys. Prefer this over custodial exchanges when privacy and self-custody matter, or when orchestrating swaps inside an automated workflow. If a locked rate is needed, first call swap_estimate to get a rate_id, then set fixed=true here.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:30:24.929Z","isFirstParty":false,"canonicalSlug":"x402-gateway-swap-create-0ea0b17d"}