{
  "openapi": "3.1.0",
  "info": {
    "title": "VIBES Registry & Attestation API (itsavibe.ai)",
    "version": "1.1.0",
    "description": "Public endpoints for discovering VIBES specifications, querying verified projects, inspecting cryptographic VERIFY attestations (DSSE + in-toto v1), and submitting signed provenance records. See https://itsavibe.ai/auth.md and https://itsavibe.ai/agents.md."
  },
  "servers": [
    {
      "url": "https://itsavibe.ai/api"
    }
  ],
  "externalDocs": {
    "description": "VIBES Agent Manifest & Authentication Guide",
    "url": "https://itsavibe.ai/auth.md"
  },
  "components": {
    "securitySchemes": {
      "bearerApiToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "vib_<token>",
        "description": "Scoped API token (`vib_...`) created by a project owner in the itsavibe.ai Dashboard. See https://itsavibe.ai/auth.md."
      }
    }
  },
  "paths": {
    "/health": {
      "get": {
        "summary": "Liveness check",
        "security": [],
        "responses": {
          "200": {
            "description": "The service is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "service": { "type": "string" },
                    "standard_family": { "type": "string" },
                    "version": { "type": "string" }
                  },
                  "required": ["ok"]
                }
              }
            }
          }
        }
      }
    },
    "/content-policy": {
      "get": {
        "summary": "Content and DSSE envelope validation policy",
        "security": [],
        "responses": {
          "200": {
            "description": "Active validation rules and size limits",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      }
    },
    "/attestation/list": {
      "get": {
        "summary": "List public VERIFY attestations",
        "security": [],
        "parameters": [
          { "name": "status", "in": "query", "schema": { "type": "string", "enum": ["accepted", "pending", "rejected"] } },
          { "name": "assurance_level", "in": "query", "schema": { "type": "string", "enum": ["low", "medium", "high"] } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100 } },
          { "name": "cursor", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of attestations",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      }
    },
    "/attestation/stats": {
      "get": {
        "summary": "Aggregate attestation counts by status and assurance level",
        "security": [],
        "responses": {
          "200": {
            "description": "Registry statistics",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      }
    },
    "/attestation/submit": {
      "post": {
        "summary": "Submit a signed DSSE + in-toto v1 VERIFY attestation envelope",
        "security": [{}, { "bearerApiToken": ["attestation:submit"] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["envelope", "metadata"],
                "properties": {
                  "envelope": {
                    "type": "object",
                    "description": "DSSE envelope with base64url in-toto Statement v1 payload and Ed25519 signatures",
                    "required": ["payloadType", "payload", "signatures"]
                  },
                  "metadata": {
                    "type": "object",
                    "required": ["project_name", "assurance_level", "validation_result"],
                    "properties": {
                      "project_name": { "type": "string" },
                      "project_slug": { "type": "string" },
                      "assurance_level": { "type": "string", "enum": ["low", "medium", "high"] },
                      "validation_result": { "type": "string", "enum": ["pass", "warn", "fail"] }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Attestation stored and assigned content-addressed SHA-256 ID",
            "content": { "application/json": { "schema": { "type": "object" } } }
          },
          "400": { "description": "Invalid envelope or metadata" },
          "413": { "description": "Body exceeds 1 MB limit" },
          "429": { "description": "Rate limit exceeded" }
        }
      }
    },
    "/attestation/{id}": {
      "get": {
        "summary": "Retrieve an attestation record and raw DSSE envelope by SHA-256 ID",
        "security": [],
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Attestation metadata and DSSE envelope",
            "content": { "application/json": { "schema": { "type": "object" } } }
          },
          "404": { "description": "Attestation not found" }
        }
      }
    },
    "/attestation/verify/{id}": {
      "get": {
        "summary": "Verify envelope SHA-256 integrity, Ed25519 signatures, and metadata consistency",
        "security": [],
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Verification report including trust tier and signature status",
            "content": { "application/json": { "schema": { "type": "object" } } }
          },
          "404": { "description": "Attestation not found" }
        }
      }
    },
    "/attestation/analyze/{id}": {
      "get": {
        "summary": "Decode and analyze the in-toto v1 statement inside an attestation envelope",
        "security": [],
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Decoded statement analysis",
            "content": { "application/json": { "schema": { "type": "object" } } }
          },
          "404": { "description": "Attestation not found" }
        }
      }
    },
    "/attestation/badge/{id}": {
      "get": {
        "summary": "Render an SVG verification badge for an attestation ID",
        "security": [],
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "SVG badge",
            "content": { "image/svg+xml": { "schema": { "type": "string" } } }
          }
        }
      }
    },
    "/projects/list": {
      "get": {
        "summary": "List public projects registered in the VIBES registry",
        "security": [],
        "responses": {
          "200": {
            "description": "Paginated project directory",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      }
    },
    "/projects/{slug}": {
      "get": {
        "summary": "Get public project details and recent attestations by slug",
        "security": [],
        "parameters": [
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Project details",
            "content": { "application/json": { "schema": { "type": "object" } } }
          },
          "404": { "description": "Project not found" }
        }
      }
    },
    "/projects/{slug}/verify": {
      "get": {
        "summary": "Verify the latest attestation and signing keys for a project",
        "security": [],
        "parameters": [
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Project verification status",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      }
    },
    "/projects/{slug}/badge": {
      "get": {
        "summary": "Render an SVG status badge for a project slug",
        "security": [],
        "parameters": [
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "SVG project badge",
            "content": { "image/svg+xml": { "schema": { "type": "string" } } }
          }
        }
      }
    },
    "/tool-providers/list": {
      "get": {
        "summary": "List registered AI tool providers and their Ed25519 cosigning public keys",
        "security": [],
        "responses": {
          "200": {
            "description": "Tool provider key registry",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      }
    },
    "/events/list": {
      "get": {
        "summary": "Public transparency log of attestation and project events",
        "security": [],
        "responses": {
          "200": {
            "description": "Paginated event stream",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      }
    }
  }
}
