{
  "openapi": "3.1.0",
  "info": {
    "title": "Swap Ripper: cross-chain swaps for AI agents",
    "version": "1.4.1",
    "description": "Swap any token across 25+ blockchains (Bitcoin, Ethereum, Solana, Base, Arbitrum, BNB, Tron, NEAR, Zcash, TON, Sui, XRP, Doge and more) in one call. Non-custodial, no API key, no wallet connection: get a quote, receive a one-time deposit address, send funds, done. Powered by NEAR Intents solver network. Automatic refund if a swap can't complete."
  },
  "servers": [
    {
      "url": "https://swap-ripper.szydlow45.workers.dev"
    }
  ],
  "paths": {
    "/api/quote": {
      "get": {
        "operationId": "getQuote",
        "summary": "Live cross-chain quote with fair-price check (no commitment)",
        "parameters": [
          {
            "name": "from_token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token to send: symbol ('USDC', 'ETH', 'BTC'), 'SYMBOL@chain', 'SYMBOL on chain', or an asset_id from search_tokens."
          },
          {
            "name": "from_chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Chain the token is sent from, e.g. 'solana', 'base', 'ethereum', 'bitcoin'. Needed when the symbol exists on several chains."
          },
          {
            "name": "to_token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token to receive (same formats as from_token)."
          },
          {
            "name": "to_chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Chain to receive on."
          },
          {
            "name": "amount",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Amount of from_token to send, as a human-readable decimal string, e.g. '25' or '0.015'. Not base units."
          },
          {
            "name": "slippage_bps",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Max slippage in basis points (default 100 = 1%, range 10-500)."
          },
          {
            "name": "referrer",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "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."
          }
        ],
        "responses": {
          "200": {
            "description": "Quote"
          }
        }
      }
    },
    "/api/swap": {
      "post": {
        "operationId": "createSwap",
        "summary": "Create swap, get deposit address",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "from_token",
                  "to_token",
                  "amount",
                  "recipient",
                  "refund_address"
                ],
                "properties": {
                  "from_token": {
                    "type": "string",
                    "description": "Token to send: symbol ('USDC', 'ETH', 'BTC'), 'SYMBOL@chain', 'SYMBOL on chain', or an asset_id from search_tokens."
                  },
                  "from_chain": {
                    "type": "string",
                    "description": "Chain the token is sent from, e.g. 'solana', 'base', 'ethereum', 'bitcoin'. Needed when the symbol exists on several chains."
                  },
                  "to_token": {
                    "type": "string",
                    "description": "Token to receive (same formats as from_token)."
                  },
                  "to_chain": {
                    "type": "string",
                    "description": "Chain to receive on."
                  },
                  "amount": {
                    "type": "string",
                    "description": "Amount of from_token to send, as a human-readable decimal string, e.g. '25' or '0.015'. Not base units."
                  },
                  "slippage_bps": {
                    "type": "integer",
                    "description": "Max slippage in basis points (default 100 = 1%, range 10-500)."
                  },
                  "referrer": {
                    "type": "string",
                    "description": "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": {
                    "type": "string",
                    "description": "Address that receives the output, ON THE DESTINATION CHAIN."
                  },
                  "refund_address": {
                    "type": "string",
                    "description": "Address for automatic refunds, ON THE SOURCE CHAIN. Usually the sending wallet."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Fixable input error with explanation"
          }
        }
      }
    },
    "/api/pay": {
      "post": {
        "operationId": "payExact",
        "summary": "Recipient gets an exact amount, paid with any token",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token",
                  "amount_out",
                  "pay_with_token",
                  "recipient",
                  "refund_address"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Token the recipient must receive, e.g. 'USDC'."
                  },
                  "chain": {
                    "type": "string",
                    "description": "Chain the recipient receives on, e.g. 'base'."
                  },
                  "amount_out": {
                    "type": "string",
                    "description": "Exact amount the recipient must receive, e.g. '10'."
                  },
                  "pay_with_token": {
                    "type": "string",
                    "description": "Token you will pay with, e.g. 'SOL'."
                  },
                  "pay_with_chain": {
                    "type": "string",
                    "description": "Chain you pay from, e.g. 'solana'."
                  },
                  "slippage_bps": {
                    "type": "integer",
                    "description": "Max slippage in basis points (default 100 = 1%, range 10-500)."
                  },
                  "recipient": {
                    "type": "string",
                    "description": "Address that receives the output, ON THE DESTINATION CHAIN."
                  },
                  "refund_address": {
                    "type": "string",
                    "description": "Address for automatic refunds, ON THE SOURCE CHAIN. Usually the sending wallet."
                  },
                  "referrer": {
                    "type": "string",
                    "description": "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."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Fixable input error with explanation"
          }
        }
      }
    },
    "/api/compare": {
      "post": {
        "operationId": "compareQuotes",
        "summary": "Compare up to 10 routes",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "routes"
                ],
                "properties": {
                  "routes": {
                    "type": "array",
                    "maxItems": 10,
                    "description": "List of {from_token, from_chain, to_token, to_chain, amount}.",
                    "items": {
                      "type": "object",
                      "required": [
                        "from_token",
                        "to_token",
                        "amount"
                      ],
                      "properties": {
                        "from_token": {
                          "type": "string",
                          "description": "Token to send: symbol ('USDC', 'ETH', 'BTC'), 'SYMBOL@chain', 'SYMBOL on chain', or an asset_id from search_tokens."
                        },
                        "from_chain": {
                          "type": "string",
                          "description": "Chain the token is sent from, e.g. 'solana', 'base', 'ethereum', 'bitcoin'. Needed when the symbol exists on several chains."
                        },
                        "to_token": {
                          "type": "string",
                          "description": "Token to receive (same formats as from_token)."
                        },
                        "to_chain": {
                          "type": "string",
                          "description": "Chain to receive on."
                        },
                        "amount": {
                          "type": "string",
                          "description": "Amount of from_token to send, as a human-readable decimal string, e.g. '25' or '0.015'. Not base units."
                        }
                      }
                    }
                  },
                  "referrer": {
                    "type": "string",
                    "description": "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."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Fixable input error with explanation"
          }
        }
      }
    },
    "/api/status": {
      "get": {
        "operationId": "getSwapStatus",
        "summary": "Swap status (optional long-poll)",
        "parameters": [
          {
            "name": "deposit_address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deposit_memo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "wait_seconds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "0-25 server-side wait"
          }
        ],
        "responses": {
          "200": {
            "description": "Status"
          }
        }
      }
    },
    "/api/prices": {
      "get": {
        "operationId": "getPrices",
        "summary": "Free multi-chain token prices",
        "parameters": [
          {
            "name": "symbols",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated, e.g. BTC,ETH,SOL"
          },
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Prices"
          }
        }
      }
    },
    "/api/tokens": {
      "get": {
        "operationId": "searchTokens",
        "summary": "Search supported tokens",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tokens"
          }
        }
      }
    },
    "/api/text": {
      "get": {
        "operationId": "quoteFromText",
        "summary": "Quote from plain English",
        "parameters": [
          {
            "name": "request",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "e.g. '25 USDC on solana to ETH on base'"
          },
          {
            "name": "referrer",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Quote"
          }
        }
      }
    },
    "/api/referrals": {
      "get": {
        "operationId": "referralStats",
        "summary": "Referral earnings",
        "parameters": [
          {
            "name": "referrer",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your NEAR account"
          }
        ],
        "responses": {
          "200": {
            "description": "Stats"
          }
        }
      }
    },
    "/api/chains": {
      "get": {
        "operationId": "listChains",
        "summary": "List supported chains",
        "responses": {
          "200": {
            "description": "Chains"
          }
        }
      }
    }
  }
}