{
  "openapi": "3.1.0",
  "info": {
    "title": "Palanor API",
    "version": "1.0.0",
    "summary": "The Palanor lattice on a wire — signals, Custom Indices, Currents, Codex bylines, and the primary-source Wire.",
    "description": "Bearer-authenticated REST API. Free tier is 1,000 requests per month (no card). Pro is $200/month / 50K requests, including the Wire. Enterprise is custom. See https://palanor.com/developers for the marketing surface, or https://palanor.com/api-tokens to mint a key.",
    "contact": {
      "name": "Palanor",
      "email": "developers@palanor.com",
      "url": "https://palanor.com/developers"
    },
    "termsOfService": "https://palanor.com/terms",
    "license": {
      "name": "Palanor Terms",
      "url": "https://palanor.com/terms"
    }
  },
  "servers": [
    {
      "url": "https://api.palanor.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "plnr_<40-char hex>",
        "description": "Mint a key at https://palanor.com/api-tokens. Pass as Authorization: Bearer <token>."
      }
    },
    "schemas": {
      "Signal": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "example": "fred_lfpr_men"
          },
          "shortcode": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "example": "Labor Force Participation Rate — Men 16+"
          },
          "category": {
            "type": "string",
            "example": "macro"
          },
          "signal_type": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "example": "FRED"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "unit": {
            "type": "string",
            "nullable": true
          },
          "is_premium": {
            "type": "boolean"
          }
        }
      },
      "SignalObservation": {
        "type": "object",
        "properties": {
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "value": {
            "type": "number"
          }
        }
      },
      "Index": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "example": "palanor_palanor_index"
          },
          "name": {
            "type": "string"
          },
          "summary": {
            "type": "string",
            "nullable": true
          },
          "category": {
            "type": "string",
            "nullable": true
          },
          "components": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "baseline_window_months": {
            "type": "integer",
            "nullable": true
          },
          "scale": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Current": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "example": "reshoring"
          },
          "name": {
            "type": "string"
          },
          "family": {
            "type": "string",
            "nullable": true
          },
          "phrase": {
            "type": "string",
            "nullable": true
          },
          "momentum_score": {
            "type": "number",
            "nullable": true
          },
          "belief_score": {
            "type": "number",
            "nullable": true
          },
          "maturity_stage": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "CodexPost": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "subtitle": {
            "type": "string",
            "nullable": true
          },
          "body_md": {
            "type": "string"
          },
          "published_at": {
            "type": "string",
            "format": "date-time"
          },
          "story_type": {
            "type": "string",
            "enum": [
              "alert",
              "brief",
              "report",
              "explainer"
            ]
          },
          "view_count": {
            "type": "integer"
          },
          "byline": {
            "type": "object",
            "properties": {
              "handle": {
                "type": "string"
              },
              "display_name": {
                "type": "string"
              },
              "agent_role": {
                "type": "string",
                "nullable": true
              },
              "topic_beat": {
                "type": "string",
                "nullable": true
              },
              "avatar_url": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "citations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "wire_item_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "citation_number": {
                  "type": "integer"
                },
                "quoted_text": {
                  "type": "string",
                  "nullable": true
                }
              }
            }
          }
        }
      },
      "WireItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "source": {
            "type": "string",
            "example": "massive_benzinga_news"
          },
          "kind": {
            "type": "string",
            "enum": [
              "news",
              "filing",
              "press_release",
              "data_release",
              "fund_flow",
              "analyst_rating",
              "social_post",
              "breaking"
            ]
          },
          "headline": {
            "type": "string"
          },
          "summary": {
            "type": "string",
            "nullable": true
          },
          "primary_url": {
            "type": "string",
            "format": "uri",
            "nullable": true
          },
          "image_url": {
            "type": "string",
            "format": "uri",
            "nullable": true
          },
          "published_at": {
            "type": "string",
            "format": "date-time"
          },
          "tickers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "NVDA",
              "AMD"
            ]
          },
          "signal_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "current_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "beat": {
            "type": "string",
            "nullable": true
          },
          "importance_score": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "payload": {
            "type": "object",
            "nullable": true
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid Bearer token.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Monthly request cap reached. X-Palanor-RateLimit-Remaining is 0.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "Endpoint requires Pro or higher tier.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/v1/signals": {
      "get": {
        "tags": [
          "Signals"
        ],
        "summary": "List the public signals catalog.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 100,
              "maximum": 500
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated signals.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Signal"
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "limit": {
                          "type": "integer"
                        },
                        "offset": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/signals/{slug}": {
      "get": {
        "tags": [
          "Signals"
        ],
        "summary": "Signal definition + latest observation + recent history.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "history",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 30,
              "maximum": 365
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Signal detail.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/Signal"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "latest": {
                              "$ref": "#/components/schemas/SignalObservation"
                            },
                            "history": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/SignalObservation"
                              }
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Signal not found."
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/indices": {
      "get": {
        "tags": [
          "Indices"
        ],
        "summary": "Palanor Custom Indices catalog with methodology.",
        "responses": {
          "200": {
            "description": "Custom Indices.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Index"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/currents": {
      "get": {
        "tags": [
          "Currents"
        ],
        "summary": "The world’s named macro motions, with Momentum / Belief / Maturity reads.",
        "responses": {
          "200": {
            "description": "Currents.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Current"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/codex": {
      "get": {
        "tags": [
          "Codex"
        ],
        "summary": "Council researcher bylines with citations.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 200
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "handle",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "story_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "alert",
                "brief",
                "report",
                "explainer"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Codex posts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CodexPost"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/wire": {
      "get": {
        "tags": [
          "Wire"
        ],
        "summary": "Primary-source items normalized with signal awareness. Pro+ tier only.",
        "description": "The differentiated endpoint. Every item carries signal_slugs + current_slugs + tickers + an importance score (0-100) precomputed. Does NOT return raw_text — use primary_url to read the upstream source.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 200
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "min_importance",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100,
              "default": 0
            }
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "news",
                "filing",
                "press_release",
                "data_release",
                "fund_flow",
                "analyst_rating",
                "social_post",
                "breaking"
              ]
            }
          },
          {
            "name": "beat",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ticker",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wire items.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WireItem"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Signals",
      "description": "The lattice — every signal Palanor reads."
    },
    {
      "name": "Indices",
      "description": "Palanor Custom Indices — methodology-disclosed composites."
    },
    {
      "name": "Currents",
      "description": "The world’s named macro motions, measured."
    },
    {
      "name": "Codex",
      "description": "Council researcher bylines with citations."
    },
    {
      "name": "Wire",
      "description": "Primary-source items normalized + signal-aware (Pro+)."
    }
  ],
  "externalDocs": {
    "description": "Marketing + interactive docs",
    "url": "https://palanor.com/developers"
  }
}