{
  "openapi": "3.1.0",
  "info": {
    "title": "Vira Public API",
    "version": "1.0.0",
    "summary": "Read-only public data about Vira, the AI presentation and research platform for students.",
    "description": "Public, unauthenticated, read-only endpoints of Vira (https://vira.softyu.org). Presentation generation, Vira Research and account data are only available to signed-in users through the web app and are not part of this API.",
    "contact": {
      "name": "Vira",
      "url": "https://vira.softyu.org/contact-us"
    }
  },
  "servers": [
    {
      "url": "https://vira.softyu.org"
    }
  ],
  "externalDocs": {
    "description": "Vira public API documentation",
    "url": "https://vira.softyu.org/developers"
  },
  "tags": [
    {
      "name": "Billing",
      "description": "Plans, prices and credits"
    }
  ],
  "paths": {
    "/api/v1/billing/plans": {
      "get": {
        "operationId": "listPlans",
        "tags": ["Billing"],
        "summary": "List Vira plans with prices and credits",
        "description": "Returns every plan ordered by price. Prices are in Azerbaijani manat (AZN). Each generated or AI-edited slide costs 2 credits. Paid plans do not renew automatically.",
        "security": [],
        "responses": {
          "200": {
            "description": "Plans ordered from cheapest to most expensive.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Plan"
                  }
                },
                "example": [
                  { "key": "free", "label": "Free", "credits": 50, "price_azn": 0.0, "duration_days": null, "features": null },
                  { "key": "plus", "label": "Plus", "credits": 200, "price_azn": 9.9, "duration_days": 30, "features": null },
                  { "key": "pro", "label": "Pro", "credits": 500, "price_azn": 19.9, "duration_days": 30, "features": null },
                  { "key": "semestr", "label": "Semestr", "credits": 1500, "price_azn": 34.9, "duration_days": 90, "features": null }
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Plan": {
        "type": "object",
        "required": ["key", "label", "credits", "price_azn", "duration_days"],
        "properties": {
          "key": {
            "type": "string",
            "description": "Stable plan identifier.",
            "examples": ["free", "plus", "pro", "semestr"]
          },
          "label": {
            "type": "string",
            "description": "Display name of the plan."
          },
          "credits": {
            "type": "integer",
            "minimum": 0,
            "description": "Credits included. For the free plan these refresh every 30 days; for paid plans they are granted once per purchase. One slide costs 2 credits."
          },
          "price_azn": {
            "type": "number",
            "minimum": 0,
            "description": "Price in Azerbaijani manat (AZN)."
          },
          "duration_days": {
            "type": ["integer", "null"],
            "description": "How long a paid plan stays active after purchase. Null for the free plan."
          },
          "features": {
            "type": ["array", "object", "null"],
            "description": "Optional extra plan details. Currently null for all plans."
          }
        }
      }
    }
  }
}
