{
  "openapi": "3.1.0",
  "info": {
    "title": "AssetFare Quote-only Agent API",
    "version": "2.0.0-quote-only",
    "description": "Read live capabilities and status, then request one non-binding route quote. This restricted import exposes no wallet authentication, session, action preparation, signing, or submission operation.",
    "termsOfService": "https://assetfare.dev/terms/",
    "contact": {"name": "AssetFare support", "url": "https://assetfare.dev/security/", "email": "support@assetfare.dev"},
    "license": {"name": "Proprietary public API terms", "url": "https://assetfare.dev/terms/"}
  },
  "servers": [{"url": "https://api.assetfare.dev"}],
  "security": [],
  "paths": {
    "/v2/capabilities": {
      "get": {
        "operationId": "getMultichainCapabilities",
        "summary": "List the supported quote matrix",
        "responses": {
          "200": {"description": "Current capabilities", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CapabilitiesResponse"}}}},
          "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}
        }
      }
    },
    "/v2/status": {
      "get": {
        "operationId": "getMultichainStatus",
        "summary": "Read provider health and safety boundaries",
        "responses": {
          "200": {"description": "Current route health", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StatusResponse"}}}},
          "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}},
          "503": {"description": "Provider capacity busy", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}
        }
      }
    },
    "/v2/quote": {
      "post": {
        "operationId": "quoteMultichainRoute",
        "summary": "Get one fee-inclusive non-binding route quote",
        "description": "Quote only. Moves no funds and stops before wallet authentication, session creation, action preparation, signing, or submission.",
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteRequest"}}}},
        "responses": {
          "200": {"description": "Fresh route quote", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteResponse"}}}},
          "400": {"description": "Invalid or unsupported route intent", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}},
          "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}},
          "502": {"description": "Route provider temporarily unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}},
          "503": {"description": "Provider capacity busy", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}
        }
      }
    }
  },
  "components": {
    "schemas": {
    "Chain": {"type": "string", "enum": ["solana", "base", "arbitrum", "robinhood"]},
    "Token": {"type": "string", "enum": ["SOL", "ETH", "USDC", "USDG"]},
    "AssetEndpoint": {
      "type": "object",
      "additionalProperties": false,
      "required": ["chain", "token"],
      "properties": {"chain": {"$ref": "#/components/schemas/Chain"}, "token": {"$ref": "#/components/schemas/Token"}},
      "oneOf": [
        {"required": ["chain", "token"], "properties": {"chain": {"const": "solana"}, "token": {"enum": ["SOL", "USDC", "USDG"]}}},
        {"required": ["chain", "token"], "properties": {"chain": {"const": "base"}, "token": {"enum": ["ETH", "USDC"]}}},
        {"required": ["chain", "token"], "properties": {"chain": {"const": "arbitrum"}, "token": {"enum": ["ETH", "USDC"]}}},
        {"required": ["chain", "token"], "properties": {"chain": {"const": "robinhood"}, "token": {"enum": ["ETH", "USDG"]}}}
      ]
    },
    "CapabilitiesResponse": {
      "type": "object",
      "required": ["status", "public_api_enabled", "chains", "asset_endpoints", "directed_conversion_routes", "unsigned_route_plans_ready", "server_signing", "server_submission"],
      "properties": {
        "status": {"type": "string", "const": "capped_public_agent_release"},
        "public_api_enabled": {"type": "boolean", "const": true},
        "chains": {"type": "array", "minItems": 4, "maxItems": 4, "uniqueItems": true, "items": {"$ref": "#/components/schemas/Chain"}},
        "asset_endpoints": {"type": "array", "minItems": 9, "maxItems": 9, "uniqueItems": true, "items": {"$ref": "#/components/schemas/AssetEndpoint"}},
        "directed_conversion_routes": {"type": "integer", "const": 72},
        "unsigned_route_plans_ready": {"type": "integer", "const": 72},
        "server_signing": {"type": "boolean", "const": false},
        "server_submission": {"type": "boolean", "const": false}
      },
      "additionalProperties": true
    },
    "StatusResponse": {
      "type": "object",
      "required": ["status", "server_signing", "server_submission"],
      "properties": {
        "status": {"type": "string", "const": "capped_public_agent_release"},
        "server_signing": {"type": "boolean", "const": false},
        "server_submission": {"type": "boolean", "const": false}
      },
      "additionalProperties": true
    },
    "QuoteRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": ["from_chain", "from_token", "to_chain", "to_token", "amount_usd"],
      "properties": {
        "from_chain": {"type": "string", "enum": ["solana", "base", "arbitrum", "robinhood"], "description": "Source chain. Supported endpoints: solana SOL/USDC/USDG; base ETH/USDC; arbitrum ETH/USDC; robinhood ETH/USDG."},
        "from_token": {"type": "string", "enum": ["SOL", "ETH", "USDC", "USDG"], "description": "Source asset symbol valid on from_chain."},
        "to_chain": {"type": "string", "enum": ["solana", "base", "arbitrum", "robinhood"], "description": "Destination chain. It must form a different supported endpoint from the source."},
        "to_token": {"type": "string", "enum": ["SOL", "ETH", "USDC", "USDG"], "description": "Destination asset symbol valid on to_chain."},
        "amount_usd": {"type": "number", "minimum": 1, "maximum": 1000, "description": "USD notional to quote; no funds move."}
      },
      "allOf": [
        {"if": {"properties": {"from_chain": {"const": "solana"}}}, "then": {"properties": {"from_token": {"enum": ["SOL", "USDC", "USDG"]}}}},
        {"if": {"properties": {"from_chain": {"const": "base"}}}, "then": {"properties": {"from_token": {"enum": ["ETH", "USDC"]}}}},
        {"if": {"properties": {"from_chain": {"const": "arbitrum"}}}, "then": {"properties": {"from_token": {"enum": ["ETH", "USDC"]}}}},
        {"if": {"properties": {"from_chain": {"const": "robinhood"}}}, "then": {"properties": {"from_token": {"enum": ["ETH", "USDG"]}}}},
        {"if": {"properties": {"to_chain": {"const": "solana"}}}, "then": {"properties": {"to_token": {"enum": ["SOL", "USDC", "USDG"]}}}},
        {"if": {"properties": {"to_chain": {"const": "base"}}}, "then": {"properties": {"to_token": {"enum": ["ETH", "USDC"]}}}},
        {"if": {"properties": {"to_chain": {"const": "arbitrum"}}}, "then": {"properties": {"to_token": {"enum": ["ETH", "USDC"]}}}},
        {"if": {"properties": {"to_chain": {"const": "robinhood"}}}, "then": {"properties": {"to_token": {"enum": ["ETH", "USDG"]}}}},
        {"not": {"anyOf": [
          {"properties": {"from_chain": {"const": "solana"}, "from_token": {"const": "SOL"}, "to_chain": {"const": "solana"}, "to_token": {"const": "SOL"}}},
          {"properties": {"from_chain": {"const": "solana"}, "from_token": {"const": "USDC"}, "to_chain": {"const": "solana"}, "to_token": {"const": "USDC"}}},
          {"properties": {"from_chain": {"const": "solana"}, "from_token": {"const": "USDG"}, "to_chain": {"const": "solana"}, "to_token": {"const": "USDG"}}},
          {"properties": {"from_chain": {"const": "base"}, "from_token": {"const": "ETH"}, "to_chain": {"const": "base"}, "to_token": {"const": "ETH"}}},
          {"properties": {"from_chain": {"const": "base"}, "from_token": {"const": "USDC"}, "to_chain": {"const": "base"}, "to_token": {"const": "USDC"}}},
          {"properties": {"from_chain": {"const": "arbitrum"}, "from_token": {"const": "ETH"}, "to_chain": {"const": "arbitrum"}, "to_token": {"const": "ETH"}}},
          {"properties": {"from_chain": {"const": "arbitrum"}, "from_token": {"const": "USDC"}, "to_chain": {"const": "arbitrum"}, "to_token": {"const": "USDC"}}},
          {"properties": {"from_chain": {"const": "robinhood"}, "from_token": {"const": "ETH"}, "to_chain": {"const": "robinhood"}, "to_token": {"const": "ETH"}}},
          {"properties": {"from_chain": {"const": "robinhood"}, "from_token": {"const": "USDG"}, "to_chain": {"const": "robinhood"}, "to_token": {"const": "USDG"}}}
        ]}}
      ]
    },
    "QuoteResponse": {
      "type": "object",
      "required": ["quote_id", "status", "as_of", "ttl_seconds", "intent", "offer", "route", "risk", "execution"],
      "properties": {
        "quote_id": {"type": "string", "format": "uuid"},
        "status": {"type": "string", "const": "capped_public_agent_release"},
        "as_of": {"type": "string", "format": "date-time"},
        "ttl_seconds": {"type": "integer", "minimum": 1},
        "intent": {
          "type": "object", "additionalProperties": false,
          "required": ["from", "to", "amount_usd", "estimated_input_base"],
          "properties": {
            "from": {"type": "string"}, "to": {"type": "string"},
            "amount_usd": {"type": "number", "minimum": 1, "maximum": 1000},
            "estimated_input_base": {"type": "integer", "minimum": 1}
          }
        },
        "offer": {
          "type": "object",
          "required": ["expected_receive_amount", "estimated_min_receive_amount", "output_symbol", "expected_receive_usd", "estimated_min_receive_usd", "assetfare_fee_bps", "fee_collection_steps"],
          "properties": {
            "expected_receive_amount": {"type": "number", "exclusiveMinimum": 0},
            "estimated_min_receive_amount": {"type": "number", "exclusiveMinimum": 0},
            "output_symbol": {"$ref": "#/components/schemas/Token"},
            "expected_receive_usd": {"type": "number", "exclusiveMinimum": 0},
            "estimated_min_receive_usd": {"type": "number", "exclusiveMinimum": 0},
            "assetfare_fee_bps": {"type": "integer", "minimum": 0},
            "fee_collection_steps": {"type": "array", "items": {"type": "integer", "minimum": 0}},
            "estimated_time_seconds": {"type": ["integer", "null"], "minimum": 0}
          },
          "additionalProperties": true
        },
        "route": {
          "type": "object",
          "required": ["route", "steps", "quote_latency_ms", "server_signing", "server_submission"],
          "properties": {
            "route": {"type": "string", "minLength": 1},
            "steps": {"type": "array", "minItems": 1, "items": {"type": "object"}},
            "quote_latency_ms": {"type": "integer", "minimum": 0},
            "server_signing": {"type": "boolean", "const": false},
            "server_submission": {"type": "boolean", "const": false}
          },
          "additionalProperties": true
        },
        "risk": {
          "type": "object",
          "required": ["non_atomic", "fresh_quote_required_each_step", "server_signing", "server_submission"],
          "properties": {
            "non_atomic": {"type": "boolean"},
            "fresh_quote_required_each_step": {"type": "boolean", "const": true},
            "server_signing": {"type": "boolean", "const": false},
            "server_submission": {"type": "boolean", "const": false}
          },
          "additionalProperties": true
        },
        "execution": {
          "type": "object",
          "required": ["supported", "first_unsigned_action_supported", "future_actions_require_verified_receipts"],
          "properties": {
            "supported": {"type": "boolean", "const": true},
            "first_unsigned_action_supported": {"type": "boolean"},
            "future_actions_require_verified_receipts": {"type": "boolean", "const": true}
          },
          "additionalProperties": true
        }
      },
      "additionalProperties": true
    },
    "ErrorResponse": {
      "type": "object",
      "required": ["error"],
      "properties": {
        "error": {"type": "string", "minLength": 1},
        "retry_after_seconds": {"type": "integer", "minimum": 0, "maximum": 3600},
        "reason_class": {"type": "string", "minLength": 1}
      },
      "additionalProperties": true
    }
    }
  },
  "x-assetfare-safety": {
    "quote_only_import": true,
    "public": true,
    "api_key_required": false,
    "wallet_required": false,
    "server_signing": false,
    "server_submission": false,
    "next_action": "Compare with another fresh executable route and stop unless the caller separately approves continuation."
  }
}
