{
  "openapi": "3.1.0",
  "info": {
    "title": "PrimAI Public Agent API",
    "version": "0.1.0",
    "description": "Public PrimAI endpoints for AI agents and developers. PrimAI is a free neutral Swiss health-insurance utility app, not an insurer, broker, government portal or commissioned advisor."
  },
  "servers": [
    {
      "url": "https://www.primai.ch",
      "description": "PrimAI website"
    },
    {
      "url": "https://primai-okp-api.fly.dev",
      "description": "PrimAI public compulsory health-insurance premium API"
    }
  ],
  "paths": {
    "/llms.txt": {
      "get": {
        "summary": "LLM instructions",
        "operationId": "getLlmsTxt",
        "responses": {
          "200": {
            "description": "Plain-text agent instructions",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/ai.txt": {
      "get": {
        "summary": "Short agent instructions",
        "operationId": "getAiTxt",
        "responses": {
          "200": {
            "description": "Plain-text agent instructions",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/webmcp.json": {
      "get": {
        "summary": "WebMCP manifest",
        "operationId": "getWebMcpManifest",
        "responses": {
          "200": {
            "description": "WebMCP-style action manifest",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "summary": "OpenAPI description",
        "operationId": "getOpenApiDescription",
        "responses": {
          "200": {
            "description": "OpenAPI document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compare": {
      "get": {
        "summary": "Compare Swiss compulsory health-insurance premiums",
        "operationId": "comparePremiums",
        "servers": [
          {
            "url": "https://primai-okp-api.fly.dev"
          }
        ],
        "parameters": [
          {
            "name": "plz",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "8810"
            },
            "description": "Swiss postal code. Use either plz or canton."
          },
          {
            "name": "canton",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "ZH"
            },
            "description": "Swiss canton code. Use either canton or plz."
          },
          {
            "name": "age",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "example": 35
            },
            "description": "Age in whole years. Use either age or yob."
          },
          {
            "name": "yob",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "example": 1990
            },
            "description": "Year of birth. Use either yob or age."
          },
          {
            "name": "deductible",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [300, 500, 1000, 1500, 2000, 2500],
              "example": 2500
            }
          },
          {
            "name": "accident",
            "in": "query",
            "required": true,
            "schema": {
              "type": "boolean",
              "example": false
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["hmo", "telmed", "hausarzt", "standard"]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                { "type": "integer" },
                { "type": "string", "enum": ["all"] }
              ],
              "example": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Premium offers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currency": { "type": "string", "example": "CHF" },
                    "age_band": { "type": "string", "example": "adult" },
                    "region": { "type": "string" },
                    "offers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "insurer": { "type": "string" },
                          "model": { "type": "string" },
                          "deductible": { "type": "integer" },
                          "accident": { "type": "boolean" },
                          "price": {
                            "type": "object",
                            "properties": {
                              "base": { "type": "number" },
                              "accident": { "type": "number" },
                              "total": { "type": "number" },
                              "currency": { "type": "string", "example": "CHF" }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters"
          }
        }
      }
    }
  }
}

