{
  "openapi": "3.0.3",
  "info": {
    "title": "Rexi Public Information API",
    "version": "1.0.0",
    "description": "Read-only public information about Rexi. No authentication required."
  },
  "servers": [
    {
      "url": "https://tryrexi.com",
      "description": "Production"
    },
    {
      "url": "https://tryrexi.com/sandbox",
      "description": "Sandbox with fixed test data"
    }
  ],
  "externalDocs": {
    "description": "Rexi API documentation",
    "url": "https://tryrexi.com/docs"
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      }
    }
  },
  "paths": {
    "/api/v1/product": {
      "get": {
        "operationId": "getProduct",
        "summary": "Get Rexi’s public product overview.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "audience": {
                      "type": "string"
                    },
                    "liveGuard": {
                      "type": "string"
                    },
                    "privacy": {
                      "type": "string"
                    },
                    "pricing": {
                      "type": "string"
                    },
                    "downloads": {
                      "type": "string"
                    },
                    "documentation": {
                      "type": "string"
                    },
                    "support": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "description",
                    "audience",
                    "liveGuard",
                    "privacy",
                    "pricing",
                    "downloads",
                    "documentation",
                    "support"
                  ]
                },
                "example": {
                  "name": "Rexi",
                  "description": "Rexi is a local desktop guard for AI agents on macOS and Windows. It can block risky actions or ask you to approve them.",
                  "audience": "Individuals and families using AI agents at home, and micro-businesses and small and midsize businesses using agents at work on Mac or Windows.",
                  "liveGuard": "Claude Code. Other supported agents can be discovered locally.",
                  "privacy": "The desktop app runs locally, with no account, analytics, or telemetry in the preview.",
                  "pricing": "https://tryrexi.com/pricing",
                  "downloads": "https://tryrexi.com/#download",
                  "documentation": "https://tryrexi.com/docs",
                  "support": "https://github.com/RexiHQ/releases/issues"
                }
              }
            }
          },
          "404": {
            "description": "Unknown endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/downloads": {
      "get": {
        "operationId": "getDownloads",
        "summary": "Get the current release and platform installers.",
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "description": "Return only this platform’s installer.",
            "schema": {
              "type": "string",
              "enum": [
                "macArm",
                "macIntel",
                "windows"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "releases": {
                      "type": "string"
                    },
                    "installers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "platform": {
                            "type": "string"
                          },
                          "requirements": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "platform",
                          "requirements",
                          "url"
                        ]
                      }
                    }
                  },
                  "required": [
                    "version",
                    "releases",
                    "installers"
                  ]
                },
                "example": {
                  "version": "0.1.3",
                  "releases": "https://github.com/RexiHQ/releases",
                  "installers": [
                    {
                      "platform": "macArm",
                      "requirements": "macOS 13 or later, Apple silicon",
                      "url": "https://github.com/RexiHQ/releases/releases/download/v0.1.3/Rexi-0.1.3-arm64.dmg"
                    },
                    {
                      "platform": "macIntel",
                      "requirements": "macOS 13 or later, Intel",
                      "url": "https://github.com/RexiHQ/releases/releases/download/v0.1.3/Rexi-0.1.3.dmg"
                    },
                    {
                      "platform": "windows",
                      "requirements": "64-bit Windows 10 or 11",
                      "url": "https://github.com/RexiHQ/releases/releases/download/v0.1.3/Rexi-Setup-0.1.3.exe"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid filter value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/pricing": {
      "get": {
        "operationId": "getPricing",
        "summary": "Get plan availability, annual prices and savings. Monthly prices are comparison rates.",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Return only plans with this availability.",
            "schema": {
              "type": "string",
              "enum": [
                "available",
                "planned"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string"
                    },
                    "plans": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "monthlyPrice": {
                            "type": "integer"
                          },
                          "annualPrice": {
                            "type": "integer"
                          },
                          "description": {
                            "type": "string"
                          },
                          "annualSavings": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "name",
                          "status",
                          "monthlyPrice",
                          "annualPrice",
                          "description",
                          "annualSavings"
                        ]
                      }
                    }
                  },
                  "required": [
                    "currency",
                    "plans"
                  ]
                },
                "example": {
                  "currency": "USD",
                  "plans": [
                    {
                      "name": "Free",
                      "status": "available",
                      "monthlyPrice": 0,
                      "annualPrice": 0,
                      "description": "Agent discovery, activity history, and the Demo lab.",
                      "annualSavings": 0
                    },
                    {
                      "name": "Guard",
                      "status": "planned",
                      "monthlyPrice": 6,
                      "annualPrice": 60,
                      "description": "Live guard for Claude Code, spending controls, and approvals for sensitive actions.",
                      "annualSavings": 12
                    },
                    {
                      "name": "Family",
                      "status": "planned",
                      "monthlyPrice": 12,
                      "annualPrice": 120,
                      "description": "Guard features plus family protection and shared alerts.",
                      "annualSavings": 24
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid filter value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Check public API availability.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ]
                },
                "example": {
                  "status": "ok"
                }
              }
            }
          },
          "404": {
            "description": "Unknown endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents": {
      "get": {
        "operationId": "searchDocumentation",
        "summary": "Browse or search the published Rexi documentation.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Pass nextCursor from the preceding page with the same search query. Omit offset.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Page of matching documents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "total",
                    "nextOffset"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "headings": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "url",
                          "title",
                          "summary",
                          "headings"
                        ]
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "nextOffset": {
                      "type": "integer",
                      "nullable": true
                    },
                    "nextCursor": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid search or pagination parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  }
}
