{
  "openapi": "3.0.3",
  "info": {
    "title": "Verapix API",
    "version": "1.0.0",
    "description": "Disclosure-safe AI enhancement for real-estate listing photos. One credit per enhanced photo; edits are structure-verified against the original."
  },
  "servers": [{ "url": "https://verapix.shovelware.ai" }],
  "security": [{ "bearerAuth": [] }],
  "paths": {
    "/v1/enhance": {
      "post": {
        "summary": "Enhance a photo",
        "description": "Submit one image (multipart field `photo`, or JSON `image_base64`). Runs asynchronously.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "photo": { "type": "string", "format": "binary" },
                  "strength": { "type": "string", "enum": ["subtle", "standard", "strong"] }
                },
                "required": ["photo"]
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "image_base64": { "type": "string" },
                  "filename": { "type": "string" },
                  "strength": { "type": "string", "enum": ["subtle", "standard", "strong"] }
                },
                "required": ["image_base64"]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": { "type": "string" },
                    "status": { "type": "string" },
                    "status_url": { "type": "string", "format": "uri" }
                  }
                }
              }
            }
          },
          "401": { "description": "Invalid or missing API key" },
          "402": { "description": "No credits remaining" },
          "400": { "description": "Bad request" },
          "429": { "description": "Rate limited" }
        }
      }
    },
    "/v1/photos/{id}": {
      "get": {
        "summary": "Get photo status/result",
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": { "type": "string" },
                    "status": { "type": "string", "enum": ["queued", "processing", "done", "failed"] },
                    "room_label": { "type": "string", "nullable": true },
                    "used_generative": { "type": "boolean" },
                    "structure_score": { "type": "number", "nullable": true },
                    "enhanced_url": { "type": "string", "format": "uri", "nullable": true },
                    "error": { "type": "string", "nullable": true }
                  }
                }
              }
            }
          },
          "401": { "description": "Invalid or missing API key" },
          "404": { "description": "Not found" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "vpx_live_*" }
    }
  }
}
