{
  "openapi": "3.1.0",
  "info": {
    "title": "SkyGlobal AI Travel Brief API",
    "version": "1.0.0",
    "description": "Free, no-registration API that converts trip preferences into a structured AI-ready brief. It does not book travel or return live prices."
  },
  "servers": [{ "url": "https://skysglobal.com" }],
  "paths": {
    "/api/trip-brief": {
      "get": {
        "operationId": "createTravelBrief",
        "summary": "Create an AI-ready travel brief",
        "parameters": [
          { "name": "destination", "in": "query", "required": true, "schema": { "type": "string", "maxLength": 80 } },
          { "name": "origin", "in": "query", "schema": { "type": "string", "maxLength": 80 } },
          { "name": "days", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 60, "default": 7 } },
          { "name": "adults", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 20, "default": 2 } },
          { "name": "children", "in": "query", "schema": { "type": "integer", "minimum": 0, "maximum": 10, "default": 0 } },
          { "name": "budget", "in": "query", "schema": { "type": "number", "minimum": 0, "maximum": 1000000 } },
          { "name": "currency", "in": "query", "schema": { "type": "string", "enum": ["SAR", "USD", "EUR", "GBP", "AED"], "default": "SAR" } },
          { "name": "pace", "in": "query", "schema": { "type": "string", "enum": ["relaxed", "balanced", "active"], "default": "balanced" } },
          { "name": "interests", "in": "query", "description": "Comma-separated: culture,nature,food,shopping,family,relaxation,adventure", "schema": { "type": "string" } },
          { "name": "language", "in": "query", "schema": { "type": "string", "enum": ["ar", "en"], "default": "ar" } },
          { "name": "format", "in": "query", "schema": { "type": "string", "enum": ["json", "markdown"], "default": "json" } }
        ],
        "responses": {
          "200": {
            "description": "Structured trip brief",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/TripBrief" } },
              "text/markdown": { "schema": { "type": "string" } }
            }
          },
          "400": { "description": "Invalid request" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "TripBrief": {
        "type": "object",
        "required": ["schemaVersion", "kind", "language", "trip", "planningChecklist", "safetyRules", "prompt"],
        "properties": {
          "schemaVersion": { "type": "string", "const": "1.0" },
          "kind": { "type": "string", "const": "ai-travel-brief" },
          "language": { "type": "string", "enum": ["ar", "en"] },
          "trip": { "type": "object" },
          "planningChecklist": { "type": "array", "items": { "type": "string" } },
          "safetyRules": { "type": "array", "items": { "type": "string" } },
          "prompt": { "type": "string" }
        }
      }
    }
  }
}
