{"openapi":"3.1.0","info":{"title":"Gotthard Pilot API","version":"1.0.0+0da25550f60a","summary":"Derived decisions for crossing the Gotthard: go now, wait, pass road or A13; forecasts, planning and live trips.","description":"Every answer carries a recommendation, value ranges, confidence, timestamps, reason codes, data freshness and provenance. Only derived values are published, never raw source records. Official road signs always take precedence.\n\nAttribution required when you show values: «Datenquelle: Verkehrsdaten-Plattform (VDP) ASTRA» and «Gotthard Pilot». Anonymous use with a rate limit of 60 requests per minute and IP; planning beyond tomorrow and the detailed strategic break need a Gotthard Pass (header X-Gp-Pass). The same capabilities are available as MCP tools at POST /mcp.","contact":{"name":"Gotthard Pilot","url":"https://gotthardpilot.ch/api"}},"servers":[{"url":"https://gotthardpilot.ch"}],"paths":{"/v1/state/{direction}":{"get":{"operationId":"get_live_state","summary":"Live state and one recommendation for a direction and vehicle","parameters":[{"name":"direction","in":"path","required":true,"schema":{"type":"string","enum":["south","north"]},"description":"south = towards Ticino/Italy, north = towards Central Switzerland/Germany"},{"name":"vehicle","in":"query","required":false,"schema":{"type":"string","enum":["car","camper","trailer"],"default":"car","description":"With camper or trailer the pass road is never recommended on its own (legal, but steep with hairpins)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/State"}}}},"400":{"description":"Unknown direction or vehicle","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit"}}}},"/v1/pass":{"get":{"operationId":"get_pass_status","summary":"Gotthard Pass road status","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PassStatus"}}}}}}},"/v1/routes/compare":{"post":{"operationId":"compare_routes","summary":"Tunnel vs pass road vs A13","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["direction"],"properties":{"direction":{"type":"string","enum":["south","north"]},"vehicle":{"type":"string","enum":["car","camper","trailer"],"default":"car","description":"With camper or trailer the pass road is never recommended on its own (legal, but steep with hairpins)."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Compare"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/plan":{"post":{"operationId":"plan_crossing","summary":"Best window, hours to avoid and departure time for a date","security":[{"passHeader":[]},{}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["direction","date"],"properties":{"direction":{"type":"string","enum":["south","north"]},"date":{"type":"string","format":"date"},"origin":{"type":"string","enum":["amsterdam","utrecht","eindhoven","bruessel","koeln","frankfurt","stuttgart","muenchen","basel","zuerich","bern","luzern","milano","como","lugano","locarno","bellinzona"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"400":{"description":"Invalid date or origin","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"premium_required: dates after tomorrow need a Gotthard Pass","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/pressure/{direction}":{"get":{"operationId":"get_pressure","summary":"Gotthard pressure now and for the next days","parameters":[{"name":"direction","in":"path","required":true,"schema":{"type":"string","enum":["south","north"]},"description":"south = towards Ticino/Italy, north = towards Central Switzerland/Germany"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pressure"}}}},"400":{"description":"Unknown direction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/forecast/{direction}":{"get":{"operationId":"predict_queue","summary":"Delay forecast for the next 6 hours and the strategic break","security":[{"passHeader":[]},{}],"parameters":[{"name":"direction","in":"path","required":true,"schema":{"type":"string","enum":["south","north"]},"description":"south = towards Ticino/Italy, north = towards Central Switzerland/Germany"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forecast"}}}},"400":{"description":"Unknown direction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/trips":{"post":{"operationId":"start_trip","summary":"Start a live trip without an account","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["direction"],"properties":{"direction":{"type":"string","enum":["south","north"]}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TripStart"}}}},"429":{"description":"20 trips per hour and IP"}}}},"/v1/trips/{id}/probes":{"post":{"operationId":"update_trip_location","summary":"Send a position (projected to corridor km, never stored)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{22}$"},"description":"trip_id from POST /v1/trips (the id is the authorisation)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["lat","lon"],"properties":{"lat":{"type":"number","minimum":44,"maximum":49.5},"lon":{"type":"number","minimum":4,"maximum":12},"accuracy_m":{"type":"number","minimum":0}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["ok","eta"],"properties":{"ok":{"const":true},"eta":{"$ref":"#/components/schemas/Eta"}}}}}},"404":{"description":"trip_not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"trip_ended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/trips/{id}/eta":{"get":{"operationId":"get_trip_eta","summary":"Personal tunnel ETA as a range","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{22}$"},"description":"trip_id from POST /v1/trips (the id is the authorisation)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["ok","trip","eta"],"properties":{"ok":{"const":true},"trip":{"type":"object"},"eta":{"$ref":"#/components/schemas/Eta"}}}}}},"404":{"description":"trip_not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/trips/{id}/share":{"post":{"operationId":"share_trip","summary":"Read-only share link (no coordinates, expires 2 h after the trip)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{22}$"},"description":"trip_id from POST /v1/trips (the id is the authorisation)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["ok","share_path","share_urls","expires"],"properties":{"ok":{"const":true},"share_path":{"type":"string"},"share_urls":{"type":"object","additionalProperties":{"type":"string","format":"uri"}},"expires":{"type":"string"}}}}}},"404":{"description":"trip_not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"trip_ended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/trips/{id}/end":{"post":{"operationId":"end_trip","summary":"End a trip","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{22}$"},"description":"trip_id from POST /v1/trips (the id is the authorisation)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["ok","ended_at","reason"],"properties":{"ok":{"const":true},"ended_at":{"type":"string","format":"date-time"},"reason":{"type":"string"}}}}}},"404":{"description":"trip_not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/shared/{token}":{"get":{"operationId":"get_shared_trip","summary":"What a share link shows (ETA range, never coordinates)","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["ok","running","direction","eta"],"properties":{"ok":{"const":true},"running":{"type":"boolean"},"direction":{"type":"string"},"eta":{"type":"object"}}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/route/{direction}":{"get":{"operationId":"get_route_details","summary":"The last 40 km before the tunnel: exits with entries closed by the Uri rule, motorway stops, the traffic light at the portal with measured throughput, webcams (names and link)","parameters":[{"name":"direction","in":"path","required":true,"schema":{"type":"string","enum":["south","north"]},"description":"south = towards Ticino/Italy, north = towards Central Switzerland/Germany"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Route"}}}},"400":{"description":"Unknown direction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/history/{direction}":{"get":{"operationId":"get_queue_history","summary":"Queue history of the last 24, 48 or 72 hours: 144 buckets with the longest queue, longest wait and tunnel closures; empty buckets had no fresh data","parameters":[{"name":"direction","in":"path","required":true,"schema":{"type":"string","enum":["south","north"]},"description":"south = towards Ticino/Italy, north = towards Central Switzerland/Germany"},{"name":"hours","in":"query","required":false,"schema":{"type":"integer","enum":[24,48,72],"default":24}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/History"}}}},"400":{"description":"Unknown direction or hours","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/answers":{"get":{"operationId":"list_answers","summary":"Canonical answers to the common Gotthard questions (same as the MCP tool get_answer without id)","parameters":[{"name":"lang","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z]{2}$","default":"de"},"description":"Language of the answers: de or nl (all answers); en, it, fr and da so far only toll and vignette (A15, A16)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Answers"}}}},"400":{"description":"Unknown language (allowed in the error)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/answers/{answer_id}":{"get":{"operationId":"get_answer","summary":"One canonical answer with short answer, why, limits, sources, check date, confidence and next action","parameters":[{"name":"answer_id","in":"path","required":true,"schema":{"type":"string","pattern":"^A[0-9]{2}$"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z]{2}$","default":"de"},"description":"Language of the answers: de or nl (all answers); en, it, fr and da so far only toll and vignette (A15, A16)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["ok","lang","langs","answer"],"properties":{"answer":{"$ref":"#/components/schemas/Answer"}}}}}},"400":{"description":"Unknown language","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"answer_not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/stops/recommend":{"get":{"operationId":"find_strategic_stop","summary":"Last good motorway stop before the end of the queue (only when a relevant queue exists)","parameters":[{"name":"direction","in":"query","required":true,"schema":{"type":"string","enum":["south","north"]}},{"name":"needs","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated: toilet, food, shop, fuel, ev_charging, children, camper"},{"name":"trip_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{22}$"},"description":"Running trip: only stops ahead, with minutes_away"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["ok","direction","useful","reason","stop"],"properties":{"useful":{"type":"boolean"},"reason":{"type":"string","enum":["no_relevant_queue","no_matching_stop_before_queue","last_stop_before_queue"]},"stop":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["service_area","rest_area"]},"services":{"type":"array","items":{"type":"string"}},"km_before_queue":{"type":"number"},"minutes_away":{"type":["integer","null"]},"source":{"type":"string"},"checked":{"type":"string"}}}}}}}},"400":{"description":"Unknown direction, need or trip_id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/lounge/{direction}":{"get":{"operationId":"get_lounge","summary":"Queue Lounge: travellers on the road (from 3), predefined reports of the last 30 minutes, poll «pass or stay?»","parameters":[{"name":"direction","in":"path","required":true,"schema":{"type":"string","enum":["south","north"]},"description":"south = towards Ticino/Italy, north = towards Central Switzerland/Germany"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lounge"}}}},"400":{"description":"Unknown direction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit"}}}},"/v1/lounge/{direction}/reports":{"post":{"operationId":"post_lounge_report","summary":"Post a predefined report (only when not driving: passenger must be true)","parameters":[{"name":"direction","in":"path","required":true,"schema":{"type":"string","enum":["south","north"]},"description":"south = towards Ticino/Italy, north = towards Central Switzerland/Germany"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["kind","passenger"],"properties":{"kind":{"type":"string","enum":["moving","stop_and_go","standstill","incident"]},"passenger":{"type":"boolean"},"trip_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{22}$","description":"Running trip of the same direction: adds the rough section, never a position."}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lounge"}}}},"400":{"description":"passenger_mode_required or invalid kind","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit"}}}},"/v1/lounge/{direction}/votes":{"post":{"operationId":"vote_lounge_poll","summary":"Vote «pass or stay?» (one vote per device and hour; only when not driving)","parameters":[{"name":"direction","in":"path","required":true,"schema":{"type":"string","enum":["south","north"]},"description":"south = towards Ticino/Italy, north = towards Central Switzerland/Germany"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["choice","passenger"],"properties":{"choice":{"type":"string","enum":["tunnel","pass","a13"]},"passenger":{"type":"boolean"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lounge"}}}},"400":{"description":"passenger_mode_required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit"}}}}},"components":{"securitySchemes":{"passHeader":{"type":"apiKey","in":"header","name":"X-Gp-Pass","description":"Gotthard Pass code (GP-XXXX-XXXX); optional, unlocks planning beyond tomorrow and the detailed strategic break."}},"schemas":{"Range":{"type":"object","required":["estimate","range","confidence"],"properties":{"estimate":{"type":"integer"},"range":{"type":"array","items":{"type":"integer"},"minItems":2,"maxItems":2},"confidence":{"type":"number","minimum":0,"maximum":1},"basis":{"type":"string"}}},"Recommendation":{"type":"object","required":["action","reasons","confidence","model_version"],"properties":{"action":{"type":"string","enum":["go_now","wait","recheck","take_pass","take_a13","no_live_data"]},"reasons":{"type":"array","items":{"type":"string"}},"confidence":{"type":"number"},"saving_minutes":{"type":["integer","null"]},"recheck_in_minutes":{"type":["integer","null"]},"model_version":{"type":"string"}}},"Freshness":{"type":"object","required":["state","age_seconds"],"properties":{"state":{"type":"string","enum":["fresh","delayed","no_live_data"]},"age_seconds":{"type":["integer","null"]},"source_updated_at":{"type":["string","null"],"format":"date-time"}}},"Provenance":{"type":"object","required":["class","attribution"],"properties":{"class":{"const":"derived"},"attribution":{"type":"string"},"model":{"type":"string"},"note":{"type":"string"}}},"State":{"type":"object","required":["ok","generated_at","direction","recommendation","freshness","provenance"],"properties":{"ok":{"const":true},"generated_at":{"type":"string","format":"date-time"},"direction":{"type":"string"},"recommendation":{"$ref":"#/components/schemas/Recommendation"},"queue":{"type":["object","null"],"properties":{"ahead":{"$ref":"#/components/schemas/Ahead"}}},"delay_minutes":{"oneOf":[{"$ref":"#/components/schemas/Range"},{"type":"null"}]},"tunnel":{"type":"object","properties":{"status":{"type":"string","enum":["open","closed","closed_winter","unknown"]},"closures_next_24h":{"type":"array","description":"Planned closures only; an incident without an end (breakdown, accident) is never projected forward"},"current_report":{"type":["object","null"],"description":"Active closure report. The tunnel counts as closed only if our counter at the portal confirms it (counter=stopped) or has no fresh data; flowing or unclear means traffic still enters the tunnel.","properties":{"kind":{"type":"string","enum":["incident","planned"]},"since":{"type":["string","null"],"format":"date-time"},"cause":{"type":["string","null"],"enum":["breakdown","accident","fire","works",null]},"counter":{"type":"string","enum":["stopped","flowing","unclear","no_data"]}}}}},"pass":{"type":"object","properties":{"status":{"type":"string"},"weather":{"oneOf":[{"$ref":"#/components/schemas/Weather"},{"type":"null"}]}}},"a13":{"type":"object"},"freshness":{"$ref":"#/components/schemas/Freshness"},"provenance":{"$ref":"#/components/schemas/Provenance"}}},"PassStatus":{"type":"object","required":["ok","generated_at","pass","freshness","provenance"],"properties":{"pass":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["open","closed","closed_winter","unknown"]},"weather":{"oneOf":[{"$ref":"#/components/schemas/Weather"},{"type":"null"}],"description":"Weather at the pass for the next hours (MeteoSwiss); null without fresh data"}}},"freshness":{"$ref":"#/components/schemas/Freshness"},"provenance":{"$ref":"#/components/schemas/Provenance"}}},"Weather":{"type":"object","description":"Derived pass weather: snow risk from the forecast symbol or measured cold and wet at Gütsch (2286 m), fog, expected precipitation. Source: MeteoSwiss Open Data (CC BY 4.0).","required":["snow_risk","fog","precipitation_expected","window_hours","source"],"properties":{"snow_risk":{"type":"boolean"},"snow_risk_basis":{"type":["string","null"],"enum":["forecast_symbol","measured_cold_and_wet",null]},"fog":{"type":"boolean"},"precipitation_expected":{"type":"boolean"},"temperature_c":{"type":["number","null"]},"temperature_station":{"type":"string"},"window_hours":{"type":"integer"},"observed_at":{"type":["string","null"],"format":"date-time"},"forecast_run":{"type":["string","null"],"format":"date-time"},"source":{"type":"string"}}},"Compare":{"type":"object","required":["ok","generated_at","direction","recommendation","options","freshness","provenance"],"properties":{"recommendation":{"$ref":"#/components/schemas/Recommendation"},"options":{"type":["array","null"],"items":{"type":"object"}},"freshness":{"$ref":"#/components/schemas/Freshness"},"provenance":{"$ref":"#/components/schemas/Provenance"}}},"Plan":{"type":"object","required":["ok","direction","date","best_window","avoid","hours","confidence","reasons","model","provenance"],"properties":{"best_window":{"type":"object","required":["from","to","delay_minutes"]},"avoid":{"type":"array"},"departure":{"type":["object","null"]},"hours":{"type":"array","items":{"$ref":"#/components/schemas/Hour"}},"confidence":{"type":"number"},"reasons":{"type":"array"},"model":{"type":"string"},"provenance":{"$ref":"#/components/schemas/Provenance"}}},"Hour":{"type":"object","required":["hour_start","pressure","delay_minutes","basis"],"properties":{"hour_start":{"type":"string","format":"date-time"},"pressure":{"$ref":"#/components/schemas/PressureValue"},"delay_minutes":{"$ref":"#/components/schemas/Range"},"basis":{"type":"string","enum":["pattern","pattern_blended_with_live"]}}},"PressureValue":{"type":"object","required":["value","level","reasons"],"properties":{"value":{"type":"number","minimum":0,"maximum":10},"level":{"type":"string","enum":["low","medium","high","very_high"]},"reasons":{"type":"array","items":{"type":"string"},"description":"Reason codes, e.g. wochenende, sommer, ferienbeginn:DE"}}},"Pressure":{"type":"object","required":["ok","direction","now","days","provenance"],"properties":{"now":{"$ref":"#/components/schemas/PressureValue"},"days":{"type":"array","items":{"type":"object","required":["date","peak","best"]}},"provenance":{"$ref":"#/components/schemas/Provenance"}}},"Forecast":{"type":"object","required":["ok","direction","hours","strategic_break","improves_in_minutes","provenance"],"properties":{"hours":{"type":"array","items":{"$ref":"#/components/schemas/Hour"}},"strategic_break":{"type":["object","null"],"description":"null without a queue; {premium_required: true} without a Pass"},"improves_in_minutes":{"type":["integer","null"]},"provenance":{"$ref":"#/components/schemas/Provenance"}}},"TripStart":{"type":"object","required":["ok","trip_id","direction","started_at","links","privacy"],"properties":{"trip_id":{"type":"string"},"links":{"type":"object","required":["probes","eta","end","share","handoff"],"properties":{"handoff":{"type":"string","format":"uri","description":"Open in the user's browser to continue the trip with their consent to share location."}}}}},"Ahead":{"type":["object","null"],"description":"Who is ahead of you (D26): vehicles estimated from delay x tunnel throughput (about 1000/h), Gotthard Pilot users only from 3 on, never positions.","properties":{"vehicles":{"oneOf":[{"$ref":"#/components/schemas/Range"},{"type":"null"}]},"gotthard_pilot_users":{"type":["integer","null"],"minimum":3},"moving_faster":{"type":["boolean","null"]}}},"Eta":{"type":"object","required":["status","updated_at","model_version","provenance"],"properties":{"status":{"type":"string"},"tunnel_entry":{"type":["object","null"]},"minutes_to_tunnel":{"oneOf":[{"$ref":"#/components/schemas/Range"},{"type":"null"}]},"distance_remaining_km":{"type":["number","null"]},"queue_progress":{"type":["number","null"]},"ahead":{"$ref":"#/components/schemas/Ahead"},"updated_at":{"type":"string","format":"date-time"},"provenance":{"$ref":"#/components/schemas/Provenance"}}},"History":{"type":"object","required":["ok","generated_at","direction","hours","bucket_minutes","until","points","summary","provenance"],"properties":{"hours":{"type":"integer"},"bucket_minutes":{"type":"integer"},"until":{"type":"string","format":"date-time"},"points":{"type":"array","items":{"type":"object","required":["from","queue_km","delay_minutes","tunnel_closed"],"properties":{"from":{"type":"string","format":"date-time"},"queue_km":{"type":["number","null"],"description":"null = no fresh source data in this bucket"},"delay_minutes":{"type":["integer","null"]},"tunnel_closed":{"type":"boolean"}}}},"summary":{"type":"object","required":["max_queue_km","max_delay_minutes","queue_minutes"],"properties":{"max_queue_km":{"type":"number"},"max_queue_at":{"type":["string","null"],"format":"date-time"},"max_delay_minutes":{"type":"integer"},"max_delay_at":{"type":["string","null"],"format":"date-time"},"queue_minutes":{"type":"integer"}}},"provenance":{"$ref":"#/components/schemas/Provenance"}}},"Route":{"type":"object","required":["ok","generated_at","direction","exits","stops","metering","webcams","notes","provenance","freshness"],"properties":{"exits":{"type":"array","items":{"type":"object","required":["id","name","number","km_to_portal","entry_closed","entry_closed_basis"],"properties":{"number":{"type":"integer"},"km_to_portal":{"type":"number"},"entry_closed":{"type":"boolean","description":"Entry towards the tunnel closed by the published rule of the canton of Uri (spring, pass closed, queue from 3 km). Never reported as open."},"entry_closed_basis":{"type":["string","null"],"enum":["rule_canton_uri",null]}}}},"stops":{"type":"array","items":{"type":"object","required":["id","name","type","km_to_portal","services"]}},"metering":{"type":"object","required":["active","throughput_per_hour"],"properties":{"active":{"type":"boolean"},"throughput_per_hour":{"type":["integer","null"],"description":"Measured vehicles per hour into the tunnel (15-minute mean), only while metering"}}},"webcams":{"type":"object","required":["queue","pass","page","images"],"properties":{"page":{"type":"string","format":"uri"},"images":{"const":false}}},"notes":{"type":"array","items":{"type":"string","enum":["exit_metering_erstfeld_amsteg","pass_metering_gamsboden"]}},"provenance":{"$ref":"#/components/schemas/Provenance"}}},"Lounge":{"type":"object","required":["ok","direction","generated_at","gotthard_pilot_travellers","reports_last_30_min","poll"],"properties":{"gotthard_pilot_travellers":{"type":["integer","null"],"minimum":3},"reports_last_30_min":{"type":"array","items":{"type":"object","required":["kind","count","last_at"],"properties":{"after":{"type":["string","null"],"description":"Rough section: the corridor node before the reports (e.g. Wassen)"}}}},"poll":{"type":"object","required":["votes_last_60_min","total"]}}},"Answer":{"type":"object","description":"A canonical answer from the Gotthard Pilot answer catalogue, checked against its sources on the date in checked.","required":["id","lang","question","short_answer","why","limits","confidence","checked","sources","next_action","url"],"properties":{"id":{"type":"string"},"lang":{"type":"string"},"question":{"type":"string"},"short_answer":{"type":"string","description":"1 to 3 sentences"},"why":{"type":"string"},"limits":{"type":"string"},"confidence":{"type":"string","enum":["high","medium","low"]},"checked":{"type":"string","format":"date"},"sources":{"type":"array","items":{"type":"object","required":["name","url"],"properties":{"name":{"type":"string"},"url":{"type":["string","null"],"format":"uri"}}}},"next_action":{"type":"object","required":["capability","url"],"properties":{"capability":{"type":"string","description":"MCP tool / operationId for live values"},"url":{"type":"string","format":"uri","description":"Page for a human"}}},"url":{"type":"string","format":"uri","description":"Page with anchor where the answer is published"}}},"Answers":{"type":"object","required":["ok","lang","langs","answers"],"properties":{"lang":{"type":"string"},"langs":{"type":"array","items":{"type":"string"}},"answers":{"type":"array","items":{"$ref":"#/components/schemas/Answer"}},"note":{"type":"string"}}},"Error":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"}}}}}}