{
  "openapi": "3.1.0",
  "info": {
    "title": "Finautor Signals API",
    "version": "1.0.0",
    "summary": "Daily market-regime signals — the published, firewall-safe readings.",
    "description": "Finautor Signals publishes quantitatively computed market-regime readings: the Composite Market Regime Score (broad U.S. equities) and the Credit Stress Regime (broad credit markets). Every endpoint is pull-only, takes no input parameters, and returns ONLY the published reading — score, regime label, 20-day direction sign, as-of date, staleness. The methodology that produces the score is proprietary and is never returned by any endpoint or tool. Current-score endpoints are free and need no authentication. History endpoints serve 30 days anonymously and up to 5 years with a subscribed `fsk_` API key (Authorization: Bearer fsk_…), minted at https://finautor.com/app/settings → Connect your agent. The same readings are available as an MCP server at https://finautor.com/api/signals/mcp (Streamable HTTP, Bearer fsk_ key — see https://finautor.com/.well-known/mcp.json). Human documentation: https://finautor.com/developers. Informational and educational only — not investment advice, not a recommendation or solicitation.",
    "contact": {
      "name": "Finautor",
      "email": "hello@finautor.com",
      "url": "https://finautor.com/developers"
    },
    "termsOfService": "https://finautor.com/terms"
  },
  "servers": [{ "url": "https://finautor.com" }],
  "paths": {
    "/api/signals/v1/regime": {
      "get": {
        "operationId": "getCurrentRegime",
        "summary": "Current Composite Market Regime Score (free, no auth)",
        "description": "The latest published reading for the flagship signal. Cached for ~2 minutes; the reading changes at most once per weekday.",
        "tags": ["signals"],
        "security": [],
        "responses": {
          "200": {
            "description": "The current reading.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RegimeReading" }
              }
            }
          },
          "503": {
            "description": "Reading temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RegimeUnavailable" }
              }
            }
          }
        }
      }
    },
    "/api/signals/v1/history": {
      "get": {
        "operationId": "getRegimeHistory",
        "summary": "Composite Market Regime Score history (30 days free; 5 years subscribed)",
        "description": "The published score/regime series, oldest→newest. Depth is SERVER-derived from the caller's entitlement — 30 days anonymously, up to 5 years with a subscription covering the signal. There are no input parameters.",
        "tags": ["signals"],
        "security": [{}, { "fskApiKey": [] }],
        "responses": {
          "200": {
            "description": "The published series at the caller's entitled depth.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RegimeHistory" }
              }
            }
          },
          "429": { "description": "Rate limit exceeded." },
          "503": {
            "description": "Series temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RegimeUnavailable" }
              }
            }
          }
        }
      }
    },
    "/api/signals/v1/credit/regime": {
      "get": {
        "operationId": "getCurrentCreditRegime",
        "summary": "Current Credit Stress Regime (free, no auth)",
        "description": "The latest published reading for the Credit Stress Regime — a 0–100 score with a credit-conditions label (Tight / Normal / Widening / Stress).",
        "tags": ["signals"],
        "security": [],
        "responses": {
          "200": {
            "description": "The current reading.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RegimeReading" }
              }
            }
          },
          "503": {
            "description": "Reading temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RegimeUnavailable" }
              }
            }
          }
        }
      }
    },
    "/api/signals/v1/credit/history": {
      "get": {
        "operationId": "getCreditRegimeHistory",
        "summary": "Credit Stress Regime history (30 days free; 5 years subscribed)",
        "description": "The published credit-stress score/regime series, oldest→newest. Depth is SERVER-derived from the caller's entitlement — 30 days anonymously, up to 5 years with a subscription covering the signal. There are no input parameters.",
        "tags": ["signals"],
        "security": [{}, { "fskApiKey": [] }],
        "responses": {
          "200": {
            "description": "The published series at the caller's entitled depth.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RegimeHistory" }
              }
            }
          },
          "429": { "description": "Rate limit exceeded." },
          "503": {
            "description": "Series temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RegimeUnavailable" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "fskApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "fsk_ API key",
        "description": "Optional on history endpoints (anonymous callers get the free 30-day depth; a subscribed key unlocks up to 5 years). Required for the MCP server. Mint a key at https://finautor.com/app/settings → Connect your agent; it is shown once, at creation."
      }
    },
    "schemas": {
      "RegimeReading": {
        "type": "object",
        "description": "The published reading — the only thing any endpoint returns.",
        "required": [
          "available",
          "score",
          "regime",
          "asOfDate",
          "stale",
          "direction",
          "disclaimer",
          "copyright",
          "_sig"
        ],
        "properties": {
          "available": { "const": true },
          "score": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "The published composite score, rounded to 1 decimal place."
          },
          "regime": {
            "type": "string",
            "description": "The regime label — equities: Risk-On / Mild Risk-On / Mild Risk-Off / Risk-Off; credit: Tight / Normal / Widening / Stress."
          },
          "asOfDate": {
            "type": "string",
            "format": "date",
            "description": "Trading day of the reading (YYYY-MM-DD)."
          },
          "stale": {
            "type": "boolean",
            "description": "True when the reading is older than 3 weekdays."
          },
          "direction": {
            "enum": ["up", "down", "flat"],
            "description": "Sign of the 20-day move — never the magnitude."
          },
          "disclaimer": { "type": "string" },
          "copyright": { "type": "string" },
          "_sig": {
            "type": "string",
            "description": "Integrity watermark over the served payload."
          }
        },
        "additionalProperties": false
      },
      "RegimeHistoryPoint": {
        "type": "object",
        "required": [
          "asOfDate",
          "score",
          "regime",
          "direction",
          "stale",
          "reconstructed"
        ],
        "properties": {
          "asOfDate": { "type": "string", "format": "date" },
          "score": { "type": "number", "minimum": 0, "maximum": 100 },
          "regime": { "type": "string" },
          "direction": { "enum": ["up", "down", "flat"] },
          "stale": { "type": "boolean" },
          "reconstructed": {
            "type": "boolean",
            "description": "True for dates before the signal went live — reconstructed point-in-time, not a live recording. Not a live track record and not a performance claim."
          }
        },
        "additionalProperties": false
      },
      "RegimeHistory": {
        "type": "object",
        "required": [
          "available",
          "points",
          "count",
          "maxDays",
          "disclaimer",
          "copyright",
          "_sig"
        ],
        "properties": {
          "available": { "type": "boolean" },
          "points": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/RegimeHistoryPoint" },
            "description": "Oldest→newest."
          },
          "count": { "type": "integer" },
          "maxDays": {
            "type": "integer",
            "description": "The server-derived depth cap that produced this series (30 free; 1825 = 5 years, subscribed)."
          },
          "disclaimer": { "type": "string" },
          "copyright": { "type": "string" },
          "_sig": { "type": "string" }
        },
        "additionalProperties": false
      },
      "RegimeUnavailable": {
        "type": "object",
        "required": ["available", "error", "disclaimer", "copyright"],
        "properties": {
          "available": { "const": false },
          "error": { "const": "unavailable" },
          "disclaimer": { "type": "string" },
          "copyright": { "type": "string" }
        },
        "additionalProperties": false
      }
    }
  }
}
