{
  "openapi": "3.1.0",
  "info": {
    "title": "Refinery Intelligence API",
    "version": "1.3.0",
    "summary": "Machine-readable temporal intelligence bundles for autonomous agents.",
    "description": "Refinery Intelligence is an agent-native temporal intelligence API for autonomous agents, bots, risk systems, and machine customers. It exposes machine-readable discovery metadata, package registry endpoints, redacted public bundle previews, and Polygon USDC payment-gated private payload retrieval.",
    "contact": {
      "name": "Refinery Intelligence",
      "url": "https://dalien.net/refinery-crawler-manifest.html"
    },
    "license": {
      "name": "Proprietary paid payloads; public discovery metadata available for crawling"
    }
  },
  "externalDocs": {
    "description": "Refinery crawler manifest and agent discovery entry point",
    "url": "https://dalien.net/refinery-crawler-manifest.html"
  },
  "servers": [
    {
      "url": "https://api.dalien.net",
      "description": "Primary Refinery API endpoint"
    }
  ],
  "tags": [
    {
      "name": "Discovery",
      "description": "Machine-readable discovery endpoints."
    },
    {
      "name": "Packages",
      "description": "Package registry and bundle metadata."
    },
    {
      "name": "Public Previews",
      "description": "Redacted public previews for paid intelligence bundles."
    },
    {
      "name": "Payments",
      "description": "Polygon USDC payment request, verification, access check, and paid payload retrieval."
    }
  ],
  "paths": {
    "/meta": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "summary": "Get Refinery platform metadata",
        "description": "Machine-readable platform metadata for autonomous agents and crawlers.",
        "responses": {
          "200": {
            "description": "Get Refinery platform metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "summary": "Get platform health state",
        "description": "Operational health state for the Refinery API.",
        "responses": {
          "200": {
            "description": "Get platform health state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/packages": {
      "get": {
        "tags": [
          "Packages"
        ],
        "summary": "Get package registry",
        "description": "Machine-readable package registry.",
        "responses": {
          "200": {
            "description": "Get package registry",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/packages.json": {
      "get": {
        "tags": [
          "Packages"
        ],
        "summary": "Get package registry JSON",
        "description": "Preferred direct machine-readable package registry endpoint.",
        "responses": {
          "200": {
            "description": "Get package registry JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/public/refinery.json": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "summary": "Get platform manifest",
        "description": "Public machine-readable Refinery platform manifest.",
        "responses": {
          "200": {
            "description": "Get platform manifest",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/public/agent_manifest.json": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "summary": "Get agent manifest",
        "description": "Public Refinery agent manifest for autonomous agent discovery.",
        "responses": {
          "200": {
            "description": "Get agent manifest",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/public/llms.txt": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "summary": "Get LLM index",
        "description": "LLM-facing discovery instructions and index.",
        "responses": {
          "200": {
            "description": "Get LLM index",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/public/defi-liquidation-intel-v1.json": {
      "get": {
        "tags": [
          "Public Previews"
        ],
        "summary": "Get DeFi Liquidation Intelligence public preview",
        "description": "Returns a redacted public preview. Full temporal intelligence payload requires verified Polygon USDC payment access.",
        "responses": {
          "200": {
            "description": "Get DeFi Liquidation Intelligence public preview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/public/defi-flow-intel-v1.json": {
      "get": {
        "tags": [
          "Public Previews"
        ],
        "summary": "Get DeFi Flow Intelligence public preview",
        "description": "Returns a redacted public preview. Full temporal intelligence payload requires verified Polygon USDC payment access.",
        "responses": {
          "200": {
            "description": "Get DeFi Flow Intelligence public preview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/public/solana-temporal-intel-v1.json": {
      "get": {
        "tags": [
          "Public Previews"
        ],
        "summary": "Get Solana Temporal Intelligence public preview",
        "description": "Returns a redacted public preview. Full temporal intelligence payload requires verified Polygon USDC payment access.",
        "responses": {
          "200": {
            "description": "Get Solana Temporal Intelligence public preview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/public/xrp-etf-temporal-intel-v1.json": {
      "get": {
        "tags": [
          "Public Previews"
        ],
        "summary": "Get XRP ETF Temporal Intelligence public preview",
        "description": "Returns a redacted public preview. Full temporal intelligence payload requires verified Polygon USDC payment access.",
        "responses": {
          "200": {
            "description": "Get XRP ETF Temporal Intelligence public preview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/public/xrpl-settlement-intel-v1.json": {
      "get": {
        "tags": [
          "Public Previews"
        ],
        "summary": "Get XRPL Settlement Intelligence public preview",
        "description": "Returns a redacted public preview. Full temporal intelligence payload requires verified Polygon USDC payment access.",
        "responses": {
          "200": {
            "description": "Get XRPL Settlement Intelligence public preview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/public/flare-temporal-intel-v1.json": {
      "get": {
        "tags": [
          "Public Previews"
        ],
        "summary": "Get Flare Temporal Intelligence public preview",
        "description": "Returns a redacted public preview. Full temporal intelligence payload requires verified Polygon USDC payment access.",
        "responses": {
          "200": {
            "description": "Get Flare Temporal Intelligence public preview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/payments/usdc/request": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Request Polygon USDC payment instructions",
        "description": "Creates a pending payment request for a selected bundle and returns payment instructions.",
        "parameters": [
          {
            "name": "bundle_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "xrp-etf-temporal-intel-v1"
          }
        ],
        "responses": {
          "200": {
            "description": "Request Polygon USDC payment instructions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/payments/usdc/verify": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Verify a Polygon USDC transaction hash",
        "description": "Verifies a submitted transaction hash against a pending request. If valid, Refinery grants paid bundle access.",
        "parameters": [
          {
            "name": "request_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "request_id_here"
          },
          {
            "name": "tx_hash",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "polygon_transaction_hash_here"
          }
        ],
        "responses": {
          "200": {
            "description": "Verify a Polygon USDC transaction hash",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/payments/usdc/access": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Check paid access grant",
        "description": "Checks whether a payment request has an active paid access grant.",
        "parameters": [
          {
            "name": "request_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "request_id_here"
          }
        ],
        "responses": {
          "200": {
            "description": "Check paid access grant",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/payments/usdc/bundle": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Retrieve paid bundle payload",
        "description": "Returns the private paid bundle payload after verified Polygon USDC payment access. Requests without active access are denied.",
        "parameters": [
          {
            "name": "request_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "request_id_here"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve paid bundle payload",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    }
  }
}
