{
  "openapi": "3.0.3",
  "info": {
    "title": "YatraSarthi Trip Planner API",
    "version": "1.2.0",
    "description": "Tactical travel intelligence, day-by-day itineraries, transport price comparisons, and an honest budget feasibility engine for 4,358 Indian city and destination names, 300 published route guides and a destination price index over 101 destinations in 6 regions. All monetary values are estimates in INR, not live bookings. Every rupee in a response is priced from that published index; the AI pass returns comparison figures that are excluded from all totals, scores and verdicts. Machine-readable overview: https://www.yatra-sarthi.com/llms.txt",
    "contact": {
      "name": "YatraSarthi Support",
      "email": "support.yatrasarthi@gmail.com"
    }
  },
  "servers": [
    {
      "url": "https://www.yatra-sarthi.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Session token returned by /api/auth/signup, /api/auth/login, or /api/auth/google."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": { "type": "string" },
          "message": { "type": "string" }
        },
        "required": ["error"]
      },
      "TransportOption": {
        "type": "object",
        "properties": {
          "mode": { "type": "string", "example": "train" },
          "outbound_fare": { "type": "number", "description": "One-way fare per person (INR)" },
          "return_fare": { "type": "number", "description": "Return fare per person (INR)" },
          "total_round_trip_per_person": { "type": "number" },
          "group_total": { "type": "number", "description": "Round-trip cost for the whole party (INR)" },
          "cost": { "type": "number", "description": "Same as group_total for the plan response" },
          "time_hours": { "type": "number" },
          "note": { "type": "string" }
        }
      },
      "PlanRequest": {
        "type": "object",
        "required": ["origin", "destination", "from", "to", "budget", "travelers"],
        "properties": {
          "origin": { "type": "string", "example": "Delhi" },
          "destination": { "type": "string", "example": "Goa" },
          "from": { "type": "string", "format": "date", "example": "2026-11-01" },
          "to": { "type": "string", "format": "date", "example": "2026-11-05" },
          "days": { "type": "integer", "minimum": 1, "maximum": 30, "description": "Optional. When from/to are present the server derives inclusive trip days (1 Nov → 5 Nov = 5)." },
          "budget": { "type": "number", "description": "Daily budget per person (INR)", "example": 3500 },
          "travelers": { "type": "integer", "minimum": 1, "maximum": 20, "example": 2 },
          "interests": {
            "type": "array",
            "items": { "type": "string" },
            "example": ["Beaches", "Food", "Nightlife"]
          }
        }
      },
      "PlanResponse": {
        "type": "object",
        "properties": {
          "origin": { "type": "string" },
          "destination": { "type": "string" },
          "days": { "type": "integer", "description": "Inclusive of both from and to dates." },
          "from": { "type": "string", "format": "date" },
          "to": { "type": "string", "format": "date" },
          "budget_per_day": { "type": "number", "description": "Daily budget per person (INR)" },
          "travelers": { "type": "integer" },
          "interests": { "type": "array", "items": { "type": "string" } },
          "is_circuit": { "type": "boolean" },
          "circuit_title": { "type": "string" },
          "stops": { "type": "array", "items": { "type": "object" } },
          "legs": { "type": "array", "items": { "type": "object" } },
          "transport_options": { "type": "array", "items": { "$ref": "#/components/schemas/TransportOption" } },
          "recommended_transport": { "$ref": "#/components/schemas/TransportOption" },
          "distance_km": { "type": "number", "description": "The distance the fares were modelled from. Check pricing_evidence.distance.source before trusting it: 'unknown' means a 1,000 km default, not your route." },
          "transport_estimated": { "type": "boolean", "description": "True when no curated corridor existed and fares came from per-km averages." },
          "verdict": { "$ref": "#/components/schemas/Verdict" },
          "verdict_analysis": {
            "type": "object",
            "description": "Three short narrative lists about the trip. Prose only — no number in here moves a total.",
            "properties": {
              "what_works": { "type": "array", "items": { "type": "string" } },
              "needs_attention": { "type": "array", "items": { "type": "string" } },
              "best_way_to_stay_within_budget": { "type": "array", "items": { "type": "string" } }
            }
          },
          "score": {
            "type": "object",
            "description": "Weighted nine-factor score. status always matches verdict.status.",
            "properties": {
              "overall": { "type": "number" },
              "status": { "type": "string", "enum": ["EXCELLENT", "FEASIBLE", "TIGHT", "STRETCH", "NOT_FEASIBLE"] },
              "summary_verdict": { "type": "string" },
              "metrics": { "type": "array", "items": { "type": "object" } },
              "factors": { "type": "object" },
              "factor_details": { "type": "object" }
            }
          },
          "cost_breakdown": {
            "type": "object",
            "description": "Deterministic whole-trip breakdown for the whole party. total equals verdict.estimated_cost.typical.",
            "properties": {
              "total": { "type": "number" },
              "transport": { "type": "number" },
              "accommodation": { "type": "number" },
              "food": { "type": "number" },
              "activities": { "type": "number" },
              "roaming": { "type": "number" }
            }
          },
          "breakdown_details": { "type": "object", "description": "Per-line unit prices, nights and headcounts behind cost_breakdown." },
          "rate_reality": { "$ref": "#/components/schemas/RateReality" },
          "pricing_evidence": { "$ref": "#/components/schemas/PricingEvidence" },
          "engine_verdict": {
            "type": "object",
            "description": "The deterministic feasibility output before any narrative was attached.",
            "properties": {
              "can_promise_feasible": { "type": "boolean", "description": "False whenever any line lacked published evidence." },
              "safety_margin": { "type": "number", "description": "0.05 high confidence, 0.10 medium, 0.18 low." },
              "blockers": { "type": "array", "items": { "type": "string" }, "description": "Plain-language reasons the planner will not promise this trip." },
              "notes": { "type": "array", "items": { "type": "string" } }
            }
          },
          "live_estimates": {
            "type": "object",
            "description": "AI-sourced comparison fares and food rates. Never overrides cost_breakdown, verdict or score.",
            "properties": {
              "label": { "type": "string" },
              "source": { "type": "string", "example": "ai" },
              "estimated_at": { "type": "string", "format": "date-time" },
              "note": { "type": "string" },
              "transport": { "type": "object" },
              "food": { "type": "object" }
            }
          },
          "budget_options": { "type": "array", "items": { "type": "object" } },
          "itinerary": { "type": "array", "items": { "type": "object" } },
          "hotels": { "type": "array", "items": { "type": "object" }, "description": "Hotel cards from the AI pass. Comparison only — each card's tier and rate is echoed in rate_reality.lines[].ai_rate with its own gap." },
          "roaming": { "type": "object" },
          "what_if_alternatives": {
            "type": "array",
            "description": "Deterministic re-pricings of the same trip under a cheaper choice.",
            "items": {
              "type": "object",
              "properties": {
                "id": { "type": "string", "example": "budget-hotels" },
                "label": { "type": "string" },
                "estimated_cost": { "type": "number" },
                "status": { "type": "string", "enum": ["EXCELLENT", "FEASIBLE", "TIGHT", "STRETCH", "NOT_FEASIBLE"] },
                "note": { "type": "string" },
                "details": { "type": "string" },
                "tradeoff": { "type": "string" },
                "actionable_tip": { "type": "string" }
              }
            }
          },
          "current_situation": { "type": "object", "nullable": true },
          "season": { "type": "object" },
          "meta": {
            "type": "object",
            "description": "Provenance strings the UI prints next to the numbers.",
            "properties": {
              "transport": {
                "type": "object",
                "properties": {
                  "source": { "type": "string", "enum": ["route_database", "distance_estimate"] },
                  "distance_km": { "type": "number" },
                  "distance_source": { "type": "string", "enum": ["curated", "guide", "coordinates", "unknown"] },
                  "distance_basis": { "type": "string" },
                  "description": { "type": "string" }
                }
              },
              "cost_breakdown": {
                "type": "object",
                "properties": {
                  "basis": { "type": "string", "example": "recommended_combo" },
                  "description": { "type": "string" },
                  "budget_per_day": { "type": "number" },
                  "travelers": { "type": "integer" },
                  "days": { "type": "integer" },
                  "estimated_at": { "type": "string", "format": "date-time" }
                }
              }
            }
          },
          "estimated_at": { "type": "string", "format": "date-time" },
          "credits": { "type": "integer", "description": "Remaining plan credits, present only for authenticated accounts." }
        }
      },
      "Verdict": {
        "type": "object",
        "description": "The headline feasibility call. Its numbers come from the deterministic engine; only the wording may come from the AI.",
        "properties": {
          "status": { "type": "string", "enum": ["EXCELLENT", "FEASIBLE", "TIGHT", "STRETCH", "NOT_FEASIBLE"] },
          "headline": { "type": "string" },
          "summary": { "type": "string" },
          "confidence": { "type": "string", "enum": ["high", "medium", "low"] },
          "budget": { "type": "object", "properties": { "total_available": { "type": "number" }, "per_person": { "type": "number" }, "per_person_per_day": { "type": "number" } } },
          "estimated_cost": { "type": "object", "properties": { "minimum": { "type": "number" }, "typical": { "type": "number" }, "maximum": { "type": "number" } } },
          "difference": { "type": "object", "properties": { "vs_minimum": { "type": "number" }, "vs_typical": { "type": "number" }, "vs_maximum": { "type": "number" } } },
          "utilization": { "type": "object", "properties": { "minimum_percent": { "type": "number" }, "typical_percent": { "type": "number" }, "maximum_percent": { "type": "number" } } },
          "cost_drivers": { "type": "array", "items": { "type": "string" }, "maxItems": 4 },
          "risks": { "type": "array", "items": { "type": "string" }, "maxItems": 4 },
          "recommendation": { "type": "object" }
        }
      },
      "PricingEvidence": {
        "type": "object",
        "description": "Which published rate the trip was priced from, and how much evidence stood behind it.",
        "properties": {
          "source": { "type": "string", "enum": ["destination", "region", "national", "budget_share"], "description": "budget_share means the line was scaled from the traveller's own budget because no published band existed." },
          "confidence": { "type": "string", "enum": ["high", "medium", "low"] },
          "matched": { "type": "string", "nullable": true },
          "label": { "type": "string", "nullable": true, "example": "Goa" },
          "region": { "type": "string", "example": "coastal" },
          "guides_used": { "type": "integer", "description": "Route guides for a destination match; for a region or all-India fallback it is the number of destinations in that median." },
          "stay_anchored": { "type": "boolean" },
          "food_anchored": { "type": "boolean" },
          "entry_anchored": { "type": "boolean" },
          "mobility_anchored": { "type": "boolean" },
          "free_attraction_share": { "type": "number", "nullable": true, "description": "Percent of the destination's listed attractions published as Free." },
          "distance": {
            "type": "object",
            "properties": {
              "km": { "type": "number" },
              "source": { "type": "string", "enum": ["curated", "guide", "coordinates", "unknown"], "description": "unknown is a 1,000 km default: the transport line is then reported unscored." },
              "label": { "type": "string" }
            }
          },
          "corridor": {
            "type": "object",
            "nullable": true,
            "properties": {
              "slug": { "type": "string", "example": "delhi-to-goa" },
              "distance_km": { "type": "number", "example": 1880 },
              "guide_days": { "type": "integer", "example": 5 },
              "self_plan_per_person": { "type": "object", "properties": { "low": { "type": "number", "example": 12500 }, "high": { "type": "number", "example": 24000 } } },
              "agency_package_per_person": { "type": "object", "properties": { "low": { "type": "number", "example": 16000 }, "high": { "type": "number", "example": 28000 } } }
            }
          }
        }
      },
      "RateReality": {
        "type": "object",
        "description": "Three numbers per cost line — what the budget allows, what our published rate charges, what the AI claimed — with the first two driving the maths and the third only comparing. Null when the trip could not be modelled.",
        "properties": {
          "basis": {
            "type": "object",
            "properties": {
              "reference_composition": { "type": "object", "nullable": true, "description": "Median day split across the destinations whose rates we publish: {stay, food, activities, local_transport} as fractions.", "example": { "stay": 0.4771, "food": 0.2699, "activities": 0.1492, "local_transport": 0.1037 } },
              "reference_destinations": { "type": "integer", "example": 70 },
              "reference_tier": { "type": "string", "example": "3-star" },
              "price_scope": { "type": "string", "example": "Goa" },
              "basis_label": { "type": "string", "example": "10 published Goa guides on this site" },
              "price_source": { "type": "string", "enum": ["destination", "region", "national", "budget_share"] },
              "guides_used": { "type": "integer" },
              "confidence": { "type": "string", "enum": ["high", "medium", "low"] },
              "explanation": { "type": "string" },
              "engine_status": { "type": "string", "nullable": true }
            }
          },
          "lines": { "type": "array", "items": { "$ref": "#/components/schemas/RateRealityLine" } },
          "summary": {
            "type": "object",
            "properties": {
              "rated_lines": { "type": "integer" },
              "unrated_lines": { "type": "integer" },
              "covered": { "type": "integer" },
              "close": { "type": "integer" },
              "short": { "type": "integer" },
              "verdict_counts": { "type": "object" },
              "headline": { "type": "string" }
            }
          }
        }
      },
      "RateRealityLine": {
        "type": "object",
        "properties": {
          "key": { "type": "string", "enum": ["stay", "food", "activities", "local_transport", "transport"] },
          "label": { "type": "string", "example": "3-star room per night" },
          "unit_label": { "type": "string", "example": "per person, per day" },
          "rate_basis": { "type": "string", "enum": ["published", "budget_share", "no_route_evidence"] },
          "budget_allows": { "type": "number", "description": "What the traveller's daily budget leaves for this line, INR." },
          "published_rate": { "type": "number", "nullable": true, "description": "The rate this trip was actually priced at. Null when no published band existed." },
          "published_band": { "type": "string", "nullable": true, "example": "₹2,400–₹4,800" },
          "published_source": { "type": "string", "nullable": true },
          "ai_rate": { "type": "number", "nullable": true, "description": "AI market figure. Comparison only — it is in no total, score or verdict." },
          "ai_rate_source": { "type": "string", "nullable": true },
          "ai_alt_rate": { "type": "number", "nullable": true },
          "ai_alt_source": { "type": "string", "nullable": true },
          "ai_gap_percent": { "type": "integer", "nullable": true, "description": "AI figure versus our published rate, in percent. Null when either side is missing." },
          "plan_share_percent": { "type": "integer", "nullable": true },
          "reference_share_percent": { "type": "integer", "nullable": true },
          "ratio": { "type": "number", "nullable": true, "description": "budget_allows / published_rate. Null when unscored." },
          "verdict": { "type": "string", "enum": ["COVERED", "CLOSE", "SHORT", "FAR_SHORT", "NO_HEADROOM", "NO_PUBLISHED_RATE", "NO_ROUTE_EVIDENCE"] },
          "gap_amount": { "type": "number", "nullable": true, "description": "INR still needed on this line to reach the published rate; 0 when covered." },
          "score": { "type": "integer", "nullable": true, "description": "92 COVERED, 78 CLOSE, 62 SHORT, 42 FAR_SHORT, 25 below 0.35; null when unscored." },
          "note": { "type": "string" },
          "explanation": { "type": "string" },
          "ai_note": { "type": "string" },
          "share_note": { "type": "string" }
        }
      },
      "DestinationPriceRecord": {
        "type": "object",
        "description": "One destination in the published price index.",
        "properties": {
          "destination": { "type": "string", "example": "Goa" },
          "guides_used": { "type": "integer", "example": 10 },
          "region": { "type": "string", "example": "coastal" },
          "tiers": {
            "type": "object",
            "description": "Per room per night, INR.",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "low": { "type": "number", "example": 2400 },
                "high": { "type": "number", "example": 4800 },
                "typical": { "type": "number", "example": 4080 }
              }
            }
          },
          "food_per_person_per_day": { "type": "object" },
          "paid_entry_or_activity": { "type": "object" },
          "local_mobility_per_vehicle_day": { "type": "object" },
          "mobility_items": { "type": "integer" },
          "free_attraction_share": { "type": "number" },
          "listed_attractions": { "type": "integer" }
        }
      }
    }
  },
  "paths": {
    "/api/health": {
      "get": {
        "summary": "Service health check",
        "operationId": "getHealth",
        "responses": {
          "200": { "description": "Service is up" }
        }
      }
    },
    "/api/cities": {
      "get": {
        "summary": "List supported Indian cities and destinations",
        "operationId": "listCities",
        "responses": {
          "200": {
            "description": "City names used by the planner autocomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["cities"],
                  "properties": {
                    "cities": { "type": "array", "items": { "type": "string" }, "example": ["Delhi", "Goa", "Jaipur"] }
                  }
                }
              }
            }
          },
          "500": { "description": "City data could not be loaded", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/routes": {
      "get": {
        "summary": "List curated transport route summaries",
        "operationId": "listRoutes",
        "responses": {
          "200": {
            "description": "Route ids and endpoints",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": { "type": "string" },
                      "origin": { "type": "string" },
                      "destination": { "type": "string" }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/plan": {
      "post": {
        "summary": "Generate a trip plan, itinerary, and budget breakdown",
        "operationId": "generateTripPlan",
        "security": [{ "bearerAuth": [] }, {}],
        "description": "Trip length is inclusive of both from and to dates. Reversed dates return 400. When authenticated, one plan credit is consumed unless the account has an active subscription. The response prices every line from the published destination rate index and reports the evidence in `pricing_evidence`, the per-line budget-versus-rate comparison in `rate_reality`, and the AI's market figures as comparison only.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/PlanRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculated trip plan",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/PlanResponse" }
              }
            }
          },
          "400": { "description": "Invalid trip input (missing fields, same origin/destination, reversed dates)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "403": { "description": "Insufficient plan credits", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "405": { "description": "GET and other methods are not allowed; use POST" },
          "429": { "description": "Rate limit exceeded", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "502": { "description": "AI planning service failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      },
      "get": {
        "summary": "Not allowed",
        "operationId": "getPlanNotAllowed",
        "responses": {
          "405": { "description": "Method Not Allowed. The Allow header is POST." }
        }
      }
    },
    "/api/plan/budget-intel": {
      "post": {
        "summary": "Budget intelligence for a route and tier",
        "operationId": "getBudgetIntel",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["origin", "destination"],
                "properties": {
                  "origin": { "type": "string" },
                  "destination": { "type": "string" },
                  "days": { "type": "integer" },
                  "travelers": { "type": "integer" },
                  "tier": { "type": "string", "example": "budget" },
                  "transit": { "type": "string", "example": "train" },
                  "month": { "type": "string", "example": "November" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Budget intelligence payload" },
          "429": { "description": "Rate limit exceeded" }
        }
      }
    },
    "/api/parse-intent": {
      "post": {
        "summary": "Normalize free-text travel fields into a strict JSON intent",
        "operationId": "parseTravelIntent",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "people": { "type": "string" },
                  "from": { "type": "string" },
                  "to": { "type": "string" },
                  "fromDate": { "type": "string" },
                  "toDate": { "type": "string" },
                  "budgetPerPersonPerDay": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Parsed intent" },
          "429": { "description": "Rate limit exceeded" },
          "503": { "description": "AI provider is not configured" }
        }
      }
    },
    "/api/auth/signup": {
      "post": {
        "summary": "Create an account",
        "operationId": "signup",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["name", "email", "password"],
                "properties": {
                  "name": { "type": "string" },
                  "email": { "type": "string", "format": "email" },
                  "password": { "type": "string", "format": "password" },
                  "referralCode": { "type": "string", "description": "Optional invite code; both accounts receive one bonus credit" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Account created with a bearer token and initial credits" },
          "400": { "description": "Missing fields or email already registered" }
        }
      }
    },
    "/api/auth/login": {
      "post": {
        "summary": "Sign in with email and password",
        "operationId": "login",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["email", "password"],
                "properties": {
                  "email": { "type": "string", "format": "email" },
                  "password": { "type": "string", "format": "password" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Bearer token and user profile" },
          "401": { "description": "Invalid credentials" }
        }
      }
    },
    "/api/auth/google": {
      "post": {
        "summary": "Sign in with a Google ID token",
        "operationId": "googleLogin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["credential"],
                "properties": {
                  "credential": { "type": "string", "description": "Google Identity Services ID token" },
                  "referralCode": { "type": "string", "description": "Optional invite code for new accounts" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Bearer token and user profile" },
          "401": { "description": "Invalid Google credential" }
        }
      }
    },
    "/api/auth/me": {
      "get": {
        "summary": "Current user profile",
        "operationId": "getMe",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "User profile and remaining credits" },
          "401": { "description": "Missing or invalid bearer token" }
        }
      }
    },
    "/api/auth/referral": {
      "get": {
        "summary": "Get the signed-in account's referral code, share link and stats",
        "operationId": "getReferral",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "Referral code, share link, invited count and rolling 30-day cap usage" },
          "401": { "description": "Missing or invalid bearer token" }
        }
      }
    },
    "/api/auth/saved-trips": {
      "get": {
        "summary": "List saved trips",
        "operationId": "listSavedTrips",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "Saved trips for the current user" },
          "401": { "description": "Missing or invalid bearer token" }
        }
      },
      "post": {
        "summary": "Save a trip",
        "operationId": "saveTrip",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "Saved" },
          "401": { "description": "Missing or invalid bearer token" }
        }
      }
    },
    "/api/payments/create-order": {
      "post": {
        "summary": "Create a Razorpay order (server-priced)",
        "operationId": "createPaymentOrder",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "Order id and amount" },
          "401": { "description": "Missing or invalid bearer token" },
          "429": { "description": "Rate limit exceeded" }
        }
      }
    },
    "/api/payments/verify-payment": {
      "post": {
        "summary": "Verify a Razorpay payment signature and credit the account",
        "operationId": "verifyPayment",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "Payment verified and credits added" },
          "400": { "description": "Invalid payment signature" },
          "401": { "description": "Missing or invalid bearer token" }
        }
      }
    },
    "/data/destination-price-index.json": {
      "get": {
        "summary": "Published destination price index (static file, not an API)",
        "operationId": "getDestinationPriceIndex",
        "description": "The rate data every plan is priced from: hotel bands by star tier, daily food, paid entry and local mobility for 101 destinations, 6 regional medians, an all-India median and 300 corridor package bands, all INR. The file carries its own `method`, `fields`, `coverage` and `generated_at`, so the derivation travels with the numbers. Served as a static asset with a 5-minute cache.",
        "responses": {
          "200": {
            "description": "The index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["currency", "schema_version", "generated_at", "method", "coverage", "destinations", "regions", "national", "corridors"],
                  "properties": {
                    "currency": { "type": "string", "example": "INR" },
                    "schema_version": { "type": "integer", "example": 2 },
                    "generated_at": { "type": "string", "format": "date", "example": "2026-10-27" },
                    "source": { "type": "string" },
                    "method": { "type": "object", "description": "How each band was derived, including the percentile each `typical` sits at and what was fitted against an external reference." },
                    "coverage": { "type": "object", "properties": { "guides": { "type": "integer", "example": 300 }, "destinations": { "type": "integer", "example": 101 }, "regions": { "type": "integer", "example": 6 }, "unparsed_bands": { "type": "integer", "example": 0 } } },
                    "fields": { "type": "object", "description": "What each record and unit means." },
                    "distribution": { "type": "object" },
                    "tiers_from_guide_tiers": { "type": "object", "description": "Engine tier name mapped to the published guide tier it was parsed from." },
                    "destinations": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/DestinationPriceRecord" } },
                    "regions": { "type": "object", "description": "Region medians used when a town has no guide of its own." },
                    "national": { "type": "object", "description": "All-India median, the last fallback." },
                    "corridors": { "type": "object", "description": "One record per published corridor with its distance, days and both whole-trip package bands." }
                  }
                }
              }
            }
          },
          "404": { "description": "The index has not been published with this build" }
        }
      }
    }
  }
}
