{
  "openapi": "3.0.0",
  "info": {
    "title": "PizzaGPT API",
    "description": "PizzaGPT - Free multilingual AI chat and image generation. The free alternative to ChatGPT Pro, available in 7 languages.",
    "version": "3.0.0",
    "contact": {
      "email": "info@pizzagpt.ai"
    }
  },
  "servers": [
    {
      "url": "https://pizzagpt.ai",
      "description": "Production (Italian default; /en /de /fr /es /pt /ru for other languages)"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "summary": "Homepage - Free AI Chat (Italian default)",
        "description": "Main AI chat interface. Guest: 10 free messages. Registered free: 15 messages/day. Pro: unlimited.",
        "responses": { "200": { "description": "Homepage with chat interface" } }
      }
    },
    "/{lang}": {
      "get": {
        "summary": "Localized homepage",
        "description": "Localized homepage for one of: en, de, fr, es, pt, ru.",
        "parameters": [
          { "name": "lang", "in": "path", "required": true, "schema": { "type": "string", "enum": ["en", "de", "fr", "es", "pt", "ru"] } }
        ],
        "responses": { "200": { "description": "Localized homepage" } }
      }
    },
    "/images": {
      "get": {
        "summary": "AI Image Generator",
        "description": "Generate images with AI. Free users share the daily message quota; Pro users get unlimited images. Public gallery available.",
        "responses": { "200": { "description": "Image generator page with gallery" } }
      }
    },
    "/{lang}/images": {
      "get": {
        "summary": "Localized AI Image Generator",
        "parameters": [
          { "name": "lang", "in": "path", "required": true, "schema": { "type": "string", "enum": ["en", "de", "fr", "es", "pt", "ru"] } }
        ],
        "responses": { "200": { "description": "Localized image generator" } }
      }
    },
    "/pricing": {
      "get": {
        "summary": "Pricing - Free vs Pro plan",
        "description": "Compare free plan and Pro plan (€4.99/month, unlimited messages and images).",
        "responses": { "200": { "description": "Pricing page" } }
      }
    },
    "/blog": {
      "get": {
        "summary": "Blog - SEO articles about AI",
        "description": "Multilingual blog with AI-generated SEO articles.",
        "responses": { "200": { "description": "Blog index" } }
      }
    },
    "/why-pizza": {
      "get": {
        "summary": "Why Pizza?",
        "description": "The story behind PizzaGPT's name and philosophy.",
        "responses": { "200": { "description": "Why Pizza page" } }
      }
    },
    "/profile": {
      "get": {
        "summary": "User Profile",
        "description": "User profile management and language preferences. Requires authentication.",
        "responses": { "200": { "description": "User profile page" } }
      }
    },
    "/functions/v1/llm-info": {
      "get": {
        "summary": "LLM Info API",
        "description": "Returns structured information about PizzaGPT for LLMs and AI agents. Supports ?lang= for any of the 7 languages.",
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "description": "Language code: it (default), en, de, fr, es, pt, ru",
            "schema": { "type": "string", "enum": ["it", "en", "de", "fr", "es", "pt", "ru"], "default": "it" }
          }
        ],
        "responses": { "200": { "description": "JSON with PizzaGPT info" } }
      }
    },
    "/sitemap-index.xml": {
      "get": {
        "summary": "Sitemap Index",
        "description": "Index of all sitemaps (static pages, generated images, blog).",
        "responses": { "200": { "description": "XML Sitemap index" } }
      }
    },
    "/sitemap.xml": {
      "get": {
        "summary": "Static Pages Sitemap",
        "description": "XML sitemap with all static pages and hreflang alternates for all 7 languages.",
        "responses": { "200": { "description": "XML Sitemap" } }
      }
    },
    "/functions/v1/sitemap-images": {
      "get": {
        "summary": "Dynamic Images Sitemap",
        "description": "Auto-updated XML sitemap with all user-generated AI images.",
        "responses": { "200": { "description": "XML Images Sitemap" } }
      }
    },
    "/functions/v1/blog-sitemap": {
      "get": {
        "summary": "Dynamic Blog Sitemap",
        "description": "Auto-updated XML sitemap with all published blog articles in all languages.",
        "responses": { "200": { "description": "XML Blog Sitemap" } }
      }
    }
  },
  "components": {
    "schemas": {
      "ChatMessage": {
        "type": "object",
        "description": "A message in a chat conversation",
        "properties": {
          "role": { "type": "string", "enum": ["user", "assistant"] },
          "content": { "type": "string" }
        }
      },
      "GeneratedImage": {
        "type": "object",
        "description": "An AI-generated image",
        "properties": {
          "id": { "type": "string" },
          "title": { "type": "string" },
          "prompt": { "type": "string" },
          "image_url": { "type": "string" },
          "slug": { "type": "string" }
        }
      }
    }
  }
}
