HekaSwap
x402 agent swaps

HekaSwap for agents

Agents can quote routes for free, pay a $0.01 x402 access fee, create a swap order, or generate an XMR payment request without opening the browser UI.

Status Loading
Order fee $0.01
Network Base
Live routes Loading
What it is for

This is for wallets, scripts, trading bots, AI agents, commerce flows, and app backends that need a clean way to request XMR swap instructions. Heka does not ask for private keys and does not receive the swap principal. The agent pays the small API fee for direct order creation, then sends swap funds directly to the provider deposit address returned by the order.

Direct swap

Agent creates the order

Use the Agent API when software already knows the destination wallet and wants deposit instructions directly.

POST /api/agent/v1/quotes
POST /api/agent/v1/orders
XMR Pay

Agent creates a payment link

Create an XMR request for a merchant, share the hosted checkout, or keep going through the API.

POST /api/payments/v1/merchant/requests
GET /pay/{requestId}
MCP

Drop it into agent tools

Run the local MCP server and expose Heka tools to Claude Desktop, Cursor, custom agents, or bot runtimes.

npm run mcp:heka
Discovery

Machine-readable by default

OpenAPI, x402 discovery, manifest, and llms.txt are public so scanners and agents can index the service.

GET /openapi.json
GET /.well-known/x402
GET /llms.txt
1. Discover

Read the live manifest

Pull route caps, x402 payment metadata, and endpoint URLs from the public manifest.

GET https://www.hekaswap.com/api/agent/v1/routes
GET https://www.hekaswap.com/.well-known/x402
2. Quote

Quotes are free

Use preview quotes before the final receive wallet is known, then create an order once the payout wallet is ready.

Loading quote example...
3. Pay

x402 gates order creation

Order creation requires an Idempotency-Key and a valid x402 payment header. Never send a private key to HekaSwap.

POST /api/agent/v1/orders
Idempotency-Key: agent-job-001
PAYMENT-SIGNATURE: generated-by-your-x402-client
4. Track

Poll the order

Send swap funds only after an order response returns depositInstructions and the asset/network match what the agent expects.

GET /api/agent/v1/orders/{orderId}
Live pilot config

Routes and caps

Loading the live agent surface...

Implementation

Minimal client flow

Your agent handles the x402 payment locally, calls Heka, and stores the returned order id. The swap itself still settles through the selected provider.

Loading JavaScript example...
XMR Pay request

Hosted checkout from an agent

Create a merchant-owned XMR request, receive a checkout link, and let the payer choose ETH, Base USDC, SOL, BTC, or another accepted route.

Loading payment request example...
MCP setup

Give tools to the agent

Configure the MCP server with a merchant key when you want the agent to own request history and webhook-backed checkouts.

Loading MCP example...
curl quickstart

Free quote example

Use this to verify route discovery and quote creation before wiring x402 order payment.

Loading curl example...
Safety rules

Use a unique Idempotency-Key for every order attempt. Provide a refundAddress for the source chain whenever possible. Re-check deposit asset, deposit network, minimums, provider, and expiry before sending funds. x402 pays for API access only; it is not the swap amount. Keep merchant API keys server-side only.