{"openapi":"3.1.0","info":{"title":"JurisFlow — Australian Legal Intelligence API","description":"Headless B2B legal reasoning API for the Fair Work Act 2009. Powered by a 4-node CRAG agent (QueryAnalyzer → Retriever → Drafter → Critic) with hybrid dense+sparse vector retrieval and citation verification.","version":"2.0.0"},"paths":{"/metrics":{"get":{"summary":"Metrics","description":"Endpoint that serves Prometheus metrics.","operationId":"metrics_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/analyze":{"post":{"tags":["B2B Analyze"],"summary":"Analyze","operationId":"analyze_api_v1_analyze_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat":{"post":{"tags":["Demo Chat"],"summary":"Chat","operationId":"chat_api_chat_post","parameters":[{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["System"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AnalyzeData":{"properties":{"answer":{"type":"string","title":"Answer"},"citations":{"items":{"$ref":"#/components/schemas/CitationOut"},"type":"array","title":"Citations"},"risk_level":{"type":"string","title":"Risk Level"},"confidence":{"type":"number","title":"Confidence"}},"type":"object","required":["answer","citations","risk_level","confidence"],"title":"AnalyzeData"},"AnalyzeRequest":{"properties":{"query":{"type":"string","maxLength":2000,"minLength":5,"title":"Query","description":"Legal question about the Fair Work Act 2009"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Optional context (e.g. jurisdiction, employer_size)"},"require_citations":{"type":"boolean","title":"Require Citations","default":true}},"type":"object","required":["query"],"title":"AnalyzeRequest"},"AnalyzeResponse":{"properties":{"status":{"type":"string","title":"Status","default":"success"},"trace_id":{"type":"string","title":"Trace Id"},"data":{"$ref":"#/components/schemas/AnalyzeData"},"usage":{"$ref":"#/components/schemas/UsageOut"}},"type":"object","required":["trace_id","data","usage"],"title":"AnalyzeResponse"},"ChatRequest":{"properties":{"message":{"type":"string","title":"Message"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"}},"type":"object","required":["message"],"title":"ChatRequest"},"CitationOut":{"properties":{"document_id":{"type":"string","title":"Document Id"},"clause":{"type":"string","title":"Clause"},"url":{"type":"string","title":"Url"},"excerpt":{"type":"string","title":"Excerpt"}},"type":"object","required":["document_id","clause","url","excerpt"],"title":"CitationOut"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"UsageOut":{"properties":{"tokens_in":{"type":"integer","title":"Tokens In"},"tokens_out":{"type":"integer","title":"Tokens Out"},"cost_usd":{"type":"number","title":"Cost Usd"},"latency_ms":{"type":"integer","title":"Latency Ms"},"critic_grade":{"type":"string","title":"Critic Grade"}},"type":"object","required":["tokens_in","tokens_out","cost_usd","latency_ms","critic_grade"],"title":"UsageOut"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}