{
  "openapi": "3.1.0",
  "info": {
    "title": "Junction Nexus public read API",
    "version": "1.0.0",
    "description": "Read-only, no auth, cached. Every card's contentHash = sha256 of canonical JSON of data. Nothing here signs or moves funds.",
    "contact": {
      "url": "https://thespicemelange.org/llms.txt"
    }
  },
  "servers": [
    {
      "url": "https://thespicemelange.org"
    }
  ],
  "security": [],
  "paths": {
    "/api/public": {
      "get": {
        "operationId": "index",
        "summary": "Index of public hubs",
        "security": [],
        "responses": {
          "200": {
            "description": "Hub list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/kin/today": {
      "get": {
        "operationId": "kinToday",
        "summary": "Kin of the day (6:00 AM America/Los_Angeles seam)",
        "security": [],
        "responses": {
          "200": {
            "description": "Card with sha256 content hash",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "\"<contentHash>\""
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          }
        },
        "description": "Deterministic Dreamspell day plus the Chief of Kin persona. Example: 2026-11-15 = Kin 81 Red Electric Dragon, tone 3, wavespell seal 19 Blue Storm, Moon 5 Day 1."
      }
    },
    "/api/public/archive": {
      "get": {
        "operationId": "archive",
        "summary": "13 Moon archive, a date or a range",
        "security": [],
        "responses": {
          "200": {
            "description": "Card with sha256 content hash",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "\"<contentHash>\""
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 260,
              "default": 1
            }
          }
        ]
      }
    },
    "/api/public/archive/{date}": {
      "get": {
        "operationId": "archiveDay",
        "summary": "13 Moon archive, one date",
        "security": [],
        "responses": {
          "200": {
            "description": "Card with sha256 content hash",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "\"<contentHash>\""
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          }
        ]
      }
    },
    "/api/public/desk": {
      "get": {
        "operationId": "desk",
        "summary": "Desk listings",
        "security": [],
        "responses": {
          "200": {
            "description": "Card with sha256 content hash",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "\"<contentHash>\""
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/bounties": {
      "get": {
        "operationId": "bounties",
        "summary": "Bounty board (open tasks, escrow state)",
        "security": [],
        "responses": {
          "200": {
            "description": "Card with sha256 content hash",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "\"<contentHash>\""
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/vault": {
      "get": {
        "operationId": "vault",
        "summary": "Memory Vault (buffer, alarm, renewal dates)",
        "security": [],
        "responses": {
          "200": {
            "description": "Card with sha256 content hash",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "\"<contentHash>\""
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/balances": {
      "get": {
        "operationId": "balances",
        "summary": "Public mainnet balances of the treasury and memory wallets",
        "security": [],
        "responses": {
          "200": {
            "description": "Card with sha256 content hash",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "\"<contentHash>\""
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/state": {
      "get": {
        "operationId": "state",
        "summary": "Hub states: live / not-live / unknown",
        "security": [],
        "responses": {
          "200": {
            "description": "Card with sha256 content hash",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "\"<contentHash>\""
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          }
        }
      }
    },
    "/api/decisions/plain": {
      "get": {
        "operationId": "decisionsPlain",
        "summary": "Decision record, plain text agent view",
        "security": [],
        "responses": {
          "200": {
            "description": "Plain text",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/kin.rss": {
      "get": {
        "operationId": "kinRss",
        "summary": "Daily kin RSS 2.0 feed",
        "security": [],
        "responses": {
          "200": {
            "description": "RSS",
            "content": {
              "application/rss+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "MCP streamable HTTP endpoint (JSON-RPC 2.0, read-only tools)",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Notification accepted"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Card": {
        "$ref": "https://thespicemelange.org/schemas/card.schema.json"
      }
    }
  }
}
