# x402-gateway Swap Create

> x402-gateway Swap Create is a paid API for AI agents from x402.freeq.one, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-31).

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.

## Facts

- Endpoint: POST https://x402.freeq.one/tools/swap_create?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-gateway-swap-create-0ea0b17d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_URD_abw3gy-KH4q2DPiMS

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-gateway-swap-create-0ea0b17d -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-gateway-swap-create-0ea0b17d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.freeq.one](https://www.zero.xyz/host/x402.freeq.one/llms.txt)
