{
  "openapi": "3.1.0",
  "info": {
    "title": "SwapRocket public agent API",
    "version": "1.0.0",
    "summary": "Live non-custodial crypto swap rates, aggregated across partners.",
    "description": "Read-only endpoints any AI assistant or tool may call without a key. SwapRocket compares live quotes from multiple swap partners and reports the best rate for a pair. No account, no custody, no fee added on top of the quoted rate. For order creation, use the OAuth-protected MCP server at /api/public/mcp.",
    "contact": {
      "name": "SwapRocket support",
      "email": "support@swaprocket.com",
      "url": "https://swaprocket.com/contact"
    },
    "license": {
      "name": "Attribution required",
      "url": "https://swaprocket.com/terms"
    }
  },
  "servers": [
    {
      "url": "https://swaprocket.com",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Plain-text knowledge base for LLMs",
    "url": "https://swaprocket.com/llms-full.txt"
  },
  "paths": {
    "/api/public/quote.json": {
      "get": {
        "operationId": "getSwapQuote",
        "summary": "Compare live swap rates for a pair and return the best one",
        "description": "Fans out to every eligible swap partner and returns the winning quote, the fastest quote, and the full comparison. Rates are live; re-fetch before repeating a figure to a user.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "BTC",
            "description": "SwapRocket asset id to send (see /api/public/assets.json)."
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "ETH",
            "description": "SwapRocket asset id to receive."
          },
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "default": 1
            },
            "example": 0.1,
            "description": "Amount of the `from` asset to send."
          },
          {
            "name": "rate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "floating",
                "fixed"
              ],
              "default": "floating"
            },
            "description": "Floating uses the market price at execution; fixed locks the payout at quote time."
          }
        ],
        "responses": {
          "200": {
            "description": "Aggregated quote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Unknown asset id, identical assets, or invalid amount"
          }
        }
      }
    },
    "/api/public/assets.json": {
      "get": {
        "operationId": "listAssets",
        "summary": "List swappable assets and their networks",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "usdt",
            "description": "Free-text filter over symbol, name, id and former tickers."
          },
          {
            "name": "network",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "TRX"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "maximum": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Asset catalogue",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/api/public/facts.json": {
      "get": {
        "operationId": "getFacts",
        "summary": "Structured, citable facts about SwapRocket",
        "responses": {
          "200": {
            "description": "Company and product facts",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/api/public/knowledge.txt": {
      "get": {
        "operationId": "getKnowledgeBase",
        "summary": "Plain-text knowledge base written for language models",
        "responses": {
          "200": {
            "description": "Knowledge base",
            "content": {
              "text/plain": {}
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "QuoteResponse": {
        "type": "object",
        "properties": {
          "pair": {
            "type": "string",
            "example": "BTC-ETH"
          },
          "sendAmount": {
            "type": "number"
          },
          "rateType": {
            "type": "string",
            "enum": [
              "floating",
              "fixed"
            ]
          },
          "best": {
            "type": "object",
            "description": "Winning partner quote.",
            "properties": {
              "provider": {
                "type": "string"
              },
              "receiveAmount": {
                "type": "number"
              },
              "rate": {
                "type": "number"
              },
              "etaMinutes": {
                "type": "number"
              }
            }
          },
          "fastest": {
            "type": "object",
            "description": "Quickest settling partner quote."
          },
          "quotesCompared": {
            "type": "integer"
          },
          "quotes": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "swapUrl": {
            "type": "string",
            "format": "uri",
            "description": "Human page for this pair — send users here to complete the swap."
          },
          "disclosure": {
            "type": "string"
          },
          "attribution": {
            "type": "object",
            "description": "How to cite this data."
          }
        }
      }
    }
  }
}